Avoid a non-portable WCHAR[] construct

Dmitry Timoshkov dmitry at codeweavers.com
Mon Jul 3 05:54:10 CDT 2006


Hello,

Changelog:
    Avoid a non-portable WCHAR[] construct.

diff -up cvs/hq/wine/dlls/crypt32/protectdata.c wine/dlls/crypt32/protectdata.c
--- cvs/hq/wine/dlls/crypt32/protectdata.c	2006-05-24 13:16:01.000000000 +0900
+++ wine/dlls/crypt32/protectdata.c	2006-07-03 15:54:54.000000000 +0900
@@ -107,7 +107,7 @@ struct protect_data_t
 };
 
 /* this is used to check if an incoming structure was built by Wine */
-static const char * crypt_magic_str = "Wine Crypt32 ok";
+static const char crypt_magic_str[] = "Wine Crypt32 ok";
 
 /* debugging tool to print strings of hex chars */
 static const char *
@@ -835,8 +835,8 @@ BOOL WINAPI CryptProtectData(DATA_BLOB* 
                              DWORD dwFlags,
                              DATA_BLOB* pDataOut)
 {
+    static const WCHAR empty_str[1];
     BOOL rc = FALSE;
-
     HCRYPTPROV hProv;
     struct protect_data_t protect_data;
     HCRYPTHASH hHash;
@@ -861,7 +861,7 @@ BOOL WINAPI CryptProtectData(DATA_BLOB* 
     /* Windows appears to create an empty szDataDescr instead of maintaining
      * a NULL */
     if (!szDataDescr)
-        szDataDescr=(WCHAR[]){'\0'};
+        szDataDescr = empty_str;
 
     /* get crypt context */
     if (!CryptAcquireContextW(&hProv,NULL,NULL,CRYPT32_PROTECTDATA_PROV,CRYPT_VERIFYCONTEXT))
diff -up cvs/hq/wine/dlls/msi/table.c wine/dlls/msi/table.c
--- cvs/hq/wine/dlls/msi/table.c	2006-06-14 16:29:39.000000000 +0900
+++ wine/dlls/msi/table.c	2006-07-03 15:56:20.000000000 +0900
@@ -1680,7 +1680,6 @@ static void dump_table( string_table *st
     for( i=0; i<(rawsize/2); i++ )
     {
         sval = msi_string_lookup_id( st, rawdata[i] );
-        if( !sval ) sval = (WCHAR[]) {0};
         MESSAGE(" %04x %s\n", rawdata[i], debugstr_w(sval) );
     }
 }





More information about the wine-patches mailing list