Use the Job Object only on Windows XP and later. This avoids a bunch of warnings on Windows 2000, because SetInformationJobObject() is going to fail there.
This commit is contained in:
parent
80df6532cd
commit
c5b692ffd8
@ -30,7 +30,7 @@
|
||||
#define VER_LAMEXP_MINOR_LO 4
|
||||
#define VER_LAMEXP_TYPE Beta
|
||||
#define VER_LAMEXP_PATCH 4
|
||||
#define VER_LAMEXP_BUILD 898
|
||||
#define VER_LAMEXP_BUILD 899
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Tool versions (minimum expected versions!)
|
||||
|
@ -68,12 +68,16 @@ AbstractTool::AbstractTool(void)
|
||||
|
||||
if(m_jobObjRefCount < 1U)
|
||||
{
|
||||
if(!CreateJobObjectPtr || !SetInformationJobObjectPtr)
|
||||
DWORD osVersionNo = lamexp_get_os_version();
|
||||
if(((HIWORD(osVersionNo) == 5) && (LOWORD(osVersionNo) >= 1)) || (HIWORD(osVersionNo) > 5))
|
||||
{
|
||||
if((!CreateJobObjectPtr) || (!SetInformationJobObjectPtr))
|
||||
{
|
||||
QLibrary Kernel32Lib("kernel32.dll");
|
||||
CreateJobObjectPtr = (CreateJobObjectFun) Kernel32Lib.resolve("CreateJobObjectA");
|
||||
SetInformationJobObjectPtr = (SetInformationJobObjectFun) Kernel32Lib.resolve("SetInformationJobObject");
|
||||
}
|
||||
}
|
||||
if(CreateJobObjectPtr && SetInformationJobObjectPtr)
|
||||
{
|
||||
HANDLE jobObject = CreateJobObjectPtr(NULL, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user