From f231ef560ee7ae20286fecb86a1c15d1b111a765 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 13 Jun 2005 18:48:09 +0000 Subject: [PATCH] Removed references to obsolete configuration entries. --- dlls/winedos/int11.c | 53 +++++++++++--------------------------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/dlls/winedos/int11.c b/dlls/winedos/int11.c index 04c0807aa61..3eed99df0a1 100644 --- a/dlls/winedos/int11.c +++ b/dlls/winedos/int11.c @@ -28,7 +28,6 @@ #include "windef.h" #include "winbase.h" -#include "winreg.h" #include "dosexe.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -82,52 +81,26 @@ void WINAPI DOSVM_Int11Handler( CONTEXT86 *context ) if (diskdrives) diskdrives--; for (x=0; x < 9; x++) - { - HKEY hkey; - char option[10]; - char temp[256]; + { + HANDLE handle; + char file[10]; /* serial port name */ - strcpy( option, "COMx" ); - option[3] = '1' + x; - option[4] = '\0'; - - /* default value */ - strcpy( temp, "*" ); - - if (!RegOpenKeyA(HKEY_LOCAL_MACHINE, - "Software\\Wine\\Wine\\Config\\serialports", - &hkey)) + sprintf( file, "\\\\.\\COM%d", x+1 ); + handle = CreateFileA( file, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); + if (handle != INVALID_HANDLE_VALUE) { - DWORD type; - DWORD count = sizeof(temp); - RegQueryValueExA( hkey, option, 0, &type, temp, &count ); - RegCloseKey( hkey ); - } - - if (strcmp(temp, "*") && *temp != '\0') + CloseHandle( handle ); serialports++; - - /* parallel port name */ - strcpy( option, "LPTx" ); - option[3] = '1' + x; - option[4] = '\0'; - - /* default value */ - strcpy( temp, "*" ); - - if (!RegOpenKeyA(HKEY_LOCAL_MACHINE, - "Software\\Wine\\Wine\\Config\\parallelports", - &hkey)) - { - DWORD type; - DWORD count = sizeof(temp); - RegQueryValueExA( hkey, option, 0, &type, temp, &count ); - RegCloseKey( hkey ); } - if (strcmp(temp, "*") && *temp != '\0') + sprintf( file, "\\\\.\\LPT%d", x+1 ); + handle = CreateFileA( file, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); + if (handle != INVALID_HANDLE_VALUE) + { + CloseHandle( handle ); parallelports++; + } } if (serialports > 7) /* 3 bits -- maximum value = 7 */