static FORCEINLINE const CHAR* __Mode() { switch (DriverGetOperatingMode()) { case DUMP_MODE: return "CRASH"; case HIBER_MODE: return "HIBER"; case NORMAL_MODE: return "NORMAL"; default: return "UNKNOWN"; } }
XEN_API NTSTATUS XencrshEntryPoint( IN PDRIVER_OBJECT _DriverObject ) { NTSTATUS Status; HW_INITIALIZATION_DATA InitData; LogTrace("===> (Irql=%d)\n", KeGetCurrentIrql()); LogVerbose("%s (%s)\n", MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR, DAY_STR "/" MONTH_STR "/" YEAR_STR); LogVerbose("Loading PV Disk in %s mode\n", __OperatingModeName()); if (DriverGetOperatingMode() == DUMP_MODE) { WRITE_PORT_ULONG(CRASH_PORT, 'PLEH'); } AustereInitialize(); BufferInitialize(); RtlZeroMemory(&InitData, sizeof(InitData)); InitData.HwInitializationDataSize = sizeof(InitData); InitData.AdapterInterfaceType = Internal; InitData.HwInitialize = HwInitialize; InitData.HwStartIo = HwStartIo; InitData.HwInterrupt = HwInterrupt; #pragma warning(suppress : 4152) InitData.HwFindAdapter = HwFindAdapter; InitData.HwResetBus = HwResetBus; InitData.HwDmaStarted = NULL; InitData.HwAdapterState = NULL; InitData.DeviceExtensionSize = FdoSizeofXenvbdFdo(); InitData.SpecificLuExtensionSize = 0; InitData.SrbExtensionSize = sizeof(XENVBD_SRBEXT); InitData.NumberOfAccessRanges = 2; InitData.MapBuffers = STOR_MAP_NON_READ_WRITE_BUFFERS; InitData.NeedPhysicalAddresses = TRUE; InitData.TaggedQueuing = TRUE; InitData.AutoRequestSense = TRUE; InitData.MultipleRequestPerLu = TRUE; InitData.HwAdapterControl = HwAdapterControl; InitData.HwBuildIo = HwBuildIo; #pragma prefast(suppress: 6387, "Crash Driver has no registry path") Status = StorPortInitialize(_DriverObject, NULL, &InitData, NULL); LogVerbose("(%08x)\n", Status); LogTrace("<=== (%08x) (Irql=%d)\n", Status, KeGetCurrentIrql()); return Status; }