- Add wine_dbgstr_w
 - Revert changes, msiexec is shared.
Modified: trunk/reactos/include/wine/debug.h
Modified: trunk/reactos/subsys/system/msiexec/msiexec.c

Modified: trunk/reactos/include/wine/debug.h
--- trunk/reactos/include/wine/debug.h	2005-07-27 01:09:38 UTC (rev 16770)
+++ trunk/reactos/include/wine/debug.h	2005-07-27 01:12:53 UTC (rev 16771)
@@ -35,6 +35,7 @@
 /* These function return a printable version of a string, including
    quotes.  The string will be valid for some time, but not indefinitely
    as strings are re-used.  */
+extern const char *wine_dbgstr_w( const WCHAR *s );
 extern const char *wine_dbgstr_an( const char * s, int n );
 extern const char *wine_dbgstr_wn( const wchar_t *s, int n );
 extern const char *wine_dbgstr_guid( const struct _GUID *id );

Modified: trunk/reactos/subsys/system/msiexec/msiexec.c
--- trunk/reactos/subsys/system/msiexec/msiexec.c	2005-07-27 01:09:38 UTC (rev 16770)
+++ trunk/reactos/subsys/system/msiexec/msiexec.c	2005-07-27 01:12:53 UTC (rev 16771)
@@ -162,7 +162,7 @@
 	}
 	*p = 0;
 
-	WINE_TRACE("properties -> %S\n", ret);
+	WINE_TRACE("properties -> %s\n", wine_dbgstr_w(ret) );
 
 	return ret;
 }
@@ -258,14 +258,14 @@
 	*DllHandle = LoadLibraryExW(DllName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
 	if(!*DllHandle)
 	{
-		fprintf(stderr, "Unable to load dll %S\n", DllName);
+		fprintf(stderr, "Unable to load dll %s\n", wine_dbgstr_w(DllName));
 		ExitProcess(1);
 	}
 	proc = (VOID *) GetProcAddress(*DllHandle, ProcName);
 	if(!proc)
 	{
-		fprintf(stderr, "Dll %S does not implement function %s\n",
-			DllName, ProcName);
+		fprintf(stderr, "Dll %s does not implement function %s\n",
+			wine_dbgstr_w(DllName), ProcName);
 		FreeLibrary(*DllHandle);
 		ExitProcess(1);
 	}
@@ -284,10 +284,10 @@
 	hr = pfDllRegisterServer();
 	if(FAILED(hr))
 	{
-		fprintf(stderr, "Failed to register dll %S\n", DllName);
+		fprintf(stderr, "Failed to register dll %s\n", wine_dbgstr_w(DllName));
 		return 1;
 	}
-	printf("Successfully registered dll %S\n", DllName);
+	printf("Successfully registered dll %s\n", wine_dbgstr_w(DllName));
 	if(DllHandle)
 		FreeLibrary(DllHandle);
 	return 0;
@@ -304,10 +304,10 @@
 	hr = pfDllUnregisterServer();
 	if(FAILED(hr))
 	{
-		fprintf(stderr, "Failed to unregister dll %S\n", DllName);
+		fprintf(stderr, "Failed to unregister dll %s\n", wine_dbgstr_w(DllName));
 		return 1;
 	}
-	printf("Successfully unregistered dll %S\n", DllName);
+	printf("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName));
 	if(DllHandle)
 		FreeLibrary(DllHandle);
 	return 0;
@@ -485,7 +485,7 @@
 
 	for(i = 1; i < argc; i++)
 	{
-		WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+		WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 
 		if (!msi_strequal(argvW[i], "/regserver"))
 		{
@@ -506,7 +506,7 @@
 				i++;
 				if(i >= argc)
 					ShowUsage(1);
-				WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+				WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 				argvWi = argvW[i];
 			}
 			PackageName = argvWi;
@@ -519,7 +519,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			PackageName = argvW[i];
 			StringListAppend(&property_list, ActionAdmin);
 		}
@@ -588,7 +588,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			PackageName = argvW[i];
 		}
 		else if(!msi_strequal(argvW[i], "/x"))
@@ -597,7 +597,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			PackageName = argvW[i];
 			StringListAppend(&property_list, RemoveAll);
 		}
@@ -626,7 +626,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			PackageName = argvW[i];
 		}
 		else if(!msi_strequal(argvW[i], "u"))
@@ -636,7 +636,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			PackageName = argvW[i];
 		}
 		else if(!msi_strequal(argvW[i], "m"))
@@ -646,7 +646,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			PackageName = argvW[i];
 		}
 		else if(!msi_strequal(argvW[i], "/t"))
@@ -654,7 +654,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			StringListAppend(&transform_list, argvW[i]);
 		}
 		else if(!msi_strprefix(argvW[i], "TRANSFORMS="))
@@ -666,7 +666,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			Language = msi_atou(argvW[i]);
 		}
 		else if(!msi_strprefix(argvW[i], "/l"))
@@ -751,12 +751,12 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			LogFileName = argvW[i];
 			if(MsiEnableLogW(LogMode, LogFileName, LogAttributes) != ERROR_SUCCESS)
 			{
-				fprintf(stderr, "Logging in %S (0x%08lx, %lu) failed\n",
-					 LogFileName, LogMode, LogAttributes);
+				fprintf(stderr, "Logging in %s (0x%08lx, %lu) failed\n",
+					 wine_dbgstr_w(LogFileName), LogMode, LogAttributes);
 				ExitProcess(1);
 			}
 		}
@@ -766,7 +766,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			PatchFileName = argvW[i];
 		}
 		else if(!msi_strprefix(argvW[i], "/q"))
@@ -806,8 +806,8 @@
 			}
 			else
 			{
-				fprintf(stderr, "Unknown option \"%S\" for UI level\n",
-					 argvW[i]+2);
+				fprintf(stderr, "Unknown option \"%s\" for UI level\n",
+					 wine_dbgstr_w(argvW[i]+2));
 			}
 		}
 		else if(!msi_strequal(argvW[i], "/y"))
@@ -816,7 +816,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			DllName = argvW[i];
 		}
 		else if(!msi_strequal(argvW[i], "/z"))
@@ -825,7 +825,7 @@
 			i++;
 			if(i >= argc)
 				ShowUsage(1);
-			WINE_TRACE("argvW[%d] = %S\n", i, argvW[i]);
+			WINE_TRACE("argvW[%d] = %s\n", i, wine_dbgstr_w(argvW[i]));
 			DllName = argvW[i];
 		}
 		else if(!msi_strequal(argvW[i], "/h") || !msi_strequal(argvW[i], "/?"))