17 |
|
|
18 |
#include <windows.h> |
#include <windows.h> |
19 |
|
|
20 |
|
BOOL fRunOnVistaAndLater; |
21 |
|
|
22 |
|
BOOL Is_Vista_or_Later () |
23 |
|
{ |
24 |
|
OSVERSIONINFOEX osvi; |
25 |
|
DWORDLONG dwlConditionMask = 0; |
26 |
|
int op=VER_GREATER_EQUAL; |
27 |
|
|
28 |
|
// Initialize the OSVERSIONINFOEX structure. |
29 |
|
|
30 |
|
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); |
31 |
|
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); |
32 |
|
osvi.dwMajorVersion = 6; |
33 |
|
|
34 |
|
// Initialize the condition mask. |
35 |
|
VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, op ); |
36 |
|
|
37 |
|
// Perform the test. |
38 |
|
return VerifyVersionInfo( |
39 |
|
&osvi, |
40 |
|
VER_MAJORVERSION, |
41 |
|
dwlConditionMask); |
42 |
|
} |
43 |
|
|
44 |
/** This function provides handling for load/unload and attach/detach notifications |
/** This function provides handling for load/unload and attach/detach notifications |
45 |
to allow the DLL to manage its state and allocated resources. For more information, |
to allow the DLL to manage its state and allocated resources. For more information, |
54 |
// Perform actions based on the reason for calling. |
// Perform actions based on the reason for calling. |
55 |
if (dwReason == DLL_PROCESS_ATTACH) |
if (dwReason == DLL_PROCESS_ATTACH) |
56 |
{ |
{ |
57 |
|
fRunOnVistaAndLater = Is_Vista_or_Later(); |
58 |
return TRUE; |
return TRUE; |
59 |
} |
} |
60 |
else |
else |