19{
34
36
38 {
41 }
42
43
46 {
49 }
50
52 {
54 {
56 }
57 }
58
59
61 {
64
65
67 {
70 if (VolumeEntry)
72 }
73
74
76 }
77
78
80 {
83
84
87 {
90 if (VolumeEntry)
92 }
93
94
96 }
97
98
103
104
106
111 LayoutBufferSize);
113 {
114 DPRINT1(
"Failed to allocate the disk layout buffer!\n");
116 }
117
118
121 1024 * 1024);
122 if (SectorsBuffer ==
NULL)
123 {
124 DPRINT1(
"Failed to allocate the sectors buffer!\n");
125 goto done;
126 }
127
128
130 L"\\Device\\Harddisk%d\\Partition0",
132
134
140
145 0,
148 {
149 DPRINT1(
"Failed to open the disk! (Status 0x%08lx)\n",
Status);
151 goto done;
152 }
153
154
155 if (bAll)
156 {
159 {
166 SectorsBuffer,
167 1024 * 1024,
171 {
174 goto done;
175 }
176 }
177
180 {
181 Offset.QuadPart += (1024 * 1024);
187 SectorsBuffer,
192 {
193 DPRINT1(
"Failed to write the last part! (Status 0x%08lx)\n",
Status);
195 goto done;
196 }
197 }
198 }
199 else
200 {
201
208 SectorsBuffer,
209 1024 * 1024,
213 {
214 DPRINT1(
"Failed to write the first MB! (Status 0x%08lx)\n",
Status);
216 goto done;
217 }
218
219
226 SectorsBuffer,
227 1024 * 1024,
231 {
232 DPRINT1(
"Failed to write the last MB! (Status 0x%08lx)\n",
Status);
234 goto done;
235 }
236 }
237
239
240done:
243
244 if (SectorsBuffer !=
NULL)
245 RtlFreeHeap(RtlGetProcessHeap(), 0, SectorsBuffer);
246
248}
void ConResPuts(FILE *fp, UINT nID)
#define IDS_SELECT_NO_DISK
#define IDS_CLEAN_SUCCESS
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
VOID RemoveVolume(_In_ PVOLENTRY VolumeEntry)
PVOLENTRY GetVolumeFromPartition(_In_ PPARTENTRY PartEntry)
#define NT_SUCCESS(StatCode)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define FILE_SYNCHRONOUS_IO_NONALERT
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define OBJ_CASE_INSENSITIVE
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define IsContainerPartition(PartitionType)
struct _PARTITION_INFORMATION PARTITION_INFORMATION
struct _DRIVE_LAYOUT_INFORMATION DRIVE_LAYOUT_INFORMATION
_In_ ULONG _In_ ULONG Offset
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
base of all file and directory entries
ULARGE_INTEGER SectorCount
PPARTENTRY ExtendedPartition
LIST_ENTRY LogicalPartListHead
LIST_ENTRY PrimaryPartListHead
PDRIVE_LAYOUT_INFORMATION LayoutBuffer
#define CONTAINING_RECORD(address, type, field)
NTSTATUS DismountVolume(_Inout_ PVOLINFO Volume, _In_ BOOLEAN Force)
Attempts to dismount the designated volume.
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size