- Use proper object attributes and share access when opening the file object
authorCameron Gutman <aicommander@gmail.com>
Thu, 17 Sep 2009 23:09:16 +0000 (23:09 +0000)
committerCameron Gutman <aicommander@gmail.com>
Thu, 17 Sep 2009 23:09:16 +0000 (23:09 +0000)
 - Fixes a rare INVALID_KERNEL_HANDLE BSOD and debug log handle warnings from AFD when using Firefox
 - See bug #4796

svn path=/trunk/; revision=43069

reactos/drivers/network/afd/afd/tdi.c

index 5fc90e2..4516e2c 100644 (file)
@@ -112,7 +112,8 @@ static NTSTATUS TdiOpenDevice(
 
     InitializeObjectAttributes(&Attr,                   /* Attribute buffer */
                                DeviceName,              /* Device name */
-                               OBJ_CASE_INSENSITIVE,    /* Attributes */
+                               OBJ_CASE_INSENSITIVE |   /* Attributes */
+                               OBJ_KERNEL_HANDLE,
                                NULL,                    /* Root directory */
                                NULL);                   /* Security descriptor */
 
@@ -122,7 +123,7 @@ static NTSTATUS TdiOpenDevice(
                           &Iosb,                                /* IO status */
                           0,                                    /* Initial allocation size */
                           FILE_ATTRIBUTE_NORMAL,                /* File attributes */
-                          FILE_SHARE_READ | FILE_SHARE_WRITE,   /* Share access */
+                          0,                                    /* Share access */
                           FILE_OPEN_IF,                         /* Create disposition */
                           0,                                    /* Create options */
                           EaInfo,                               /* EA buffer */