@@ -2314,16 +2314,21 @@ BOOLEAN PhUiRestartProcess(
2314
2314
{
2315
2315
if (Process -> ProcessId == shellClientId .UniqueProcess )
2316
2316
{
2317
- status = PhOpenProcess (
2317
+ if ( NT_SUCCESS ( PhOpenProcess (
2318
2318
& processHandle ,
2319
2319
PROCESS_TERMINATE ,
2320
2320
Process -> ProcessId
2321
- );
2322
-
2323
- if (NT_SUCCESS (status ))
2321
+ )))
2324
2322
{
2325
- PhTerminateProcess (processHandle , STATUS_SUCCESS );
2323
+ status = PhTerminateProcess (
2324
+ processHandle ,
2325
+ STATUS_SUCCESS
2326
+ );
2327
+
2326
2328
NtClose (processHandle );
2329
+
2330
+ if (NT_SUCCESS (status ))
2331
+ goto CleanupExit ;
2327
2332
}
2328
2333
}
2329
2334
}
@@ -2361,7 +2366,7 @@ BOOLEAN PhUiRestartProcess(
2361
2366
2362
2367
if (!NT_SUCCESS (status = PhGetProcessEnvironment (
2363
2368
processHandle ,
2364
- Process -> IsWow64Process ? PH_GET_PROCESS_ENVIRONMENT_WOW64 : 0 ,
2369
+ !! Process -> IsWow64Process ,
2365
2370
& environmentBuffer ,
2366
2371
& environmentLength
2367
2372
)))
@@ -5112,18 +5117,22 @@ BOOLEAN PhUiCloseConnections(
5112
5117
_In_ ULONG NumberOfConnections
5113
5118
)
5114
5119
{
5115
- ULONG (WINAPI * SetTcpEntry_I )(_In_ PMIB_TCPROW pTcpRow ) = NULL ;
5120
+ static ULONG (WINAPI * SetTcpEntry_I )(_In_ PMIB_TCPROW pTcpRow ) = NULL ;
5116
5121
BOOLEAN success = TRUE;
5117
5122
BOOLEAN cancelled = FALSE;
5118
5123
ULONG result ;
5119
5124
ULONG i ;
5120
5125
MIB_TCPROW tcpRow ;
5121
5126
5122
- SetTcpEntry_I = PhGetDllProcedureAddress (L"iphlpapi.dll" , "SetTcpEntry" , 0 );
5127
+ if (!SetTcpEntry_I )
5128
+ {
5129
+ SetTcpEntry_I = PhGetDllProcedureAddress (L"iphlpapi.dll" , "SetTcpEntry" , 0 );
5130
+ }
5123
5131
5124
5132
if (!SetTcpEntry_I )
5125
5133
{
5126
5134
PhShowError2 (WindowHandle , L"This feature is not supported by your operating system." , L"%s" , L"" );
5135
+ PhShowStatus (WindowHandle , L"Unable to close the TCP connection" , STATUS_NOT_SUPPORTED , 0 );
5127
5136
return FALSE;
5128
5137
}
5129
5138
@@ -5807,7 +5816,7 @@ BOOLEAN PhUiUnloadModule(
5807
5816
5808
5817
if (status == STATUS_DLL_NOT_FOUND )
5809
5818
{
5810
- PhShowError2 (WindowHandle , L"Unable to find the module to unload. " , L"%s" , L"" );
5819
+ PhShowStatus (WindowHandle , L"Unable to unload the module" , 0 , ERROR_MOD_NOT_FOUND );
5811
5820
return FALSE;
5812
5821
}
5813
5822
0 commit comments