From 237d12dc8e231b8c843081ef540b5c90acbdd445 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Wed, 6 Apr 2005 17:40:25 +0000 Subject: [PATCH] Saveliy Tretiakov : - Implemented CommConfigDialogA and CommConfigDialogW - Removed @unimplemented comments for some implemented functions svn path=/trunk/; revision=14529 --- reactos/lib/kernel32/misc/comm.c | 63 +++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 10 deletions(-) diff --git a/reactos/lib/kernel32/misc/comm.c b/reactos/lib/kernel32/misc/comm.c index 67f8c6b6905..e061438aa48 100644 --- a/reactos/lib/kernel32/misc/comm.c +++ b/reactos/lib/kernel32/misc/comm.c @@ -14,6 +14,7 @@ * KJK (11/02/2003) implemented BuildCommDCB & BuildCommDCBAndTimeouts * ST (21/03/2005) implemented GetCommProperties * ST (24/03/2005) implemented ClearCommError. Corrected many functions. + * ST (05/04/2005) implemented CommConfigDialog * */ @@ -584,7 +585,7 @@ COMMDCB_PARAM_HANDLER(xon) } /* - * @unimplemented + * @implemented */ BOOL STDCALL @@ -707,7 +708,7 @@ InvalidParam: /* - * @unimplemented + * @implemented */ BOOL STDCALL @@ -736,7 +737,7 @@ BuildCommDCBAndTimeoutsA(LPCSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeout } /* - * @unimplemented + * @implemented */ BOOL STDCALL @@ -747,7 +748,7 @@ BuildCommDCBA(LPCSTR lpDef, LPDCB lpDCB) /* - * @unimplemented + * @implemented */ BOOL STDCALL @@ -833,26 +834,68 @@ ClearCommError(HANDLE hFile, LPDWORD lpErrors, LPCOMSTAT lpComStat) /* - * @unimplemented + * @implemented */ BOOL STDCALL CommConfigDialogA(LPCSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + BOOL (STDCALL *drvCommDlgA)(LPCSTR, HWND, LPCOMMCONFIG); + HMODULE hSerialuiDll; + BOOL result; + + //FIXME: Get dll name from registry. (setupapi needed) + if(!(hSerialuiDll = LoadLibraryW(L"serialui.dll"))) + { + DPRINT("CommConfigDialogA: serialui.dll not found.\n"); + return FALSE; + } + + drvCommDlgA = GetProcAddress(hSerialuiDll, "drvCommConfigDialogA"); + + if(!drvCommDlgA) + { + DPRINT("CommConfigDialogA: serialui does not export drvCommConfigDialogA\n"); + FreeLibrary(hSerialuiDll); + return FALSE; + } + + result = drvCommDlgA(lpszName, hWnd, lpCC); + FreeLibrary(hSerialuiDll); + return result; } /* - * @unimplemented + * @implemented */ BOOL STDCALL CommConfigDialogW(LPCWSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + BOOL (STDCALL *drvCommDlgW)(LPCWSTR, HWND, LPCOMMCONFIG); + HMODULE hSerialuiDll; + BOOL result; + + //FIXME: Get dll name from registry. (setupapi needed) + if(!(hSerialuiDll = LoadLibraryW(L"serialui.dll"))) + { + DPRINT("CommConfigDialogW: serialui.dll not found.\n"); + return FALSE; + } + + drvCommDlgW = GetProcAddress(hSerialuiDll, "drvCommConfigDialogW"); + + if(!drvCommDlgW) + { + DPRINT("CommConfigDialogW: serialui does not export drvCommConfigDialogW\n"); + FreeLibrary(hSerialuiDll); + return FALSE; + } + + result = drvCommDlgW(lpszName, hWnd, lpCC); + FreeLibrary(hSerialuiDll); + return result; }