Started implementation of the functions GetDefaultCommConfigA/W.
This commit is contained in:
parent
14a842761d
commit
00e7c3346d
|
@ -328,8 +328,8 @@ import ntdll.dll
|
|||
310 stdcall GetDateFormatA(long long ptr str ptr long) GetDateFormatA
|
||||
311 stdcall GetDateFormatW(long long ptr wstr ptr long) GetDateFormatW
|
||||
312 stub GetDaylightFlag
|
||||
313 stub GetDefaultCommConfigA
|
||||
314 stub GetDefaultCommConfigW
|
||||
313 stdcall GetDefaultCommConfigA(str ptr long) GetDefaultCommConfigA
|
||||
314 stdcall GetDefaultCommConfigW(wstr ptr long) GetDefaultCommConfigW
|
||||
315 stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) GetDiskFreeSpaceA
|
||||
316 stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) GetDiskFreeSpaceW
|
||||
317 stdcall GetDriveTypeA(str) GetDriveTypeA
|
||||
|
|
52
misc/comm.c
52
misc/comm.c
|
@ -2584,3 +2584,55 @@ BOOL WINAPI GetCommProperties(HANDLE hFile, LPCOMMPROP lpCommProp)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetDefaultCommConfigA (KERNEL32.313)
|
||||
*/
|
||||
BOOL WINAPI GetDefaultCommConfigA(LPCSTR lpszName,LPCOMMCONFIG lpCC,
|
||||
LPDWORD lpdwSize)
|
||||
{
|
||||
LPDCB lpdcb = &(lpCC->dcb);
|
||||
char temp[40];
|
||||
|
||||
if (strncasecmp(lpszName,"COM",3)) {
|
||||
ERR("not implemented for <%s>\n", lpszName);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!ValidCOMPort(lpszName[3]-'1'))
|
||||
return FALSE;
|
||||
|
||||
TRACE("(%s %p %ld)\n", lpszName, lpCC, *lpdwSize );
|
||||
if (*lpdwSize < sizeof(COMMCONFIG)) {
|
||||
*lpdwSize = sizeof(COMMCONFIG);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*lpdwSize = sizeof(COMMCONFIG);
|
||||
|
||||
lpCC->dwSize = sizeof(COMMCONFIG);
|
||||
lpCC->wVersion = 1;
|
||||
lpCC->dwProviderSubType = PST_RS232;
|
||||
lpCC->dwProviderOffset = 0L;
|
||||
lpCC->dwProviderSize = 0L;
|
||||
|
||||
(void) sprintf( temp, "COM%c:38400,n,8,1", lpszName[3]);
|
||||
FIXME("setting %s as default\n", temp);
|
||||
|
||||
return BuildCommDCBA( temp, lpdcb);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* GetDefaultCommConfigW (KERNEL32.314)
|
||||
*/
|
||||
BOOL WINAPI GetDefaultCommConfigW( LPCWSTR lpszName,LPCOMMCONFIG lpCC,
|
||||
LPDWORD lpdwSize)
|
||||
{
|
||||
LPSTR lpszNameA;
|
||||
BOOL ret;
|
||||
|
||||
TRACE("(%p,%p,%d)\n",lpszName,lpCC,*lpdwSize);
|
||||
lpszNameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpszName );
|
||||
ret=GetDefaultCommConfigA(lpszNameA,lpCC,lpdwSize);
|
||||
HeapFree( GetProcessHeap(), 0, lpszNameA );
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue