diff options
author | Jan Dubois <jand@activestate.com> | 2010-12-10 17:45:30 -0800 |
---|---|---|
committer | Jan Dubois <jand@activestate.com> | 2010-12-10 17:45:30 -0800 |
commit | 0d135d25496046c60a195844bcab41bce8b8f5cc (patch) | |
tree | 7619eb11e9c499312d0d8f60543deba1fc942abd /cpan/Win32/Win32.xs | |
parent | 3707930867f717d57fcf64228b8b1fe57e88716a (diff) | |
download | perl-0d135d25496046c60a195844bcab41bce8b8f5cc.tar.gz |
Update Win32 from CPAN (from 0.40 to 0.41)
Diffstat (limited to 'cpan/Win32/Win32.xs')
-rw-r--r-- | cpan/Win32/Win32.xs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cpan/Win32/Win32.xs b/cpan/Win32/Win32.xs index 2799290597..f6d96b4374 100644 --- a/cpan/Win32/Win32.xs +++ b/cpan/Win32/Win32.xs @@ -39,6 +39,7 @@ typedef BOOL (__stdcall *PFNEqualSid)(PSID, PSID); typedef void* (__stdcall *PFNFreeSid)(PSID);
typedef BOOL (__stdcall *PFNIsUserAnAdmin)(void);
typedef BOOL (WINAPI *PFNGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD*);
+typedef void (WINAPI *PFNGetNativeSystemInfo)(LPSYSTEM_INFO lpSystemInfo);
#ifndef CSIDL_MYMUSIC
# define CSIDL_MYMUSIC 0x000D
@@ -792,9 +793,17 @@ XS(w32_GetChipName) {
dXSARGS;
SYSTEM_INFO sysinfo;
+ HMODULE module;
+ PFNGetNativeSystemInfo pfnGetNativeSystemInfo;
Zero(&sysinfo,1,SYSTEM_INFO);
- GetSystemInfo(&sysinfo);
+ module = GetModuleHandle("kernel32.dll");
+ GETPROC(GetNativeSystemInfo);
+ if (pfnGetNativeSystemInfo)
+ pfnGetNativeSystemInfo(&sysinfo);
+ else
+ GetSystemInfo(&sysinfo);
+
/* XXX docs say dwProcessorType is deprecated on NT */
XSRETURN_IV(sysinfo.dwProcessorType);
}
@@ -1659,7 +1668,7 @@ XS(w32_GetSystemMetrics) if (items != 1)
Perl_croak(aTHX_ "usage: Win32::GetSystemMetrics($index)");
- XSRETURN_IV(GetSystemMetrics(SvIV(ST(0))));
+ XSRETURN_IV(GetSystemMetrics((int)SvIV(ST(0))));
}
XS(w32_GetProductInfo)
|