Update Win32 to CPAN version 0.51
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 26 Jan 2015 23:43:50 +0000 (23:43 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 26 Jan 2015 23:57:57 +0000 (23:57 +0000)
  [DELTA]

0.51    [2015-01-26]
        - Win32-0.50 was released to CPAN from an out-dated Git repo, so
          didn't actually include the merged pull requests.

0.50    [2015-01-26]
        - add GetOSName support for Windows 8.1 (thanks to Tony Cook) [PR/6]
        - Fix build in C++ mode (thanks to Steve Hay and Daniel Dragan) [PR/7]

Porting/Maintainers.pl
cpan/Win32/Win32.pm
cpan/Win32/Win32.xs

index ac5f552..4b37146 100755 (executable)
@@ -1280,7 +1280,7 @@ use File::Glob qw(:case);
     },
 
     'Win32' => {
-        'DISTRIBUTION' => "JDB/Win32-0.49.tar.gz",
+        'DISTRIBUTION' => "JDB/Win32-0.51.tar.gz",
         'FILES'        => q[cpan/Win32],
     },
 
index 027af0e..4cc880b 100644 (file)
@@ -8,7 +8,7 @@ package Win32;
     require DynaLoader;
 
     @ISA = qw|Exporter DynaLoader|;
-    $VERSION = '0.49';
+    $VERSION = '0.51';
     $XS_VERSION = $VERSION;
     $VERSION = eval $VERSION;
 
@@ -468,6 +468,15 @@ sub _GetOSName {
                $os = "2012";
            }
            }
+           elsif ($minor == 3) {
+               if ($producttype == VER_NT_WORKSTATION) {
+                   $os = "8.1";
+               }
+               else {
+                   $os = "2012";
+                   $desc = "R2";
+               }
+           }
 
         if ($productinfo == PRODUCT_ULTIMATE) {
                $desc .= " Ultimate";
index b47df40..de3764e 100644 (file)
@@ -237,7 +237,7 @@ get_unicode_env(pTHX_ WCHAR *name)
             pfnCreateEnvironmentBlock(&env, token, FALSE))
         {
             size_t name_len = wcslen(name);
-            WCHAR *entry = env;
+            WCHAR *entry = (WCHAR *)env;
             while (*entry) {
                 size_t i;
                 size_t entry_len = wcslen(entry);
@@ -818,7 +818,11 @@ XS(w32_GuidGen)
 
     if (SUCCEEDED(hr)) {
        LPOLESTR pStr = NULL;
+#ifdef __cplusplus
+       if (SUCCEEDED(StringFromCLSID(guid, &pStr))) {
+#else
        if (SUCCEEDED(StringFromCLSID(&guid, &pStr))) {
+#endif
             WideCharToMultiByte(CP_ACP, 0, pStr, (int)wcslen(pStr), szGUID,
                                 sizeof(szGUID), NULL, NULL);
             CoTaskMemFree(pStr);