Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygeninit.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: ReactOS Boot Loader 00003 * LICENSE: BSD - See COPYING.ARM in the top level directory 00004 * FILE: drivers/sac/driver/init.c 00005 * PURPOSE: Driver for the Server Administration Console (SAC) for EMS 00006 * PROGRAMMERS: ReactOS Portable Systems Group 00007 */ 00008 00009 /* INCLUDES *******************************************************************/ 00010 00011 #include "sacdrv.h" 00012 00013 /* GLOBALS ********************************************************************/ 00014 00015 /* FUNCTIONS ******************************************************************/ 00016 00017 NTSTATUS 00018 NTAPI 00019 DriverEntry( 00020 IN PDRIVER_OBJECT DriverObject, 00021 IN PUNICODE_STRING RegistryPath 00022 ) 00023 { 00024 HEADLESS_RSP_QUERY_INFO HeadlessInformation; 00025 ULONG InfoSize; 00026 NTSTATUS Status; 00027 UNICODE_STRING DriverName; 00028 PDEVICE_OBJECT DeviceObject; 00029 PSAC_DEVICE_EXTENSION DeviceExtension; 00030 PAGED_CODE(); 00031 00032 SAC_DBG(SAC_DBG_ENTRY_EXIT, "Entering.\n"); 00033 00034 HeadlessDispatch( 00035 HeadlessCmdQueryInformation, 00036 NULL, 00037 0, 00038 &HeadlessInformation, 00039 &InfoSize 00040 ); 00041 if ((HeadlessInformation.Serial.TerminalType != HeadlessUndefinedPortType) && 00042 ((HeadlessInformation.Serial.TerminalType != HeadlessSerialPort) || 00043 (HeadlessInformation.Serial.TerminalAttached))) 00044 { 00045 RtlInitUnicodeString(&DriverName, L"\\Device\\SAC"); 00046 00047 Status = IoCreateDevice( 00048 DriverObject, 00049 sizeof(SAC_DEVICE_EXTENSION), 00050 &DriverName, 00051 FILE_DEVICE_UNKNOWN, 00052 FILE_DEVICE_SECURE_OPEN, 00053 FALSE, 00054 &DeviceObject 00055 ); 00056 if (NT_SUCCESS(Status)) 00057 { 00058 DeviceExtension = DeviceObject->DeviceExtension; 00059 DeviceExtension->Initialized = FALSE; 00060 00061 RtlFillMemoryUlong( 00062 DriverObject->MajorFunction, 00063 sizeof(DriverObject->MajorFunction) / sizeof(PVOID), 00064 (ULONG_PTR)Dispatch); 00065 DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = 00066 DispatchDeviceControl; 00067 DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = 00068 DispatchShutdownControl; 00069 DriverObject->FastIoDispatch = NULL; 00070 DriverObject->DriverUnload = UnloadHandler; 00071 00072 if (InitializeGlobalData(RegistryPath, DriverObject)) 00073 { 00074 if (InitializeDeviceData(DeviceObject)) 00075 { 00076 IoRegisterShutdownNotification(DeviceObject); 00077 return Status; 00078 } 00079 } 00080 00081 Status = STATUS_INSUFFICIENT_RESOURCES; 00082 } 00083 else 00084 { 00085 SAC_DBG(SAC_DBG_INIT, "unable to create device object: %X\n", Status); 00086 } 00087 00088 FreeGlobalData(); 00089 SAC_DBG(SAC_DBG_ENTRY_EXIT, "Exiting with status 0x%x\n", Status); 00090 return Status; 00091 } 00092 00093 return STATUS_PORT_DISCONNECTED; 00094 } Generated on Sun May 27 2012 04:23:32 for ReactOS by
1.7.6.1
|