[Wine-patches] [eterhack] usbhub.sys: Do not save PDO name.
Alexander Morozov
=?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Чт Янв 22 16:56:32 MSK 2009
----------- следующая часть -----------
From 756feab0be9d99c94d207d22b79e62078e486e63 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Thu, 22 Jan 2009 15:56:13 +0300
Subject: [PATCH] usbhub.sys: Do not save PDO name.
---
dlls/usbhub.sys/usbhub.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/usbhub.sys/usbhub.c b/dlls/usbhub.sys/usbhub.c
index 479fa07..284fa38 100644
--- a/dlls/usbhub.sys/usbhub.c
+++ b/dlls/usbhub.sys/usbhub.c
@@ -62,7 +62,6 @@ struct DeviceInstance
USHORT pid;
char *instance_id;
WCHAR *service;
- UNICODE_STRING pdo_name;
struct usb_device *dev;
};
@@ -358,23 +357,23 @@ static DEVICE_OBJECT *create_pdo( struct DeviceInstance *inst, DRIVER_OBJECT *hu
static const WCHAR usbpdoW[] = {'\\','D','e','v','i','c','e','\\',
'U','S','B','P','D','O','-','%','u',0};
- DEVICE_OBJECT *usbdev;
+ UNICODE_STRING pdo_name;
+ DEVICE_OBJECT *usbdev = NULL;
WCHAR *buf;
buf = HeapAlloc( GetProcessHeap(), 0, 30 * sizeof(WCHAR) );
if (buf == NULL) return NULL;
snprintfW( buf, 30, usbpdoW, last_pdo_num++ );
- RtlInitUnicodeString( &inst->pdo_name, buf );
+ RtlInitUnicodeString( &pdo_name, buf );
- if (IoCreateDevice( hubdrv, sizeof(struct PdoExtension), &inst->pdo_name,
- 0, 0, FALSE, &usbdev ) != STATUS_SUCCESS)
+ if (IoCreateDevice( hubdrv, sizeof(struct PdoExtension), &pdo_name,
+ 0, 0, FALSE, &usbdev ) == STATUS_SUCCESS)
{
- HeapFree( GetProcessHeap(), 0, buf );
- return NULL;
+ ((struct PdoExtension *)usbdev->DeviceExtension)->instance = inst;
+ usbdev->Flags |= DO_BUS_ENUMERATED_DEVICE | DO_POWER_PAGABLE;
+ usbdev->Flags &= ~DO_DEVICE_INITIALIZING;
}
- ((struct PdoExtension *)usbdev->DeviceExtension)->instance = inst;
- usbdev->Flags |= DO_BUS_ENUMERATED_DEVICE | DO_POWER_PAGABLE;
- usbdev->Flags &= ~DO_DEVICE_INITIALIZING;
+ HeapFree( GetProcessHeap(), 0, buf );
return usbdev;
}
--
1.6.0.2.GIT
Подробная информация о списке рассылки Wine-patches