diff options
author | Jan Dubois <jand@activestate.com> | 2010-12-08 14:07:18 -0800 |
---|---|---|
committer | Jan Dubois <jand@activestate.com> | 2010-12-08 15:36:22 -0800 |
commit | 0e5d25bf51a3de62b6938cc50b508a0107f024bb (patch) | |
tree | 4b0b9b1a67402eae2b33996d46a1cfdf301e7e01 /cpan/Win32/Win32.xs | |
parent | d66e82e8086974a3e2dcb5f6cef8318f80b43e22 (diff) | |
download | perl-0e5d25bf51a3de62b6938cc50b508a0107f024bb.tar.gz |
Upgrade Win32 from CPAN (from 0.39 to 0.40)
Yes, still has CR/LF line endings; I'll fix it in a CPAN
release with no changes but the line-endings fix first.
Diffstat (limited to 'cpan/Win32/Win32.xs')
-rw-r--r-- | cpan/Win32/Win32.xs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/cpan/Win32/Win32.xs b/cpan/Win32/Win32.xs index 1ccdcc31ab..2799290597 100644 --- a/cpan/Win32/Win32.xs +++ b/cpan/Win32/Win32.xs @@ -38,6 +38,7 @@ typedef BOOL (__stdcall *PFNAllocateAndInitializeSid)(PSID_IDENTIFIER_AUTHORITY, 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*);
#ifndef CSIDL_MYMUSIC
# define CSIDL_MYMUSIC 0x000D
@@ -1651,6 +1652,39 @@ XS(w32_CreateFile) XSRETURN(1);
}
+XS(w32_GetSystemMetrics)
+{
+ dXSARGS;
+
+ if (items != 1)
+ Perl_croak(aTHX_ "usage: Win32::GetSystemMetrics($index)");
+
+ XSRETURN_IV(GetSystemMetrics(SvIV(ST(0))));
+}
+
+XS(w32_GetProductInfo)
+{
+ dXSARGS;
+ DWORD type;
+ HMODULE module;
+ PFNGetProductInfo pfnGetProductInfo;
+
+ if (items != 4)
+ Perl_croak(aTHX_ "usage: Win32::GetProductInfo($major,$minor,$spmajor,$spminor)");
+
+ module = GetModuleHandle("kernel32.dll");
+ GETPROC(GetProductInfo);
+ if (pfnGetProductInfo &&
+ pfnGetProductInfo((DWORD)SvIV(ST(0)), (DWORD)SvIV(ST(1)),
+ (DWORD)SvIV(ST(2)), (DWORD)SvIV(ST(3)), &type))
+ {
+ XSRETURN_IV(type);
+ }
+
+ /* PRODUCT_UNDEFINED */
+ XSRETURN_IV(0);
+}
+
MODULE = Win32 PACKAGE = Win32
PROTOTYPES: DISABLE
@@ -1712,6 +1746,8 @@ BOOT: newXS("Win32::GetCurrentThreadId", w32_GetCurrentThreadId, file);
newXS("Win32::CreateDirectory", w32_CreateDirectory, file);
newXS("Win32::CreateFile", w32_CreateFile, file);
+ newXS("Win32::GetSystemMetrics", w32_GetSystemMetrics, file);
+ newXS("Win32::GetProductInfo", w32_GetProductInfo, file);
#ifdef __CYGWIN__
newXS("Win32::SetChildShowWindow", w32_SetChildShowWindow, file);
#endif
|