From 99a3cc7d54640bfcbab7d3c64f97af38224f6b22 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Mon, 6 Feb 2012 08:15:21 +0000 Subject: [PATCH] [DISK] - Add more structures to ntdddisk.h - Fix more compile errors in disk_new - disk_new builds but fails to link as classpnp import lib is broken svn path=/branches/usb-bringup-trunk/; revision=55451 --- drivers/storage/class/disk_new/disk.c | 2 ++ drivers/storage/class/disk_new/diskwmi.c | 10 +++++----- drivers/storage/class/disk_new/enum.c | 2 +- drivers/storage/classpnp/CMakeLists.txt | 1 + include/psdk/ntdddisk.h | 23 +++++++++++++++++++++++ 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/storage/class/disk_new/disk.c b/drivers/storage/class/disk_new/disk.c index b6c6f966f3c..7bd390d447f 100644 --- a/drivers/storage/class/disk_new/disk.c +++ b/drivers/storage/class/disk_new/disk.c @@ -1201,6 +1201,7 @@ Return Value: break; } +#if(_WIN32_WINNT >= 0x0500) case IOCTL_DISK_GET_WRITE_CACHE_STATE: { PDISK_WRITE_CACHE_STATE writeCacheState = (PDISK_WRITE_CACHE_STATE)Irp->AssociatedIrp.SystemBuffer; @@ -1248,6 +1249,7 @@ Return Value: status = STATUS_SUCCESS; break; } +#endif case SMART_GET_VERSION: { diff --git a/drivers/storage/class/disk_new/diskwmi.c b/drivers/storage/class/disk_new/diskwmi.c index 7cc9cf0bbdd..1ce6dd5aa97 100644 --- a/drivers/storage/class/disk_new/diskwmi.c +++ b/drivers/storage/class/disk_new/diskwmi.c @@ -281,7 +281,7 @@ ULONG DiskDummyData[4] = { 1, 2, 3, 4}; // // Enable SMART // -_inline NTSTATUS +__inline NTSTATUS DiskEnableSmart( PFUNCTIONAL_DEVICE_EXTENSION FdoExtension ) @@ -302,7 +302,7 @@ DiskEnableSmart( // // Disable SMART // -_inline NTSTATUS +__inline NTSTATUS DiskDisableSmart( PFUNCTIONAL_DEVICE_EXTENSION FdoExtension ) @@ -322,7 +322,7 @@ DiskDisableSmart( // // Enable Attribute Autosave // -_inline NTSTATUS +__inline NTSTATUS DiskEnableSmartAttributeAutosave( PFUNCTIONAL_DEVICE_EXTENSION FdoExtension ) @@ -342,7 +342,7 @@ DiskEnableSmartAttributeAutosave( // // Disable Attribute Autosave // -_inline NTSTATUS +__inline NTSTATUS DiskDisableSmartAttributeAutosave( PFUNCTIONAL_DEVICE_EXTENSION FdoExtension ) @@ -362,7 +362,7 @@ DiskDisableSmartAttributeAutosave( // // Initialize execution of SMART online diagnostics // -_inline NTSTATUS +__inline NTSTATUS DiskExecuteSmartDiagnostics( PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, UCHAR Subcommand diff --git a/drivers/storage/class/disk_new/enum.c b/drivers/storage/class/disk_new/enum.c index e190dbdf6c3..56febd7853d 100644 --- a/drivers/storage/class/disk_new/enum.c +++ b/drivers/storage/class/disk_new/enum.c @@ -646,7 +646,7 @@ Return Value: ULONG partitionOrdinal; ULONG newPartitionNumber; - PPARTITION_INFORMATION_EX partitionEntry; + PPARTITION_INFORMATION_EX partitionEntry = NULL; PDISK_DATA pdoData; PARTITION_STYLE partitionStyle; diff --git a/drivers/storage/classpnp/CMakeLists.txt b/drivers/storage/classpnp/CMakeLists.txt index 1d5672b34b6..2479aa7d033 100644 --- a/drivers/storage/classpnp/CMakeLists.txt +++ b/drivers/storage/classpnp/CMakeLists.txt @@ -42,4 +42,5 @@ add_pch(classpnp classp.h) target_link_libraries(classpnp ${PSEH_LIB} libcntpr) set_module_type(classpnp kernelmodedriver) add_importlibs(classpnp hal ntoskrnl) +add_importlib_target(class.spec) add_cd_file(TARGET classpnp DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/include/psdk/ntdddisk.h b/include/psdk/ntdddisk.h index 36f66eed273..2aa649ccbc4 100644 --- a/include/psdk/ntdddisk.h +++ b/include/psdk/ntdddisk.h @@ -581,6 +581,29 @@ typedef struct _MAPPED_ADDRESS { #if(_WIN32_WINNT >= 0x0500) + +typedef struct _CREATE_DISK_GPT +{ + GUID DiskId; + ULONG MaxPartitionCount; +} CREATE_DISK_GPT, *PCREATE_DISK_GPT; + +typedef struct _CREATE_DISK_MBR +{ + ULONG Signature; +} CREATE_DISK_MBR, *PCREATE_DISK_MBR; + + +typedef struct _CREATE_DISK +{ + PARTITION_STYLE PartitionStyle; + union { + CREATE_DISK_MBR Mbr; + CREATE_DISK_GPT Gpt; + }; +} CREATE_DISK, *PCREATE_DISK; + + typedef enum { EqualPriority, KeepPrefetchedData,