Added stubs for missing partition functions

svn path=/trunk/; revision=1951
This commit is contained in:
Eric Kohl 2001-06-08 15:11:04 +00:00
parent 624e3335e1
commit 18b431ed17
6 changed files with 292 additions and 256 deletions

View file

@ -1,6 +1,6 @@
#ifndef _INCLUDE_DDK_IOFUNCS_H #ifndef _INCLUDE_DDK_IOFUNCS_H
#define _INCLUDE_DDK_IOFUNCS_H #define _INCLUDE_DDK_IOFUNCS_H
/* $Id: iofuncs.h,v 1.23 2001/05/01 23:08:17 chorns Exp $ */ /* $Id: iofuncs.h,v 1.24 2001/06/08 15:06:51 ekohl Exp $ */
/* --- EXPORTED BY NTOSKRNL --- */ /* --- EXPORTED BY NTOSKRNL --- */
@ -1181,7 +1181,7 @@ IoWritePartitionTable (
ULONG SectorSize, ULONG SectorSize,
ULONG SectorsPerTrack, ULONG SectorsPerTrack,
ULONG NumberOfHeads, ULONG NumberOfHeads,
PDRIVE_LAYOUT_INFORMATION * PartitionBuffer PDRIVE_LAYOUT_INFORMATION PartitionBuffer
); );

View file

@ -1,9 +1,9 @@
/* $Id: drive.c,v 1.2 2000/06/30 22:51:34 ekohl Exp $ /* $Id: drive.c,v 1.3 2001/06/08 15:08:36 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: hal/x86/drive.c * FILE: hal/x86/drive.c
* PURPOSE: Drive letters * PURPOSE: Drive letter assignment
* PROGRAMMER: * PROGRAMMER:
* UPDATE HISTORY: * UPDATE HISTORY:
* 2000-03-25 * 2000-03-25
@ -17,14 +17,11 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
VOID VOID STDCALL
STDCALL IoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IoAssignDriveLetters (
IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN PSTRING NtDeviceName, IN PSTRING NtDeviceName,
OUT PUCHAR NtSystemPath, OUT PUCHAR NtSystemPath,
OUT PSTRING NtSystemPathString OUT PSTRING NtSystemPathString)
)
{ {
#ifdef __NTOSKRNL__ #ifdef __NTOSKRNL__
HalDispatchTable.HalIoAssignDriveLetters(LoaderBlock, HalDispatchTable.HalIoAssignDriveLetters(LoaderBlock,

View file

@ -1,4 +1,4 @@
/* $Id: parttab.c,v 1.3 2000/08/21 00:12:20 ekohl Exp $ /* $Id: parttab.c,v 1.4 2001/06/08 15:08:36 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -19,14 +19,11 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
NTSTATUS NTSTATUS STDCALL
STDCALL IoReadPartitionTable(PDEVICE_OBJECT DeviceObject,
IoReadPartitionTable (
PDEVICE_OBJECT DeviceObject,
ULONG SectorSize, ULONG SectorSize,
BOOLEAN ReturnRecognizedPartitions, BOOLEAN ReturnRecognizedPartitions,
PDRIVE_LAYOUT_INFORMATION * PartitionBuffer PDRIVE_LAYOUT_INFORMATION *PartitionBuffer)
)
{ {
#ifdef __NTOSKRNL__ #ifdef __NTOSKRNL__
return HalDispatchTable.HalIoReadPartitionTable(DeviceObject, return HalDispatchTable.HalIoReadPartitionTable(DeviceObject,
@ -41,29 +38,47 @@ IoReadPartitionTable (
#endif #endif
} }
NTSTATUS
STDCALL NTSTATUS STDCALL
IoSetPartitionInformation ( IoSetPartitionInformation(PDEVICE_OBJECT DeviceObject,
PDEVICE_OBJECT DeviceObject,
ULONG SectorSize, ULONG SectorSize,
ULONG PartitionNumber, ULONG PartitionNumber,
ULONG PartitionType) ULONG PartitionType)
{ {
UNIMPLEMENTED; #ifdef __NTOSKRNL__
return HalDispatchTable.HalIoSetPartitionInformation(DeviceObject,
SectorSize,
PartitionNumber,
PartitionType);
#else
return HalDispatchTable->HalIoSetPartitionInformation(DeviceObject,
SectorSize,
PartitionNumber,
PartitionType);
#endif
} }
NTSTATUS
STDCALL NTSTATUS STDCALL
IoWritePartitionTable ( IoWritePartitionTable(PDEVICE_OBJECT DeviceObject,
PDEVICE_OBJECT DeviceObject,
ULONG SectorSize, ULONG SectorSize,
ULONG SectorsPerTrack, ULONG SectorsPerTrack,
ULONG NumberOfHeads, ULONG NumberOfHeads,
PDRIVE_LAYOUT_INFORMATION * PBuffer PDRIVE_LAYOUT_INFORMATION PartitionBuffer)
)
{ {
UNIMPLEMENTED; #ifdef __NTOSKRNL__
return HalDispatchTable.HalIoWritePartitionTable(DeviceObject,
SectorSize,
SectorsPerTrack,
NumberOfHeads,
PartitionBuffer);
#else
return HalDispatchTable->HalIoWritePartitionTable(DeviceObject,
SectorSize,
SectorsPerTrack,
NumberOfHeads,
PartitionBuffer);
#endif
} }
/* EOF */ /* EOF */

View file

@ -1,32 +1,35 @@
#ifndef __INCLUDE_INTERNAL_XHAL_H #ifndef __INCLUDE_INTERNAL_XHAL_H
#define __INCLUDE_INTERNAL_XHAL_H #define __INCLUDE_INTERNAL_XHAL_H
VOID VOID FASTCALL
FASTCALL xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
xHalExamineMBR (
IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize, IN ULONG SectorSize,
IN ULONG MBRTypeIdentifier, IN ULONG MBRTypeIdentifier,
OUT PVOID * Buffer OUT PVOID *Buffer);
);
VOID VOID FASTCALL
FASTCALL xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
xHalIoAssignDriveLetters (
IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN PSTRING NtDeviceName, IN PSTRING NtDeviceName,
OUT PUCHAR NtSystemPath, OUT PUCHAR NtSystemPath,
OUT PSTRING NtSystemPathString OUT PSTRING NtSystemPathString);
);
NTSTATUS NTSTATUS FASTCALL
FASTCALL xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject,
xHalIoReadPartitionTable (
PDEVICE_OBJECT DeviceObject,
ULONG SectorSize, ULONG SectorSize,
BOOLEAN ReturnRecognizedPartitions, BOOLEAN ReturnRecognizedPartitions,
PDRIVE_LAYOUT_INFORMATION * PartitionBuffer PDRIVE_LAYOUT_INFORMATION *PartitionBuffer);
);
NTSTATUS FASTCALL
xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG PartitionNumber,
IN ULONG PartitionType);
NTSTATUS STDCALL
xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG SectorsPerTrack,
IN ULONG NumberOfHeads,
IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer);
#endif #endif

View file

@ -1,4 +1,4 @@
/* $Id: xhaldisp.c,v 1.3 2001/02/10 22:51:09 dwelch Exp $ /* $Id: xhaldisp.c,v 1.4 2001/06/08 15:11:04 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -27,8 +27,8 @@ HAL_DISPATCH EXPORTED HalDispatchTable =
xHalExamineMBR, xHalExamineMBR,
xHalIoAssignDriveLetters, xHalIoAssignDriveLetters,
xHalIoReadPartitionTable, xHalIoReadPartitionTable,
NULL, // xHalIoSetPartitionInformation, xHalIoSetPartitionInformation,
NULL, // xHalIoWritePartitionTable, xHalIoWritePartitionTable,
NULL, // HalReferenceHandlerForBus NULL, // HalReferenceHandlerForBus
NULL, // HalReferenceBusHandler NULL, // HalReferenceBusHandler
NULL // HalDereferenceBusHandler NULL // HalDereferenceBusHandler

View file

@ -1,4 +1,4 @@
/* $Id: xhaldrv.c,v 1.9 2001/06/07 21:16:41 ekohl Exp $ /* $Id: xhaldrv.c,v 1.10 2001/06/08 15:11:04 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -66,10 +66,8 @@ typedef struct _PARTITION_TABLE
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
static NTSTATUS static NTSTATUS
xHalpQueryDriveLayout ( xHalpQueryDriveLayout(IN PUNICODE_STRING DeviceName,
IN PUNICODE_STRING DeviceName, OUT PDRIVE_LAYOUT_INFORMATION *LayoutInfo)
OUT PDRIVE_LAYOUT_INFORMATION *LayoutInfo
)
{ {
IO_STATUS_BLOCK StatusBlock; IO_STATUS_BLOCK StatusBlock;
DISK_GEOMETRY DiskGeometry; DISK_GEOMETRY DiskGeometry;
@ -83,9 +81,7 @@ xHalpQueryDriveLayout (
DeviceName, DeviceName,
LayoutInfo); LayoutInfo);
/* /* Get the drives sector size */
* Get the drives sector size
*/
Status = IoGetDeviceObjectPointer(DeviceName, Status = IoGetDeviceObjectPointer(DeviceName,
FILE_READ_DATA, FILE_READ_DATA,
&FileObject, &FileObject,
@ -115,10 +111,15 @@ xHalpQueryDriveLayout (
return STATUS_INSUFFICIENT_RESOURCES; return STATUS_INSUFFICIENT_RESOURCES;
} }
Status = IoCallDriver(DeviceObject, Irp); Status = IoCallDriver(DeviceObject,
Irp);
if (Status == STATUS_PENDING) if (Status == STATUS_PENDING)
{ {
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); KeWaitForSingleObject(&Event,
Executive,
KernelMode,
FALSE,
NULL);
Status = StatusBlock.Status; Status = StatusBlock.Status;
} }
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -219,12 +220,11 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
*Buffer = (PVOID)LocalBuffer; *Buffer = (PVOID)LocalBuffer;
} }
static VOID static VOID
HalpAssignDrive ( HalpAssignDrive(IN PUNICODE_STRING PartitionName,
IN PUNICODE_STRING PartitionName,
IN OUT PULONG DriveMap, IN OUT PULONG DriveMap,
IN ULONG DriveNumber IN ULONG DriveNumber)
)
{ {
WCHAR DriveNameBuffer[8]; WCHAR DriveNameBuffer[8];
UNICODE_STRING DriveName; UNICODE_STRING DriveName;
@ -732,7 +732,7 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject,
IsRecognizedPartition (PartitionTable->Partition[i].PartitionType); IsRecognizedPartition (PartitionTable->Partition[i].PartitionType);
LayoutBuffer->PartitionEntry[Count].RewritePartition = FALSE; LayoutBuffer->PartitionEntry[Count].RewritePartition = FALSE;
DPRINT1(" %ld: nr: %d boot: %1x type: %x start: 0x%I64x count: 0x%I64x\n", DPRINT(" %ld: nr: %d boot: %1x type: %x start: 0x%I64x count: 0x%I64x\n",
Count, Count,
LayoutBuffer->PartitionEntry[Count].PartitionNumber, LayoutBuffer->PartitionEntry[Count].PartitionNumber,
LayoutBuffer->PartitionEntry[Count].BootIndicator, LayoutBuffer->PartitionEntry[Count].BootIndicator,
@ -764,4 +764,25 @@ xHalIoReadPartitionTable(PDEVICE_OBJECT DeviceObject,
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
NTSTATUS FASTCALL
xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG PartitionNumber,
IN ULONG PartitionType)
{
return STATUS_NOT_IMPLEMENTED;
}
NTSTATUS FASTCALL
xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize,
IN ULONG SectorsPerTrack,
IN ULONG NumberOfHeads,
IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer)
{
return STATUS_NOT_IMPLEMENTED;
}
/* EOF */ /* EOF */