Commit 568a91df authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

SERIALUI: convert to Unicode.

parent a8b09d11
...@@ -2098,7 +2098,8 @@ BOOL WINAPI GetCommProperties( ...@@ -2098,7 +2098,8 @@ BOOL WINAPI GetCommProperties(
* The DLL should be loaded when the COMM port is opened, and closed * The DLL should be loaded when the COMM port is opened, and closed
* when the COMM port is closed. - MJM 20 June 2000 * when the COMM port is closed. - MJM 20 June 2000
***********************************************************************/ ***********************************************************************/
static CHAR lpszSerialUI[] = "serialui.dll"; static WCHAR lpszSerialUI[] = {
's','e','r','i','a','l','u','i','.','d','l','l',0 };
/*********************************************************************** /***********************************************************************
...@@ -2129,7 +2130,7 @@ BOOL WINAPI CommConfigDialogA( ...@@ -2129,7 +2130,7 @@ BOOL WINAPI CommConfigDialogA(
TRACE("(%p %p %p)\n",lpszDevice, hWnd, lpCommConfig); TRACE("(%p %p %p)\n",lpszDevice, hWnd, lpCommConfig);
hConfigModule = LoadLibraryA(lpszSerialUI); hConfigModule = LoadLibraryW(lpszSerialUI);
if(!hConfigModule) if(!hConfigModule)
return FALSE; return FALSE;
...@@ -2140,7 +2141,7 @@ BOOL WINAPI CommConfigDialogA( ...@@ -2140,7 +2141,7 @@ BOOL WINAPI CommConfigDialogA(
r = lpfnCommDialog(lpszDevice,hWnd,lpCommConfig); r = lpfnCommDialog(lpszDevice,hWnd,lpCommConfig);
/* UnloadLibrary(hConfigModule); */ FreeLibrary(hConfigModule);
return r; return r;
} }
...@@ -2236,29 +2237,26 @@ BOOL WINAPI SetCommConfig( ...@@ -2236,29 +2237,26 @@ BOOL WINAPI SetCommConfig(
* *
* True if the device was found and the defaults set, false otherwise * True if the device was found and the defaults set, false otherwise
*/ */
BOOL WINAPI SetDefaultCommConfigA( BOOL WINAPI SetDefaultCommConfigW(
LPCSTR lpszDevice, /* [in] The ascii name of the device targeted for configuration. */ LPCWSTR lpszDevice, /* [in] The ascii name of the device targeted for configuration. */
LPCOMMCONFIG lpCommConfig, /* [in] The default configuration for the device. */ LPCOMMCONFIG lpCommConfig, /* [in] The default configuration for the device. */
DWORD dwSize) /* [in] The number of bytes in the configuration structure. */ DWORD dwSize) /* [in] The number of bytes in the configuration structure. */
{ {
FARPROC lpfnSetDefaultCommConfig; FARPROC lpfnSetDefaultCommConfig;
HMODULE hConfigModule; HMODULE hConfigModule;
BOOL r; BOOL r = FALSE;
TRACE("(%p %p %lx)\n",lpszDevice, lpCommConfig, dwSize); TRACE("(%p %p %lx)\n",lpszDevice, lpCommConfig, dwSize);
hConfigModule = LoadLibraryA(lpszSerialUI); hConfigModule = LoadLibraryW(lpszSerialUI);
if(!hConfigModule) if(!hConfigModule)
return FALSE; return r;
lpfnSetDefaultCommConfig = GetProcAddress(hConfigModule, (LPCSTR)4L); lpfnSetDefaultCommConfig = GetProcAddress(hConfigModule, "drvSetDefaultCommConfigW");
if (lpfnSetDefaultCommConfig)
r = lpfnSetDefaultCommConfig(lpszDevice, lpCommConfig, dwSize);
if(! lpfnSetDefaultCommConfig) FreeLibrary(hConfigModule);
return TRUE;
r = lpfnSetDefaultCommConfig(lpszDevice, lpCommConfig, dwSize);
/* UnloadLibrary(hConfigModule); */
return r; return r;
} }
...@@ -2273,21 +2271,26 @@ BOOL WINAPI SetDefaultCommConfigA( ...@@ -2273,21 +2271,26 @@ BOOL WINAPI SetDefaultCommConfigA(
* RETURNS * RETURNS
* *
*/ */
BOOL WINAPI SetDefaultCommConfigW( BOOL WINAPI SetDefaultCommConfigA(
LPCWSTR lpszDevice, /* [in] The unicode name of the device targeted for configuration. */ LPCSTR lpszDevice, /* [in] The unicode name of the device targeted for configuration. */
LPCOMMCONFIG lpCommConfig, /* [in] The default configuration for the device. */ LPCOMMCONFIG lpCommConfig, /* [in] The default configuration for the device. */
DWORD dwSize) /* [in] The number of bytes in the configuration structure. */ DWORD dwSize) /* [in] The number of bytes in the configuration structure. */
{ {
BOOL r; BOOL r;
LPSTR lpDeviceA; LPWSTR lpDeviceW = NULL;
DWORD len;
TRACE("(%s %p %lx)\n",debugstr_w(lpszDevice),lpCommConfig,dwSize); TRACE("(%s %p %lx)\n",debugstr_a(lpszDevice),lpCommConfig,dwSize);
lpDeviceA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpszDevice ); if (lpszDevice)
if(lpDeviceA) {
return FALSE; len = MultiByteToWideChar( CP_ACP, 0, lpszDevice, -1, NULL, 0 );
r = SetDefaultCommConfigA(lpDeviceA,lpCommConfig,dwSize); lpDeviceW = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
HeapFree( GetProcessHeap(), 0, lpDeviceA ); MultiByteToWideChar( CP_ACP, 0, lpszDevice, -1, lpDeviceW, len );
}
r = SetDefaultCommConfigW(lpDeviceW,lpCommConfig,dwSize);
if (lpDeviceW)
HeapFree( GetProcessHeap(), 0, lpDeviceW );
return r; return r;
} }
......
...@@ -4,6 +4,7 @@ SRCDIR = @srcdir@ ...@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = serialui.dll MODULE = serialui.dll
IMPORTS = user32 advapi32 kernel32 IMPORTS = user32 advapi32 kernel32
EXTRALIBS = $(LIBUNICODE)
C_SRCS = \ C_SRCS = \
confdlg.c confdlg.c
......
2 stdcall EnumPropPages(ptr ptr ptr) SERIALUI_EnumPropPages 1 stdcall EnumPropPages(ptr ptr ptr)
3 stdcall drvCommConfigDialog(ptr long ptr) SERIALUI_CommConfigDialog 2 stdcall drvCommConfigDialogW(ptr long ptr)
4 stdcall drvSetDefaultCommConfig(str ptr long) SERIALUI_SetDefaultCommConfig 3 stdcall drvCommConfigDialogA(ptr long ptr)
5 stdcall drvGetDefaultCommConfig(str ptr ptr) SERIALUI_GetDefaultCommConfig 4 stdcall drvSetDefaultCommConfigW(wstr ptr long)
5 stdcall drvSetDefaultCommConfigA(str ptr long)
6 stdcall drvGetDefaultCommConfigW(wstr ptr ptr)
7 stdcall drvGetDefaultCommConfigA(str ptr ptr)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment