in function deformat_environment did cut of one letter of GetEnvironmentVariableW...
[reactos.git] / reactos / lib / msi / format.c
index 9bcfc7f..c280541 100644 (file)
@@ -151,7 +151,7 @@ static LPWSTR deformat_environment(MSIPACKAGE* package, LPCWSTR key,
     {
         sz++;
         value = msi_alloc(sz * sizeof(WCHAR));
-        GetEnvironmentVariableW(&key[1],value,sz);
+        GetEnvironmentVariableW(key,value,sz);
         *chunk = (strlenW(value)) * sizeof(WCHAR);
     }
     else
@@ -206,7 +206,7 @@ static LPWSTR deformat_index(MSIRECORD* record, LPCWSTR key, DWORD* chunk )
 
     index = atoiW(key);
     TRACE("record index %i\n",index);
-    value = load_dynamic_stringW(record,index);
+    value = msi_dup_record_field(record,index);
     if (value)
         *chunk = strlenW(value) * sizeof(WCHAR);
     else
@@ -434,7 +434,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr,
         {
             LPBYTE nd2;
 
-            TRACE("after value %s \n",debugstr_wn((LPWSTR)newdata,
+            TRACE("after value %s\n", debugstr_wn((LPWSTR)newdata,
                                     size/sizeof(WCHAR)));
             chunk = (len - (progress - ptr)) * sizeof(WCHAR);
             TRACE("after chunk is %li + %li\n",size,chunk);
@@ -584,7 +584,7 @@ UINT MSI_FormatRecordW( MSIPACKAGE* package, MSIRECORD* record, LPWSTR buffer,
 
     TRACE("%p %p %p %li\n",package, record ,buffer, *size);
 
-    rec = load_dynamic_stringW(record,0);
+    rec = msi_dup_record_field(record,0);
     if (!rec)
         rec = build_default_format(record);
 
@@ -631,7 +631,7 @@ UINT MSI_FormatRecordA( MSIPACKAGE* package, MSIRECORD* record, LPSTR buffer,
 
     TRACE("%p %p %p %li\n",package, record ,buffer, *size);
 
-    rec = load_dynamic_stringW(record,0);
+    rec = msi_dup_record_field(record,0);
     if (!rec)
         rec = build_default_format(record);