mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 16:49:45 +08:00
* pinfo.cc (enum_init): Don't suffer silently if we can't load the process
enumerators.
This commit is contained in:
parent
99119403f3
commit
dd07a42567
@ -1,3 +1,8 @@
|
|||||||
|
Tue Oct 31 12:00:06 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
* pinfo.cc (enum_init): Don't suffer silently if we can't load the
|
||||||
|
process enumerators.
|
||||||
|
|
||||||
Mon Oct 30 16:54:26 2000 Christopher Faylor <cgf@cygnus.com>
|
Mon Oct 30 16:54:26 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* signal.cc (kill_pgrp): Revert 25-Oct change.
|
* signal.cc (kill_pgrp): Revert 25-Oct change.
|
||||||
|
@ -337,11 +337,17 @@ enum_init (DWORD *lpidProcess, DWORD cb, DWORD *cbneeded)
|
|||||||
{
|
{
|
||||||
h = LoadLibrary ("psapi.dll");
|
h = LoadLibrary ("psapi.dll");
|
||||||
if (!h)
|
if (!h)
|
||||||
|
{
|
||||||
|
system_printf ("couldn't load psapi.dll, %E");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
myEnumProcesses = (ENUMPROCESSES) GetProcAddress (h, "EnumProcesses");
|
myEnumProcesses = (ENUMPROCESSES) GetProcAddress (h, "EnumProcesses");
|
||||||
if (!myEnumProcesses)
|
if (!myEnumProcesses)
|
||||||
|
{
|
||||||
|
system_printf ("couldn't locate EnumProcesses in psapi.dll, %E");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
h = GetModuleHandle("kernel32.dll");
|
h = GetModuleHandle("kernel32.dll");
|
||||||
@ -352,7 +358,10 @@ enum_init (DWORD *lpidProcess, DWORD cb, DWORD *cbneeded)
|
|||||||
myProcess32Next = (PROCESSWALK)
|
myProcess32Next = (PROCESSWALK)
|
||||||
GetProcAddress(h, "Process32Next");
|
GetProcAddress(h, "Process32Next");
|
||||||
if (!myCreateToolhelp32Snapshot || !myProcess32First || !myProcess32Next)
|
if (!myCreateToolhelp32Snapshot || !myProcess32First || !myProcess32Next)
|
||||||
|
{
|
||||||
|
system_printf ("Couldn't find toolhelp processes, %E");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
myEnumProcesses = EnumProcessesW95;
|
myEnumProcesses = EnumProcessesW95;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user