[RAMDISK]
[reactos.git] / reactos / include / reactos / drivers / ntddrdsk.h
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: include/reactos/drivers/ntddrdsk.h
5 * PURPOSE: Constants and types for accessing the RAM disk device
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8 #ifndef _NTDDRDSK_H_
9 #define _NTDDRDSK_H_
10
11 #if _MSC_VER > 1000
12 #pragma once
13 #endif
14
15 #ifdef __cplusplus1
16 extern "C" {
17 #endif
18
19 //
20 // This guid identifies a RAM disk volume
21 //
22 DEFINE_GUID(RAMDISK_BOOTDISK_GUID, 0xd9b257fc, 0x684e, 0x4dcb, 0x79, 0xab, 0xf6, 0xa2, 0xcf, 0x03, 0x50, 0xb7);
23
24 //
25 // This guid identifies a RAM disk bus
26 //
27 DEFINE_GUID(GUID_BUS_TYPE_RAMDISK, 0x9d6d66a6, 0x0b0c, 0x4563, 0x90, 0x77, 0xa0, 0xe9, 0xa7, 0x95, 0x5a, 0xe4);
28
29 //
30 // Device Name - this string is the name of the device. It is the name
31 // that should be passed to NtOpenFile when accessing the device.
32 //
33 // Note: For devices that support multiple units, it should be suffixed
34 // with the Ascii representation of the unit number.
35 //
36 #define DD_RAMDISK_DEVICE_NAME "\\Device\\Ramdisk"
37
38 //
39 // IoControlCode values for ramdisk devices.
40 //
41 #define IOCTL_RAMDISK_BASE FILE_DEVICE_VIRTUAL_DISK
42 #define FSCTL_CREATE_RAM_DISK CTL_CODE(FILE_DEVICE_VIRTUAL_DISK, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
43
44 //
45 // Disk Types
46 //
47 #define RAMDISK_REGISTRY_DISK 1 // Loaded from the registry
48 #define RAMDISK_MEMORY_MAPPED_DISK 2 // Loaded from the registry
49 #define RAMDISK_BOOT_DISK 3 // Used as a boot device
50 #define RAMDISK_WIM_DISK 4 // Used as an installation device
51
52 //
53 // Options when creating a ramdisk
54 //
55 typedef struct _RAMDISK_CREATE_OPTIONS
56 {
57 ULONG Readonly:1;
58 ULONG Fixed:1;
59 ULONG NoDriveLetter:1;
60 ULONG NoDosDevice:1;
61 ULONG Hidden:1;
62 ULONG ExportAsCd:1;
63 } RAMDISK_CREATE_OPTIONS;
64
65 //
66 // This structure is passed in for a FSCTL_CREATE_RAM_DISK call
67 //
68 typedef struct _RAMDISK_CREATE_INPUT
69 {
70 ULONG Version;
71 GUID DiskGuid;
72 ULONG DiskType;
73 RAMDISK_CREATE_OPTIONS Options;
74 LARGE_INTEGER DiskLength;
75 LONG DiskOffset;
76 union
77 {
78 struct
79 {
80 ULONG ViewCount;
81 SIZE_T ViewLength;
82 WCHAR FileName[ANYSIZE_ARRAY];
83 };
84 struct
85 {
86 ULONG_PTR BasePage;
87 WCHAR DriveLetter;
88 };
89 PVOID BaseAddress;
90 };
91 } RAMDISK_CREATE_INPUT, *PRAMDISK_CREATE_INPUT;
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif // _NTDDRDSK_H_