mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 13:34:53 +00:00
[IPHLPAPI] Properly handle GetModuleBaseName failure
CID 1442662, 1442663
This commit is contained in:
parent
93b0957641
commit
22cb300805
|
@ -2289,7 +2289,7 @@ DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
|
|||
static DWORD GetOwnerModuleFromPidEntry(DWORD OwningPid, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
|
||||
{
|
||||
HANDLE Process;
|
||||
DWORD FileLen, PathLen;
|
||||
DWORD FileLen, PathLen, Error;
|
||||
WCHAR File[MAX_PATH], Path[MAX_PATH];
|
||||
PTCPIP_OWNER_MODULE_BASIC_INFO BasicInfo;
|
||||
|
||||
|
@ -2326,13 +2326,23 @@ static DWORD GetOwnerModuleFromPidEntry(DWORD OwningPid, TCPIP_OWNER_MODULE_INFO
|
|||
PathLen *= sizeof(WCHAR);
|
||||
FileLen *= sizeof(WCHAR);
|
||||
}
|
||||
else if (GetLastError() == ERROR_PARTIAL_COPY)
|
||||
else
|
||||
{
|
||||
wcscpy(File, L"System");
|
||||
wcscpy(Path, L"System");
|
||||
Error = GetLastError();
|
||||
|
||||
PathLen = sizeof(L"System");
|
||||
FileLen = sizeof(L"System");
|
||||
if (Error == ERROR_PARTIAL_COPY)
|
||||
{
|
||||
wcscpy(File, L"System");
|
||||
wcscpy(Path, L"System");
|
||||
|
||||
PathLen = sizeof(L"System");
|
||||
FileLen = sizeof(L"System");
|
||||
}
|
||||
else
|
||||
{
|
||||
CloseHandle(Process);
|
||||
return Error;
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(Process);
|
||||
|
|
Loading…
Reference in a new issue