ReactOS 0.4.15-dev-7934-g1dc8d80
scrub.cpp
Go to the documentation of this file.
1/* Copyright (c) Mark Harmstone 2017
2 *
3 * This file is part of WinBtrfs.
4 *
5 * WinBtrfs is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public Licence as published by
7 * the Free Software Foundation, either version 3 of the Licence, or
8 * (at your option) any later version.
9 *
10 * WinBtrfs is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public Licence for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public Licence
16 * along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
17
18#include "shellext.h"
19#include "scrub.h"
20#include "resource.h"
21#ifndef __REACTOS__
22#include "../btrfsioctl.h"
23#else
24#include "btrfsioctl.h"
25#endif
26#include <shlobj.h>
27#include <uxtheme.h>
28#include <stdio.h>
29#ifndef __REACTOS__
30#include <strsafe.h>
31#include <winternl.h>
32#else
33#define WIN32_NO_STATUS
34#include <windef.h>
35#include <winbase.h>
36#include <strsafe.h>
37#include <ndk/iofuncs.h>
38#include <ndk/iotypes.h>
39#endif
40
41#define NO_SHLWAPI_STRFCNS
42#include <shlwapi.h>
43#include <uxtheme.h>
44
46 btrfs_query_scrub* bqs2 = nullptr;
47 bool alloc_bqs2 = false;
49 wstring s, t, u;
50 WCHAR dt[255], tm[255];
52 SYSTEMTIME systime;
53 uint64_t recoverable_errors = 0, unrecoverable_errors = 0;
54
55 try {
56 if (bqs->num_errors > 0) {
59 ULONG len;
60
64 throw last_error(GetLastError());
65
66 len = 0;
67
68 try {
69 do {
70 len += 1024;
71
72 if (bqs2) {
73 free(bqs2);
74 bqs2 = nullptr;
75 }
76
78
79 Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_QUERY_SCRUB, nullptr, 0, bqs2, len);
80
83 } while (Status == STATUS_BUFFER_OVERFLOW);
84 } catch (...) {
85 if (bqs2)
86 free(bqs2);
87
88 throw;
89 }
90
91 alloc_bqs2 = true;
92 } else
93 bqs2 = bqs;
94
95 // "scrub started"
96 if (bqs2->start_time.QuadPart > 0) {
97 filetime.dwLowDateTime = bqs2->start_time.LowPart;
98 filetime.dwHighDateTime = bqs2->start_time.HighPart;
99
100 if (!FileTimeToSystemTime(&filetime, &systime))
101 throw last_error(GetLastError());
102
103 if (!SystemTimeToTzSpecificLocalTime(nullptr, &systime, &systime))
104 throw last_error(GetLastError());
105
107 throw last_error(GetLastError());
108
109 if (!GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &systime, nullptr, dt, sizeof(dt) / sizeof(WCHAR)))
110 throw last_error(GetLastError());
111
112 if (!GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &systime, nullptr, tm, sizeof(tm) / sizeof(WCHAR)))
113 throw last_error(GetLastError());
114
115 wstring_sprintf(u, t, dt, tm);
116
117 s += u;
118 s += L"\r\n";
119 }
120
121 // errors
122 if (bqs2->num_errors > 0) {
123 btrfs_scrub_error* bse = &bqs2->errors;
124
125 do {
126 if (bse->recovered)
127 recoverable_errors++;
128 else
129 unrecoverable_errors++;
130
131 if (bse->parity) {
133 throw last_error(GetLastError());
134
135 wstring_sprintf(u, t, bse->address, bse->device);
136 } else if (bse->is_metadata) {
137 int message;
138
139 if (bse->recovered)
141 else if (bse->metadata.firstitem.obj_id == 0 && bse->metadata.firstitem.obj_type == 0 && bse->metadata.firstitem.offset == 0)
143 else
145
146 if (!load_string(module, message, t))
147 throw last_error(GetLastError());
148
149 if (bse->recovered)
150 wstring_sprintf(u, t, bse->address, bse->device);
151 else if (bse->metadata.firstitem.obj_id == 0 && bse->metadata.firstitem.obj_type == 0 && bse->metadata.firstitem.offset == 0)
152 wstring_sprintf(u, t, bse->address, bse->device, bse->metadata.root, bse->metadata.level);
153 else
154 wstring_sprintf(u, t, bse->address, bse->device, bse->metadata.root, bse->metadata.level, bse->metadata.firstitem.obj_id,
155 bse->metadata.firstitem.obj_type, bse->metadata.firstitem.offset);
156 } else {
157 int message;
158
159 if (bse->recovered)
161 else if (bse->data.subvol != 0)
163 else
165
166 if (!load_string(module, message, t))
167 throw last_error(GetLastError());
168
169 if (bse->recovered)
170 wstring_sprintf(u, t, bse->address, bse->device);
171 else if (bse->data.subvol != 0)
172 wstring_sprintf(u, t, bse->address, bse->device, bse->data.subvol,
173 bse->data.filename_length / sizeof(WCHAR), bse->data.filename, bse->data.offset);
174 else
175 wstring_sprintf(u, t, bse->address, bse->device, bse->data.filename_length / sizeof(WCHAR),
176 bse->data.filename, bse->data.offset);
177 }
178
179 s += u;
180 s += L"\r\n";
181
182 if (bse->next_entry == 0)
183 break;
184 else
185 bse = (btrfs_scrub_error*)((uint8_t*)bse + bse->next_entry);
186 } while (true);
187 }
188
189 if (bqs2->finish_time.QuadPart > 0) {
190 wstring d1, d2;
191 float speed;
192
193 // "scrub finished"
194
195 filetime.dwLowDateTime = bqs2->finish_time.LowPart;
196 filetime.dwHighDateTime = bqs2->finish_time.HighPart;
197
198 if (!FileTimeToSystemTime(&filetime, &systime))
199 throw last_error(GetLastError());
200
201 if (!SystemTimeToTzSpecificLocalTime(nullptr, &systime, &systime))
202 throw last_error(GetLastError());
203
205 throw last_error(GetLastError());
206
207 if (!GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &systime, nullptr, dt, sizeof(dt) / sizeof(WCHAR)))
208 throw last_error(GetLastError());
209
210 if (!GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &systime, nullptr, tm, sizeof(tm) / sizeof(WCHAR)))
211 throw last_error(GetLastError());
212
213 wstring_sprintf(u, t, dt, tm);
214
215 s += u;
216 s += L"\r\n";
217
218 // summary
219
221 throw last_error(GetLastError());
222
223 format_size(bqs2->data_scrubbed, d1, false);
224
225 speed = (float)bqs2->data_scrubbed / ((float)bqs2->duration / 10000000.0f);
226
227 format_size((uint64_t)speed, d2, false);
228
229 wstring_sprintf(u, t, d1.c_str(), bqs2->duration / 10000000, d2.c_str());
230
231 s += u;
232 s += L"\r\n";
233
234 // recoverable errors
235
237 throw last_error(GetLastError());
238
239 wstring_sprintf(u, t, recoverable_errors);
240
241 s += u;
242 s += L"\r\n";
243
244 // unrecoverable errors
245
247 throw last_error(GetLastError());
248
249 wstring_sprintf(u, t, unrecoverable_errors);
250
251 s += u;
252 s += L"\r\n";
253 }
254
255 SetWindowTextW(GetDlgItem(hwndDlg, IDC_SCRUB_INFO), s.c_str());
256 } catch (...) {
257 if (alloc_bqs2)
258 free(bqs2);
259
260 throw;
261 }
262
263 if (alloc_bqs2)
264 free(bqs2);
265}
266
267void BtrfsScrub::RefreshScrubDlg(HWND hwndDlg, bool first_time) {
269
270 {
273 if (h != INVALID_HANDLE_VALUE) {
276
277 Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_QUERY_SCRUB, nullptr, 0, &bqs, sizeof(btrfs_query_scrub));
278
280 throw ntstatus_error(Status);
281 } else
282 throw last_error(GetLastError());
283 }
284
285 if (first_time || status != bqs.status || chunks_left != bqs.chunks_left) {
286 wstring s;
287
288 if (bqs.status == BTRFS_SCRUB_STOPPED) {
289 EnableWindow(GetDlgItem(hwndDlg, IDC_START_SCRUB), true);
290 EnableWindow(GetDlgItem(hwndDlg, IDC_PAUSE_SCRUB), false);
291 EnableWindow(GetDlgItem(hwndDlg, IDC_CANCEL_SCRUB), false);
292
293 if (bqs.error != STATUS_SUCCESS) {
294 wstring t;
295
297 throw last_error(GetLastError());
298
299 wstring_sprintf(s, t, bqs.error);
300 } else {
302 throw last_error(GetLastError());
303 }
304 } else {
305 wstring t;
306 float pc;
307
308 EnableWindow(GetDlgItem(hwndDlg, IDC_START_SCRUB), false);
309 EnableWindow(GetDlgItem(hwndDlg, IDC_PAUSE_SCRUB), true);
311
313 throw last_error(GetLastError());
314
315 pc = ((float)(bqs.total_chunks - bqs.chunks_left) / (float)bqs.total_chunks) * 100.0f;
316
318 }
319
320 SetDlgItemTextW(hwndDlg, IDC_SCRUB_STATUS, s.c_str());
321
322 if (first_time || status != bqs.status) {
324
325 if (bqs.status != BTRFS_SCRUB_STOPPED) {
328
329 if (bqs.status == BTRFS_SCRUB_PAUSED)
330 SendMessageW(GetDlgItem(hwndDlg, IDC_SCRUB_PROGRESS), PBM_SETSTATE, PBST_PAUSED, 0);
331 else
332 SendMessageW(GetDlgItem(hwndDlg, IDC_SCRUB_PROGRESS), PBM_SETSTATE, PBST_NORMAL, 0);
333 } else {
336 }
337
339 }
340 }
341
342 if (bqs.status != BTRFS_SCRUB_STOPPED && chunks_left != bqs.chunks_left) {
345 }
346
347 if (first_time || status != bqs.status || num_errors != bqs.num_errors) {
348 UpdateTextBox(hwndDlg, &bqs);
349
351 }
352
353 status = bqs.status;
354}
355
359
360 if (h != INVALID_HANDLE_VALUE) {
363
364 Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_START_SCRUB, nullptr, 0, nullptr, 0);
365
368 NTSTATUS Status2;
369
370 Status2 = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_QUERY_BALANCE, nullptr, 0, &bqb, sizeof(btrfs_query_balance));
371
374 }
375
376 if (!NT_SUCCESS(Status))
377 throw ntstatus_error(Status);
378
379 RefreshScrubDlg(hwndDlg, true);
380 } else
381 throw last_error(GetLastError());
382}
383
386
389
390 if (h != INVALID_HANDLE_VALUE) {
393
394 Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_QUERY_SCRUB, nullptr, 0, &bqs, sizeof(btrfs_query_scrub));
395
397 throw ntstatus_error(Status);
398
399 if (bqs.status == BTRFS_SCRUB_PAUSED)
400 Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_RESUME_SCRUB, nullptr, 0, nullptr, 0);
401 else
402 Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_PAUSE_SCRUB, nullptr, 0, nullptr, 0);
403
404 if (!NT_SUCCESS(Status))
405 throw ntstatus_error(Status);
406 } else
407 throw last_error(GetLastError());
408}
409
413
414 if (h != INVALID_HANDLE_VALUE) {
417
418 Status = NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_STOP_SCRUB, nullptr, 0, nullptr, 0);
419
420 if (!NT_SUCCESS(Status))
421 throw ntstatus_error(Status);
422 } else
423 throw last_error(GetLastError());
424}
425
427 try {
428 switch (uMsg) {
429 case WM_INITDIALOG:
430 RefreshScrubDlg(hwndDlg, true);
431 SetTimer(hwndDlg, 1, 1000, nullptr);
432 break;
433
434 case WM_COMMAND:
435 switch (HIWORD(wParam)) {
436 case BN_CLICKED:
437 switch (LOWORD(wParam)) {
438 case IDOK:
439 case IDCANCEL:
440 EndDialog(hwndDlg, 0);
441 return true;
442
443 case IDC_START_SCRUB:
444 StartScrub(hwndDlg);
445 return true;
446
447 case IDC_PAUSE_SCRUB:
448 PauseScrub(hwndDlg);
449 return true;
450
451 case IDC_CANCEL_SCRUB:
452 StopScrub(hwndDlg);
453 return true;
454 }
455 break;
456 }
457 break;
458
459 case WM_TIMER:
460 RefreshScrubDlg(hwndDlg, false);
461 break;
462 }
463 } catch (const exception& e) {
464 error_message(hwndDlg, e.what());
465 }
466
467 return false;
468}
469
471 BtrfsScrub* bs;
472
473 if (uMsg == WM_INITDIALOG) {
475 bs = (BtrfsScrub*)lParam;
476 } else {
478 }
479
480 if (bs)
481 return bs->ScrubDlgProc(hwndDlg, uMsg, wParam, lParam);
482 else
483 return false;
484}
485
486extern "C" void CALLBACK ShowScrubW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow) {
487 try {
490 LUID luid;
491
493 throw last_error(GetLastError());
494
495 if (!LookupPrivilegeValueW(nullptr, L"SeManageVolumePrivilege", &luid))
496 throw last_error(GetLastError());
497
498 tp.PrivilegeCount = 1;
499 tp.Privileges[0].Luid = luid;
500 tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
501
502 if (!AdjustTokenPrivileges(token, false, &tp, sizeof(TOKEN_PRIVILEGES), nullptr, nullptr))
503 throw last_error(GetLastError());
504
506
507 BtrfsScrub scrub(lpszCmdLine);
508
510 } catch (const exception& e) {
511 error_message(hwnd, e.what());
512 }
513}
514
515extern "C" void CALLBACK StartScrubW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow) {
517
518 command_line_to_args(lpszCmdLine, args);
519
520 if (args.size() >= 1) {
521 LUID luid;
523
524 {
526
528 return;
529
530 if (!LookupPrivilegeValueW(nullptr, L"SeManageVolumePrivilege", &luid))
531 return;
532
533 tp.PrivilegeCount = 1;
534 tp.Privileges[0].Luid = luid;
535 tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
536
537 if (!AdjustTokenPrivileges(token, false, &tp, sizeof(TOKEN_PRIVILEGES), nullptr, nullptr))
538 return;
539 }
540
543 if (h != INVALID_HANDLE_VALUE) {
545
546 NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_START_SCRUB, nullptr, 0, nullptr, 0);
547 }
548 }
549}
550
551extern "C" void CALLBACK StopScrubW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow) {
553
554 command_line_to_args(lpszCmdLine, args);
555
556 if (args.size() >= 1) {
557 LUID luid;
559
560 {
562
564 return;
565
566 if (!LookupPrivilegeValueW(nullptr, L"SeManageVolumePrivilege", &luid))
567 return;
568
569 tp.PrivilegeCount = 1;
570 tp.Privileges[0].Luid = luid;
571 tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
572
573 if (!AdjustTokenPrivileges(token, false, &tp, sizeof(TOKEN_PRIVILEGES), nullptr, nullptr))
574 return;
575 }
576
579 if (h != INVALID_HANDLE_VALUE) {
581
582 NtFsControlFile(h, nullptr, nullptr, nullptr, &iosb, FSCTL_BTRFS_STOP_SCRUB, nullptr, 0, nullptr, 0);
583 }
584 }
585}
LONG NTSTATUS
Definition: precomp.h:26
#define FSCTL_BTRFS_QUERY_SCRUB
Definition: btrfsioctl.h:24
#define FSCTL_BTRFS_STOP_SCRUB
Definition: btrfsioctl.h:27
#define FSCTL_BTRFS_PAUSE_SCRUB
Definition: btrfsioctl.h:25
#define FSCTL_BTRFS_QUERY_BALANCE
Definition: btrfsioctl.h:15
#define FSCTL_BTRFS_RESUME_SCRUB
Definition: btrfsioctl.h:26
#define FSCTL_BTRFS_START_SCRUB
Definition: btrfsioctl.h:23
#define BTRFS_SCRUB_PAUSED
Definition: btrfsioctl.h:197
#define BTRFS_BALANCE_RUNNING
Definition: btrfsioctl.h:161
#define BTRFS_SCRUB_STOPPED
Definition: btrfsioctl.h:195
#define BTRFS_BALANCE_PAUSED
Definition: btrfsioctl.h:162
void StopScrub(HWND hwndDlg)
Definition: scrub.cpp:410
wstring fn
Definition: scrub.h:44
INT_PTR CALLBACK ScrubDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: scrub.cpp:426
uint32_t num_errors
Definition: scrub.h:47
uint64_t chunks_left
Definition: scrub.h:46
void StartScrub(HWND hwndDlg)
Definition: scrub.cpp:356
void RefreshScrubDlg(HWND hwndDlg, bool first_time)
Definition: scrub.cpp:267
void UpdateTextBox(HWND hwndDlg, btrfs_query_scrub *bqs)
Definition: scrub.cpp:45
void PauseScrub(HWND hwndDlg)
Definition: scrub.cpp:384
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
UINT64 uint64_t
Definition: types.h:77
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
void set_dpi_aware()
Definition: main.cpp:50
void error_message(HWND hwnd, const char *msg)
Definition: main.cpp:783
void wstring_sprintf(wstring &s, wstring fmt,...)
Definition: main.cpp:225
void format_size(uint64_t size, wstring &s, bool show_bytes)
Definition: main.cpp:65
void command_line_to_args(LPWSTR cmdline, vector< wstring > &args)
Definition: main.cpp:645
#define IDC_CANCEL_SCRUB
Definition: resource.h:313
#define IDS_SCRUB_MSG_RECOVERABLE_DATA
Definition: resource.h:109
#define IDS_SCRUB_MSG_RECOVERABLE_PARITY
Definition: resource.h:123
#define IDS_SCRUB_MSG_SUMMARY
Definition: resource.h:116
#define IDC_SCRUB_PROGRESS
Definition: resource.h:315
#define IDS_SCRUB_MSG_SUMMARY_ERRORS_RECOVERABLE
Definition: resource.h:119
#define IDC_SCRUB_INFO
Definition: resource.h:308
#define IDS_SCRUB_MSG_RECOVERABLE_METADATA
Definition: resource.h:110
#define IDS_SCRUB_MSG_UNRECOVERABLE_METADATA
Definition: resource.h:113
#define IDS_NO_SCRUB
Definition: resource.h:104
#define IDS_SCRUB_PAUSED
Definition: resource.h:107
#define IDC_SCRUB_STATUS
Definition: resource.h:317
#define IDS_SCRUB_MSG_UNRECOVERABLE_METADATA_FIRSTITEM
Definition: resource.h:114
#define IDS_SCRUB_MSG_UNRECOVERABLE_DATA
Definition: resource.h:111
#define IDS_SCRUB_MSG_SUMMARY_ERRORS_UNRECOVERABLE
Definition: resource.h:120
#define IDS_SCRUB_MSG_STARTED
Definition: resource.h:108
#define IDC_START_SCRUB
Definition: resource.h:310
#define IDD_SCRUB
Definition: resource.h:82
#define IDS_SCRUB_MSG_UNRECOVERABLE_DATA_SUBVOL
Definition: resource.h:112
#define IDS_SCRUB_FINISHED
Definition: resource.h:106
#define IDS_SCRUB_BALANCE_RUNNING
Definition: resource.h:118
#define IDC_PAUSE_SCRUB
Definition: resource.h:312
#define IDS_SCRUB_MSG_FINISHED
Definition: resource.h:115
#define IDS_SCRUB_RUNNING
Definition: resource.h:105
#define IDS_SCRUB_FAILED
Definition: resource.h:121
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GetCurrentProcess()
Definition: compat.h:759
#define CreateFileW
Definition: compat.h:741
#define CALLBACK
Definition: compat.h:35
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
BOOL WINAPI SystemTimeToTzSpecificLocalTime(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation, CONST SYSTEMTIME *lpUniversalTime, LPSYSTEMTIME lpLocalTime)
Definition: timezone.c:377
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
Status
Definition: gdiplustypes.h:25
GLdouble s
Definition: gl.h:2039
GLdouble GLdouble t
Definition: gl.h:2047
GLenum GLsizei len
Definition: glext.h:6722
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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 * u
Definition: glfuncs.h:240
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 token
Definition: glfuncs.h:210
#define e
Definition: ke_i.h:82
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
static struct msdos_boot_sector bs
Definition: mkdosfs.c:539
#define FILE_FLAG_OPEN_REPARSE_POINT
Definition: disk.h:39
#define FILE_FLAG_BACKUP_SEMANTICS
Definition: disk.h:41
static HINSTANCE hinst
Definition: edit.c:551
static PIO_STATUS_BLOCK iosb
Definition: file.c:98
static float(__cdecl *square_half_float)(float x
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
BYTE uint8_t
Definition: msvideo1.c:66
static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars)
Definition: muireg.c:10
unsigned int UINT
Definition: ndis.h:50
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define FILE_TRAVERSE
Definition: nt_native.h:643
NTSYSAPI NTSTATUS NTAPI NtFsControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define LOCALE_USER_DEFAULT
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define PBM_SETRANGE32
Definition: commctrl.h:2188
#define PBM_SETPOS
Definition: commctrl.h:2184
static INT_PTR CALLBACK stub_ScrubDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: scrub.cpp:470
void CALLBACK StopScrubW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
Definition: scrub.cpp:551
void CALLBACK ShowScrubW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
Definition: scrub.cpp:486
void CALLBACK StartScrubW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow)
Definition: scrub.cpp:515
#define STATUS_DEVICE_NOT_READY
Definition: shellext.h:70
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
Definition: match.c:390
LARGE_INTEGER start_time
Definition: btrfsioctl.h:225
uint64_t chunks_left
Definition: btrfsioctl.h:227
uint32_t num_errors
Definition: btrfsioctl.h:232
LARGE_INTEGER finish_time
Definition: btrfsioctl.h:226
uint64_t duration
Definition: btrfsioctl.h:230
uint64_t data_scrubbed
Definition: btrfsioctl.h:229
uint64_t total_chunks
Definition: btrfsioctl.h:228
btrfs_scrub_error errors
Definition: btrfsioctl.h:233
struct btrfs_scrub_error::@657::@659 data
struct btrfs_scrub_error::@657::@660 metadata
uint64_t address
Definition: btrfsioctl.h:201
uint32_t next_entry
Definition: btrfsioctl.h:200
Definition: tftpd.h:60
Definition: ps.c:97
Definition: time.h:68
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define DATE_SHORTDATE
Definition: winnls.h:196
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WM_INITDIALOG
Definition: winuser.h:1739
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define WM_TIMER
Definition: winuser.h:1742
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define BN_CLICKED
Definition: winuser.h:1925
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define TOKEN_QUERY
Definition: setypes.h:928
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184