#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <wingdi.h>
#include <winsvc.h>
#include <winreg.h>
#include <commctrl.h>
#include <commdlg.h>
#include <wchar.h>
#include <ndk/rtltypes.h>
#include <ndk/rtlfuncs.h>
#include <vcdioctl.h>
#include "resource.h"
Go to the source code of this file.
|
static HANDLE | OpenMaster (VOID) |
|
static HANDLE | OpenLetter (WCHAR Letter) |
|
static VOID | RefreshDevicesList (WCHAR Letter) |
|
VOID | SetServiceState (BOOLEAN Started) |
|
INT_PTR | QueryDriverInfo (HWND hDlg) |
|
static VOID | StartDriver (VOID) |
|
static VOID | StopDriver (VOID) |
|
static INT_PTR | HandleDriverCommand (WPARAM wParam, LPARAM lParam) |
|
static INT_PTR CALLBACK | DriverDialogProc (HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam) |
|
static VOID | DriverControl (VOID) |
|
static INT_PTR | SetMountFileName (HWND hDlg, LPARAM lParam) |
|
FORCEINLINE DWORD | Min (DWORD a, DWORD b) |
|
static VOID | PerformMount (VOID) |
|
static INT_PTR | HandleMountCommand (WPARAM wParam, LPARAM lParam) |
|
static INT_PTR CALLBACK | MountDialogProc (HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam) |
|
static VOID | AddDrive (VOID) |
|
static WCHAR | GetSelectedDriveLetter (VOID) |
|
static VOID | MountImage (VOID) |
|
static VOID | RemountImage (VOID) |
|
static VOID | EjectDrive (VOID) |
|
static VOID | RemoveDrive (VOID) |
|
static INT_PTR | HandleCommand (WPARAM wParam, LPARAM lParam) |
|
static VOID | ResetStats (VOID) |
|
static INT_PTR | HandleNotify (LPARAM lParam) |
|
static INT_PTR | CreateListViewColumns (HWND hDlg) |
|
static INT_PTR CALLBACK | MainDialogProc (HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam) |
|
INT WINAPI | wWinMain (HINSTANCE hInst, HINSTANCE hPrev, LPWSTR Cmd, int iCmd) |
|
◆ IOCTL_CDROM_BASE
◆ IOCTL_CDROM_EJECT_MEDIA
◆ WIN32_NO_STATUS
◆ AddDrive()
Definition at line 555 of file vcdcontroltool.c.
556{
561
562
565 {
566
569
570
571 if (!Res)
572 {
574 }
575
576
577
578
579
581 }
582}
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define INVALID_HANDLE_VALUE
#define IOCTL_VCDROM_CREATE_DRIVE
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Referenced by HandleCommand().
◆ CreateListViewColumns()
Definition at line 878 of file vcdcontroltool.c.
879{
883
886
887
889
890
896 szText[0] = 0;
898 szText[(
sizeof(szText) /
sizeof(
WCHAR)) - 1] =
L'\0';
900
901
902 szText[0] = 0;
905 szText[(
sizeof(szText) /
sizeof(
WCHAR)) - 1] =
L'\0';
907
908
910
911
913
915}
#define LVS_EX_FULLROWSELECT
#define LVM_INSERTCOLUMNW
#define LVM_SETEXTENDEDLISTVIEWSTYLE
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
Referenced by MainDialogProc().
◆ DriverControl()
Definition at line 387 of file vcdcontroltool.c.
388{
389
394 0);
395}
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
Referenced by HandleCommand().
◆ DriverDialogProc()
Definition at line 364 of file vcdcontroltool.c.
368{
369
371 {
374
377
380 }
381
383}
static const WCHAR Message[]
BOOL WINAPI DestroyWindow(_In_ HWND)
Referenced by DriverControl().
◆ EjectDrive()
◆ GetSelectedDriveLetter()
◆ HandleCommand()
◆ HandleDriverCommand()
◆ HandleMountCommand()
◆ HandleNotify()
Definition at line 815 of file vcdcontroltool.c.
816{
822
824
825
828 {
829
832 {
833
836 szText[2] = 0;
837
838
840 {
841
842
843
844 Sectors = ClusterSector * Clusters;
845
846
850
854
858
862
864 }
865 }
866
867
869
871 }
872
874}
NTSTATUS FreeClusters(PNTFS_VCB Vcb, PNTFS_ATTR_CONTEXT AttrContext, ULONG AttrOffset, PFILE_RECORD_HEADER FileRecord, ULONG ClustersToFree)
struct tagNMHDR * LPNMHDR
Referenced by MainDialogProc().
◆ MainDialogProc()
Definition at line 920 of file vcdcontroltool.c.
924{
925
927 {
930
933
936
939
943 }
944
946}
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
Referenced by wWinMain().
◆ Min()
Definition at line 418 of file vcdcontroltool.c.
419{
420 return (
a >
b ?
b :
a);
421}
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
◆ MountDialogProc()
◆ MountImage()
Definition at line 615 of file vcdcontroltool.c.
616{
620
621
622
623
624
625
627
629 {
630
632
639
640
641 szFileName[0] = 0;
645
646
648 {
649
650 return;
651 }
652
653
659 }
660}
#define OFN_FILEMUSTEXIST
Referenced by HandleCommand().
◆ OpenLetter()
◆ OpenMaster()
◆ PerformMount()
Definition at line 425 of file vcdcontroltool.c.
426{
434 WCHAR szKeyName[256];
436
437
439
440
443 {
445 }
446
447
450 {
452 }
453
454
457
458
461
462
464 {
465
469
470
473 {
474
476
478
479
481
482
483 if (Res && bPersist)
484 {
485 wsprintf(szKeyName,
L"SYSTEM\\CurrentControlSet\\Services\\Vcdrom\\Parameters\\Device%c",
wMountLetter);
487 {
491
494 szKeyName[2] = 0;
496
498 }
499 }
500 }
501 }
502
504}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define RegCloseKey(hKey)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
#define KEY_CREATE_SUB_KEY
#define REG_OPTION_NON_VOLATILE
#define MOUNT_FLAG_SUPP_UDF
#define MOUNT_FLAG_SUPP_JOLIET
#define IOCTL_VCDROM_MOUNT_IMAGE
#define HKEY_LOCAL_MACHINE
Referenced by HandleMountCommand().
◆ QueryDriverInfo()
Definition at line 200 of file vcdcontroltool.c.
201{
203 SC_HANDLE hMgr, hSvc;
208
210
211
214 {
215
218 {
219
222 {
223
225
227 {
228
232 }
233
235 }
236
237
239 {
242 {
244 }
245 else
246 {
248 }
249 }
250
252 }
253
255 }
256
257
258 {
263 }
264
265
267
269}
#define ERROR_INSUFFICIENT_BUFFER
#define HeapFree(x, y, z)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
DWORD WINAPI GetLastError(void)
#define QueryServiceConfig
#define SERVICE_QUERY_STATUS
#define SC_MANAGER_CONNECT
#define SERVICE_START_PENDING
#define SERVICE_QUERY_CONFIG
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
Referenced by DriverDialogProc().
◆ RefreshDevicesList()
static VOID RefreshDevicesList |
( |
WCHAR |
Letter | ) |
|
|
static |
Definition at line 62 of file vcdcontroltool.c.
63{
76
77
79
80
82
83
86 {
89
90 if (Res)
91 {
92
93 iSelected = -1;
95 {
96
99 {
100
102 if (Res)
103 {
104
111 szText[2] = 0;
112
113
114
115
117 if (lResult != -1)
118 {
119
121 {
122 iSelected = lResult;
123 }
124
125
127
128
129 if (
Image.Length != 0)
130 {
133 }
134
135
136 if (
Image.Mounted == 0)
137 {
138
139 if (
Image.Length == 0)
140 {
141 szImage[0] = 0;
143 szImage[(
sizeof(szImage) /
sizeof(
WCHAR)) - 1] =
L'\0';
144 }
145
146
147 szFormat[0] = 0;
149 szFormat[(
sizeof(szFormat) /
sizeof(
WCHAR)) - 1] =
L'\0';
150
151 swprintf(szText, szFormat, szImage);
153 }
154 else
155 {
156
158 }
159
160
162 }
163 }
164
165
167 }
168 }
169
170
171 if (iSelected != -1)
172 {
174
176 lvItem.
iItem = iSelected;
180 }
181 }
182 }
183}
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 memcpy(s1, s2, n)
#define LVM_DELETEALLITEMS
#define IOCTL_VCDROM_GET_IMAGE_PATH
#define IOCTL_VCDROM_ENUMERATE_DRIVES
Referenced by AddDrive(), CreateListViewColumns(), EjectDrive(), PerformMount(), RemountImage(), RemoveDrive(), StartDriver(), and StopDriver().
◆ RemountImage()
Definition at line 664 of file vcdcontroltool.c.
665{
669
670
673 {
674
677 {
678
680
682
683
684
685
687 }
688 }
689}
#define IOCTL_STORAGE_LOAD_MEDIA
Referenced by HandleCommand().
◆ RemoveDrive()
Definition at line 723 of file vcdcontroltool.c.
724{
728
729
732 {
733
736 {
737
739
741
742
744 }
745 }
746}
#define IOCTL_VCDROM_DELETE_DRIVE
Referenced by HandleCommand().
◆ ResetStats()
◆ SetMountFileName()
◆ SetServiceState()
◆ StartDriver()
◆ StopDriver()
Definition at line 304 of file vcdcontroltool.c.
305{
306 SC_HANDLE hMgr, hSvc;
308
309
312 {
313
316 {
317
318
320
322
323
325
326
328 }
329
331 }
332}
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
#define SERVICE_CONTROL_STOP
Referenced by HandleDriverCommand(), and UsermodeMethod().
◆ wWinMain()
This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER.PD within this package.
Definition at line 950 of file vcdcontroltool.c.
954{
956
958
959
964 0);
965
967 {
969 {
972 }
973 }
974
975 return 0;
976}
TW_UINT32 TW_UINT16 TW_UINT16 MSG
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
◆ hDriverWnd
◆ hInstance
◆ hMountWnd
◆ hWnd
◆ wMountLetter