Author: cgutman
Date: Sun Apr 18 01:32:29 2010
New Revision: 46913
URL:
http://svn.reactos.org/svn/reactos?rev=46913&view=rev
Log:
[PCMCIA]
- Check if the IOCTL interface should be enabled (not used yet)
Modified:
trunk/reactos/drivers/bus/pcmcia/pcmcia.c
Modified: trunk/reactos/drivers/bus/pcmcia/pcmcia.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcmcia/pcmcia.…
==============================================================================
--- trunk/reactos/drivers/bus/pcmcia/pcmcia.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/pcmcia/pcmcia.c [iso-8859-1] Sun Apr 18 01:32:29 2010
@@ -10,6 +10,8 @@
//#define NDEBUG
#include <debug.h>
+
+BOOLEAN IoctlEnabled;
NTSTATUS
NTAPI
@@ -202,6 +204,11 @@
DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
{
+ RTL_QUERY_REGISTRY_TABLE QueryTable[2];
+ NTSTATUS Status;
+
+ DPRINT1("PCMCIA: DriverEntry\n");
+
DriverObject->MajorFunction[IRP_MJ_CREATE] = PcmciaCreateClose;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = PcmciaCreateClose;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = PcmciaDeviceControl;
@@ -211,7 +218,25 @@
DriverObject->DriverExtension->AddDevice = PcmciaAddDevice;
DriverObject->DriverUnload = PcmciaUnload;
- DPRINT1("PCMCIA: DriverEntry\n");
+ RtlZeroMemory(QueryTable, sizeof(RTL_QUERY_REGISTRY_TABLE) * 2);
+
+ QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
+ QueryTable[0].Name = L"IoctlInterface";
+ QueryTable[0].EntryContext = &IoctlEnabled;
+
+ Status = RtlQueryRegistryValues(RTL_REGISTRY_SERVICES,
+ L"Pcmcia\\Parameters",
+ QueryTable,
+ NULL,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ /* Key not present so assume disabled */
+ IoctlEnabled = FALSE;
+ }
+
+ DPRINT("PCMCIA: Ioctl interface %s\n",
+ (IoctlEnabled ? "enabled" : "disabled"));
return STATUS_SUCCESS;
}