Alex Henrie alexhenrie24@gmail.com writes:
@@ -453,7 +457,21 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) RegCloseKey( hkey ); if (!RegCreateKeyExW( devicemap_key, serialW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL ))
{
/* create a registry entry for each serial port */
for (i = 1; i <= 256; i++)
{
sprintfW( pathW, comW, i );
serial_device = CreateFileW( pathW, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
if (serial_device == INVALID_HANDLE_VALUE)
break;
CloseHandle( serial_device );
RegSetValueExW( hkey, pathW + 4, 0, REG_SZ, (BYTE *)(pathW + 4),
(strlenW( pathW + 4 ) + 1) * sizeof(WCHAR) );
The registry key name is supposed to be the NT device. Ideally, what you'd want is to actually create the NT device pointing it to the corresponding Unix device, as well as the DOS symlink. If you do this, CreateFile can then use the normal path, and the ntdll serial device detection logic can be moved to mountmgr.