#include "ntos.h"
#include "zwapi.h"
#include "hal.h"
#include "ntdddisk.h"
#include "haldisp.h"
#include "ntddft.h"
#include "mountmgr.h"
#include "stdio.h"
#include <setupblk.h>
#include "drivesup.h"
Go to the source code of this file.
Classes | |
struct | _BOOT_SECTOR_INFO |
Defines | |
#define | DebugPrint(x) DrivesupDebugPrint x |
#define | GET_STARTING_SECTOR(p) |
#define | GET_PARTITION_LENGTH(p) |
#define | BOOTABLE_PARTITION 0 |
#define | PRIMARY_PARTITION 1 |
#define | LOGICAL_PARTITION 2 |
#define | FT_PARTITION 3 |
#define | OTHER_PARTITION 4 |
#define | GET_STARTING_SECTOR(p) |
#define | WHICH_BIT(Data, Bit) |
#define | WHICH_BIT(Data, Bit) |
Typedefs | |
typedef _BOOT_SECTOR_INFO | BOOT_SECTOR_INFO |
typedef _BOOT_SECTOR_INFO * | PBOOT_SECTOR_INFO |
Functions | |
VOID | DrivesupDebugPrint (ULONG DebugPrintLevel, PCCHAR DebugMessage,...) |
VOID | HalpCalculateChsValues (IN PLARGE_INTEGER PartitionOffset, IN PLARGE_INTEGER PartitionLength, IN CCHAR ShiftCount, IN ULONG SectorsPerTrack, IN ULONG NumberOfTracks, IN ULONG ConventionalCylinders, OUT PPARTITION_DESCRIPTOR PartitionDescriptor) |
NTSTATUS | HalpQueryPartitionType (IN PUNICODE_STRING DeviceName, IN PDRIVE_LAYOUT_INFORMATION DriveLayout, OUT PULONG PartitionType) |
NTSTATUS | HalpQueryDriveLayout (IN PUNICODE_STRING DeviceName, OUT PDRIVE_LAYOUT_INFORMATION *DriveLayout) |
VOID FASTCALL | xHalGetPartialGeometry (IN PDEVICE_OBJECT DeviceObject, IN PULONG ConventionalCylinders, IN PLONGLONG DiskSize) |
NTSTATUS | HalpGetFullGeometry (IN PDEVICE_OBJECT DeviceObject, IN PDISK_GEOMETRY Geometry, OUT PULONGLONG RealSectorCount) |
BOOLEAN | HalpIsValidPartitionEntry (PPARTITION_DESCRIPTOR Entry, ULONGLONG MaxOffset, ULONGLONG MaxSector) |
NTSTATUS | HalpNextMountLetter (IN PUNICODE_STRING DeviceName, OUT PUCHAR DriveLetter) |
UCHAR | HalpNextDriveLetter (IN PUNICODE_STRING DeviceName, IN PSTRING NtDeviceName, OUT PUCHAR NtSystemPath, IN BOOLEAN UseHardLinksIfNecessary) |
VOID | HalpEnableAutomaticDriveLetterAssignment () |
NTSTATUS | HalpSetMountLetter (IN PUNICODE_STRING DeviceName, IN UCHAR DriveLetter) |
BOOLEAN | HalpIsOldStyleFloppy (IN PUNICODE_STRING DeviceName) |
VOID FASTCALL | xHalExamineMBR (IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONG MBRTypeIdentifier, OUT PVOID *Buffer) |
VOID FASTCALL | xHalIoAssignDriveLetters (IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, IN PSTRING NtDeviceName, OUT PUCHAR NtSystemPath, OUT PSTRING NtSystemPathString) |
NTSTATUS FASTCALL | xHalIoReadPartitionTable (IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN BOOLEAN ReturnRecognizedPartitions, OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer) |
NTSTATUS FASTCALL | xHalIoSetPartitionInformation (IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONG PartitionNumber, IN ULONG PartitionType) |
NTSTATUS FASTCALL | xHalIoWritePartitionTable (IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONG SectorsPerTrack, IN ULONG NumberOfHeads, IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer) |
NTSTATUS FASTCALL | xHalIoClearPartitionTable (IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONG SectorsPerTrack, IN ULONG NumberOfHeads) |
Variables | |
ULONG | DrivesupDebug = 0 |
ULONG | DrivesupBreakIn = FALSE |
PUCHAR | DiskPartitionName = "\\Device\\Harddisk%d\\Partition%d" |
PUCHAR | RegistryKeyName = DISK_REGISTRY_KEY |
|
Definition at line 699 of file drivesup.c. Referenced by HalpQueryPartitionType(), and xHalIoAssignDriveLetters(). |
|
|
Definition at line 702 of file drivesup.c. Referenced by HalpQueryPartitionType(), and xHalIoAssignDriveLetters(). |
|
Value:
Definition at line 64 of file drivesup.c. Referenced by HalpIsValidPartitionEntry(), and xHalIoReadPartitionTable(). |
|
Value:
Definition at line 58 of file drivesup.c. |
|
Value:
Definition at line 58 of file drivesup.c. Referenced by HalpIsValidPartitionEntry(), xHalIoReadPartitionTable(), and xHalIoSetPartitionInformation(). |
|
Definition at line 701 of file drivesup.c. Referenced by HalpQueryPartitionType(), and xHalIoAssignDriveLetters(). |
|
Definition at line 703 of file drivesup.c. Referenced by HalpQueryPartitionType(). |
|
Definition at line 700 of file drivesup.c. Referenced by HalpQueryPartitionType(), and xHalIoAssignDriveLetters(). |
|
Value:
|
|
Value:
Referenced by xHalIoClearPartitionTable(), and xHalIoWritePartitionTable(). |
|
|
|
Referenced by xHalIoReadPartitionTable(). |
|
Definition at line 3882 of file drivesup.c. References DbgPrint, DebugMessage, and DrivesupDebug.
|
|
Definition at line 546 of file drivesup.c. References PAGED_CODE. Referenced by xHalIoWritePartitionTable().
|
|
Definition at line 1022 of file drivesup.c. References Executive, FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, IoGetDeviceObjectPointer(), KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, and RtlInitUnicodeString(). Referenced by xHalIoAssignDriveLetters().
|
|
Definition at line 3735 of file drivesup.c. References ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NonPagedPool, NT_SUCCESS, NTSTATUS(), NULL, PAGED_CODE, and VOID(). Referenced by xHalIoReadPartitionTable().
|
|
Definition at line 1171 of file drivesup.c. References _FILE_OBJECT::DeviceObject, Executive, FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, IoGetAttachedDeviceReference(), IoGetDeviceObjectPointer(), KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, PAGED_CODE, and TRUE. Referenced by xHalIoAssignDriveLetters().
|
|
Definition at line 3425 of file drivesup.c. References DebugPrint, FALSE, GET_PARTITION_LENGTH, GET_STARTING_SECTOR, PAGED_CODE, _PARTITION_DESCRIPTOR::PartitionType, and TRUE. Referenced by xHalIoReadPartitionTable().
|
|
Definition at line 934 of file drivesup.c. References HalpNextMountLetter(), HalpSetMountLetter(), IoCreateSymbolicLink(), L, NT_SUCCESS, NTSTATUS(), RtlAnsiStringToUnicodeString(), RtlEqualUnicodeString(), RtlFreeUnicodeString(), RtlInitUnicodeString(), RtlPrefixUnicodeString(), and TRUE. Referenced by xHalIoAssignDriveLetters().
|
|
Definition at line 851 of file drivesup.c. References ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, IoGetDeviceObjectPointer(), KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, PagedPool, and RtlInitUnicodeString(). Referenced by HalpNextDriveLetter().
|
|
Definition at line 792 of file drivesup.c. References _DEVICE_OBJECT::Characteristics, _FILE_OBJECT::DeviceObject, Executive, FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, IoGetAttachedDeviceReference(), IoGetDeviceObjectPointer(), IoReadPartitionTable(), KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NT_SUCCESS, NTSTATUS(), NULL, and ObDereferenceObject. Referenced by xHalIoAssignDriveLetters().
|
|
Definition at line 706 of file drivesup.c. References BOOTABLE_PARTITION, _DEVICE_OBJECT::Characteristics, _FILE_OBJECT::DeviceObject, Executive, FALSE, FT_PARTITION, IoBuildDeviceIoControlRequest(), IoCallDriver, IoGetAttachedDeviceReference(), IoGetDeviceObjectPointer(), KeInitializeEvent, KernelMode, KeWaitForSingleObject(), LOGICAL_PARTITION, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, OTHER_PARTITION, and PRIMARY_PARTITION. Referenced by xHalIoAssignDriveLetters().
|
|
Definition at line 1078 of file drivesup.c. References ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, IoGetDeviceObjectPointer(), KeInitializeEvent, KernelMode, KeWaitForSingleObject(), L, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, PagedPool, and RtlInitUnicodeString(). Referenced by HalpNextDriveLetter(), and xHalIoAssignDriveLetters().
|
|
Definition at line 190 of file drivesup.c. References ASSERT, BOOT_RECORD_SIGNATURE, BOOT_SIGNATURE_OFFSET, Buffer, ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, _IO_STACK_LOCATION::Flags, IoBuildSynchronousFsdRequest(), IoCallDriver, IoGetNextIrpStackLocation, IRP_MJ_READ, KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NonPagedPoolCacheAligned, NT_SUCCESS, NTSTATUS(), NULL, PAGE_SIZE, PARTITION_TABLE_OFFSET, _PARTITION_DESCRIPTOR::PartitionType, PUSHORT, SectorSize, SL_OVERRIDE_VERIFY_VOLUME, and VOID().
|
|
Definition at line 382 of file drivesup.c. References ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NonPagedPool, NT_SUCCESS, NTSTATUS(), NULL, and VOID(). Referenced by xHalIoClearPartitionTable(), and xHalIoWritePartitionTable().
|
|
Definition at line 1243 of file drivesup.c. References BOOTABLE_PARTITION, _CONFIGURATION_INFORMATION::CdRomCount, DbgPrint, _CONFIGURATION_INFORMATION::DiskCount, DiskPartitionName, ExAllocatePoolWithTag, ExFreePool(), FALSE, _CONFIGURATION_INFORMATION::FloppyCount, FT_PARTITION, HalpEnableAutomaticDriveLetterAssignment(), HalpIsOldStyleFloppy(), HalpNextDriveLetter(), HalpQueryDriveLayout(), HalpQueryPartitionType(), HalpSetMountLetter(), IoCreateSymbolicLink(), IoGetConfigurationInformation(), IoRemoteBootClient, KeBugCheck(), L, LOGICAL_PARTITION, NonPagedPool, NT_SUCCESS, NTSTATUS(), NULL, PAGED_CODE, PCONFIGURATION_INFORMATION, PRIMARY_PARTITION, RtlAnsiStringToUnicodeString(), RtlFreeUnicodeString(), RtlInitAnsiString(), RtlInitString(), RtlInitUnicodeString(), RtlPrefixUnicodeString(), SETUPBLK_FLAGS_REMOTE_INSTALL, SETUPBLK_FLAGS_SYSPREP_INSTALL, sprintf(), strlen(), TRUE, and ZwOpenFile().
|
|
Definition at line 3486 of file drivesup.c. References BOOT_RECORD_SIGNATURE, BOOT_SIGNATURE_OFFSET, ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, _IO_STACK_LOCATION::Flags, HalExamineMBR, IoBuildSynchronousFsdRequest(), IoCallDriver, IoGetNextIrpStackLocation, IRP_MJ_READ, IRP_MJ_WRITE, KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NonPagedPoolCacheAligned, NT_SUCCESS, NTSTATUS(), NULL, PAGE_SIZE, PAGED_CODE, PUSHORT, SectorSize, SL_OVERRIDE_VERIFY_VOLUME, TRUE, USHORT, VOID(), WHICH_BIT, and xHalGetPartialGeometry().
|
|
Definition at line 1739 of file drivesup.c. References _PARTITION_DESCRIPTOR::ActiveFlag, ASSERT, BOOT_RECORD_SIGNATURE, BOOT_SIGNATURE_OFFSET, DebugPrint, DrivesupBreakIn, ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, _IO_STACK_LOCATION::Flags, GET_PARTITION_LENGTH, GET_STARTING_SECTOR, HalExamineMBR, HalpGetFullGeometry(), HalpIsValidPartitionEntry(), IoBuildSynchronousFsdRequest(), IoCallDriver, IoGetNextIrpStackLocation, IRP_MJ_READ, _BOOT_SECTOR_INFO::JumpByte, KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NonPagedPool, NonPagedPoolCacheAligned, NT_SUCCESS, NTSTATUS(), NULL, NUM_PARTITION_TABLE_ENTRIES, PAGE_SIZE, PAGED_CODE, PARTITION_ACTIVE_FLAG, PARTITION_BUFFER_SIZE, PARTITION_TABLE_OFFSET, _PARTITION_DESCRIPTOR::PartitionType, PBOOT_SECTOR_INFO, PUSHORT, SectorSize, SL_OVERRIDE_VERIFY_VOLUME, TRUE, and VOID().
|
|
Definition at line 2485 of file drivesup.c. References BOOT_RECORD_SIGNATURE, BOOT_SIGNATURE_OFFSET, ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, _IO_STACK_LOCATION::Flags, GET_STARTING_SECTOR, HalExamineMBR, IoBuildSynchronousFsdRequest(), IoCallDriver, IoGetNextIrpStackLocation, IRP_MJ_READ, IRP_MJ_WRITE, KeInitializeEvent, KeResetEvent(), KernelMode, KeWaitForSingleObject(), NonPagedPoolCacheAligned, NT_SUCCESS, NTSTATUS(), NULL, NUM_PARTITION_TABLE_ENTRIES, PAGE_SIZE, PAGED_CODE, PARTITION_TABLE_OFFSET, _PARTITION_DESCRIPTOR::PartitionType, PUSHORT, SectorSize, SL_OVERRIDE_VERIFY_VOLUME, TRUE, and VOID().
|
|
Definition at line 2879 of file drivesup.c. References BOOT_RECORD_SIGNATURE, BOOT_SIGNATURE_OFFSET, ExAllocatePoolWithTag, Executive, ExFreePool(), FALSE, _IO_STACK_LOCATION::Flags, HalExamineMBR, HalpCalculateChsValues(), IoBuildSynchronousFsdRequest(), IoCallDriver, IoGetNextIrpStackLocation, IRP_MJ_READ, IRP_MJ_WRITE, KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NonPagedPoolCacheAligned, NT_SUCCESS, NTSTATUS(), NULL, NUM_PARTITION_TABLE_ENTRIES, PAGE_SIZE, PAGED_CODE, PARTITION_ACTIVE_FLAG, PARTITION_TABLE_OFFSET, PUSHORT, SectorSize, SL_OVERRIDE_VERIFY_VOLUME, TRUE, USHORT, VOID(), WHICH_BIT, and xHalGetPartialGeometry().
|
|
Definition at line 91 of file drivesup.c. Referenced by xHalIoAssignDriveLetters(). |
|
Definition at line 43 of file drivesup.c. Referenced by xHalIoReadPartitionTable(). |
|
Definition at line 42 of file drivesup.c. Referenced by DrivesupDebugPrint(). |
|
Definition at line 92 of file drivesup.c. |