[PATCH v9 6/7] wdscore: Implement WdsSetupLogMessageA.

Mohamad Al-Jaf mohamadaljaf at gmail.com
Tue Mar 15 23:58:45 CDT 2022


Signed-off-by: Mohamad Al-Jaf <mohamadaljaf at gmail.com>
---
 dlls/wdscore/main.c       | 48 +++++++++++++++++++++++++++++++++++++++
 dlls/wdscore/wdscore.spec |  2 +-
 include/wdscore.h         |  1 +
 3 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/dlls/wdscore/main.c b/dlls/wdscore/main.c
index 8ebcedfba6b..92d1ffefeb5 100644
--- a/dlls/wdscore/main.c
+++ b/dlls/wdscore/main.c
@@ -86,6 +86,54 @@ LPVOID WINAPI ConstructPartialMsgVW( WdsLogLevel level, LPCWSTR msg, va_list arg
     return NULL;
 }
 
+/***********************************************************************
+ *           WdsSetupLogMessageA (wdscore.@)
+ */
+HRESULT WINAPI WdsSetupLogMessageA( LPVOID msg, WdsLogSource src, LPCSTR str1, LPCSTR str2,
+                                    ULONG unk1, LPCSTR file, LPCSTR func, void *ip,
+                                    ULONG unk2, void *unk3, UINT unk4 )
+{
+    DWORD len;
+    HRESULT ret;
+    LPWSTR str1W = NULL;
+    LPWSTR str2W = NULL;
+    LPWSTR fileW = NULL;
+    LPWSTR funcW = NULL;
+
+    if(str1)
+    {
+        len = MultiByteToWideChar( CP_ACP, 0, str1, -1, NULL, 0 );
+        str1W = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+        MultiByteToWideChar( CP_ACP, 0, str1, -1, str1W, len );
+    }
+    if(str2)
+    {
+        len = MultiByteToWideChar( CP_ACP, 0, str2, -1, NULL, 0 );
+        str2W = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+        MultiByteToWideChar( CP_ACP, 0, str2, -1, str2W, len );
+    }
+    if(file)
+    {
+        len = MultiByteToWideChar( CP_ACP, 0, file, -1, NULL, 0 );
+        fileW = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+        MultiByteToWideChar( CP_ACP, 0, file, -1, fileW, len );
+    }
+    if(func)
+    {
+        len = MultiByteToWideChar( CP_ACP, 0, func, -1, NULL, 0 );
+        funcW = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+        MultiByteToWideChar( CP_ACP, 0, func, -1, funcW, len );
+    }
+
+    ret = WdsSetupLogMessageW( msg, src, str1W, str2W, unk1, fileW, funcW, ip, unk2, unk3, unk4 );
+
+    HeapFree( GetProcessHeap(), 0, str1W );
+    HeapFree( GetProcessHeap(), 0, str2W );
+    HeapFree( GetProcessHeap(), 0, fileW );
+    HeapFree( GetProcessHeap(), 0, funcW );
+    return ret;
+}
+
 /***********************************************************************
  *           WdsSetupLogMessageW (wdscore.@)
  */
diff --git a/dlls/wdscore/wdscore.spec b/dlls/wdscore/wdscore.spec
index f1a807b86e6..938f27b776c 100644
--- a/dlls/wdscore/wdscore.spec
+++ b/dlls/wdscore/wdscore.spec
@@ -150,7 +150,7 @@
 @ stub WdsSetUILanguage
 @ stub WdsSetupLogDestroy
 @ stub WdsSetupLogInit
-@ stub WdsSetLogMessageA
+@ stdcall WdsSetupLogMessageA(ptr long str str long str str ptr long ptr long)
 @ stdcall WdsSetupLogMessageW(ptr long wstr wstr long wstr wstr ptr long ptr long)
 @ stub WdsSubscribeEx
 @ stub WdsTerminate
diff --git a/include/wdscore.h b/include/wdscore.h
index 0c357f7e3a4..fe61fda2e26 100644
--- a/include/wdscore.h
+++ b/include/wdscore.h
@@ -64,6 +64,7 @@ typedef enum _WdsLogSource {
 LPVOID CurrentIP(void);
 LPVOID  WINAPI ConstructPartialMsgVA(WdsLogLevel,LPCSTR,va_list);
 LPVOID  WINAPI ConstructPartialMsgVW(WdsLogLevel,LPCWSTR,va_list);
+HRESULT WINAPI WdsSetupLogMessageA(LPVOID,WdsLogSource,LPCSTR,LPCSTR,ULONG,LPCSTR,LPCSTR,void*,ULONG,void*,UINT);
 HRESULT WINAPI WdsSetupLogMessageW(LPVOID,WdsLogSource,LPCWSTR,LPCWSTR,ULONG,LPCWSTR,LPCWSTR,void*,ULONG,void*,UINT);
 
 #ifdef __cplusplus
-- 
2.35.1




More information about the wine-devel mailing list