ReactOS 0.4.15-dev-5667-ged97270
vcdcontroltool.c File Reference
#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"
Include dependency graph for vcdcontroltool.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define IOCTL_CDROM_BASE   FILE_DEVICE_CD_ROM
 
#define IOCTL_CDROM_EJECT_MEDIA   CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
 

Functions

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)
 

Variables

HWND hWnd
 
HWND hMountWnd
 
HWND hDriverWnd
 
HINSTANCE hInstance
 
WCHAR wMountLetter
 

Macro Definition Documentation

◆ IOCTL_CDROM_BASE

#define IOCTL_CDROM_BASE   FILE_DEVICE_CD_ROM

Definition at line 25 of file vcdcontroltool.c.

◆ IOCTL_CDROM_EJECT_MEDIA

#define IOCTL_CDROM_EJECT_MEDIA   CTL_CODE(IOCTL_CDROM_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)

Definition at line 26 of file vcdcontroltool.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file vcdcontroltool.c.

Function Documentation

◆ AddDrive()

static VOID AddDrive ( VOID  )
static

Definition at line 555 of file vcdcontroltool.c.

556{
558 BOOLEAN Res;
560 HANDLE hMaster;
561
562 /* Open the driver */
563 hMaster = OpenMaster();
564 if (hMaster != INVALID_HANDLE_VALUE)
565 {
566 /* Issue the create IOCTL */
567 Res = DeviceIoControl(hMaster, IOCTL_VCDROM_CREATE_DRIVE, NULL, 0, &Letter, sizeof(WCHAR), &BytesRead, NULL);
568 CloseHandle(hMaster);
569
570 /* If it failed, reset the drive letter */
571 if (!Res)
572 {
573 Letter = 0;
574 }
575
576 /* Refresh devices list. If it succeed, we pass the created drive letter
577 * So that, user can directly click on "mount" to mount an image, without
578 * needing to select appropriate device.
579 */
581 }
582}
WCHAR Letter
unsigned char BOOLEAN
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)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID RefreshDevicesList(WCHAR Letter)
static HANDLE OpenMaster(VOID)
#define IOCTL_VCDROM_CREATE_DRIVE
Definition: vcdioctl.h:2
_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
Definition: wdfiotarget.h:870
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by HandleCommand().

◆ CreateListViewColumns()

static INT_PTR CreateListViewColumns ( HWND  hDlg)
static

Definition at line 878 of file vcdcontroltool.c.

879{
880 WCHAR szText[255];
881 LVCOLUMNW lvColumn;
882 HWND hListView;
883
884 hWnd = hDlg;
885 hListView = GetDlgItem(hDlg, IDC_MAINDEVICES);
886
887 /* Select the whole line, not just the first column */
889
890 /* Set up the first column */
891 ZeroMemory(&lvColumn, sizeof(LVCOLUMNW));
892 lvColumn.pszText = szText;
894 lvColumn.fmt = LVCFMT_LEFT;
895 lvColumn.cx = 100;
896 szText[0] = 0;
897 LoadString(hInstance, IDS_DRIVE, szText, sizeof(szText) / sizeof(WCHAR));
898 szText[(sizeof(szText) / sizeof(WCHAR)) - 1] = L'\0';
899 SendMessage(hListView, LVM_INSERTCOLUMNW, 0, (LPARAM)&lvColumn);
900
901 /* Set up the second column */
902 szText[0] = 0;
903 lvColumn.cx = 350;
904 LoadString(hInstance, IDS_MAPPEDIMAGE, szText, sizeof(szText) / sizeof(WCHAR));
905 szText[(sizeof(szText) / sizeof(WCHAR)) - 1] = L'\0';
906 SendMessage(hListView, LVM_INSERTCOLUMNW, 1, (LPARAM)&lvColumn);
907
908 /* Make sure stats are at 0 */
909 ResetStats();
910
911 /* And populate our device list */
913
914 return TRUE;
915}
#define TRUE
Definition: types.h:120
#define IDS_MAPPEDIMAGE
Definition: resource.h:34
#define IDC_MAINDEVICES
Definition: resource.h:9
#define IDS_DRIVE
Definition: resource.h:33
#define L(x)
Definition: ntvdm.h:50
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2632
#define LVCF_FMT
Definition: commctrl.h:2586
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2724
LPWSTR pszText
Definition: commctrl.h:2567
HINSTANCE hInstance
static VOID ResetStats(VOID)
HWND hWnd
#define ZeroMemory
Definition: winbase.h:1670
LONG_PTR LPARAM
Definition: windef.h:208
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SendMessage
Definition: winuser.h:5833
#define LoadString
Definition: winuser.h:5809

Referenced by MainDialogProc().

◆ DriverControl()

static VOID DriverControl ( VOID  )
static

Definition at line 387 of file vcdcontroltool.c.

388{
389 /* Just create a new window with our driver control dialog */
392 NULL,
394 0);
395}
#define IDD_DRIVERWINDOW
Definition: resource.h:5
static INT_PTR CALLBACK DriverDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by HandleCommand().

◆ DriverDialogProc()

static INT_PTR CALLBACK DriverDialogProc ( HWND  hDlg,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 364 of file vcdcontroltool.c.

368{
369 /* Dispatch the message */
370 switch (Message)
371 {
372 case WM_INITDIALOG:
373 return QueryDriverInfo(hDlg);
374
375 case WM_COMMAND:
377
378 case WM_CLOSE:
379 return DestroyWindow(hDlg);
380 }
381
382 return FALSE;
383}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define FALSE
Definition: types.h:117
static const WCHAR Message[]
Definition: register.c:74
INT_PTR QueryDriverInfo(HWND hDlg)
static INT_PTR HandleDriverCommand(WPARAM wParam, LPARAM lParam)
#define WM_CLOSE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_INITDIALOG
Definition: winuser.h:1729
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by DriverControl().

◆ EjectDrive()

static VOID EjectDrive ( VOID  )
static

Definition at line 693 of file vcdcontroltool.c.

694{
696 HANDLE hLet;
698
699 /* Get the select drive letter */
701 if (Letter != 0)
702 {
703 /* Open it */
704 hLet = OpenLetter(Letter);
705 if (hLet != INVALID_HANDLE_VALUE)
706 {
707 /* And ask the driver for an ejection */
709
710 CloseHandle(hLet);
711
712 /* Refresh the list, to display the fact the image is now unmounted but
713 * still known by the driver
714 * Make sure it's selected as it was previously selected.
715 */
717 }
718 }
719}
#define IOCTL_CDROM_EJECT_MEDIA
static HANDLE OpenLetter(WCHAR Letter)
static WCHAR GetSelectedDriveLetter(VOID)

Referenced by HandleCommand().

◆ GetSelectedDriveLetter()

static WCHAR GetSelectedDriveLetter ( VOID  )
static

Definition at line 586 of file vcdcontroltool.c.

587{
588 INT iItem;
589 HWND hListView;
590 LVITEM lvItem;
591 WCHAR szText[255];
592
593 /* Get the select device in the list view */
594 hListView = GetDlgItem(hWnd, IDC_MAINDEVICES);
595 iItem = SendMessage(hListView, LVM_GETNEXTITEM, -1, LVNI_SELECTED);
596 /* If there's one... */
597 if (iItem != -1)
598 {
599 ZeroMemory(&lvItem, sizeof(LVITEM));
600 lvItem.pszText = szText;
601 lvItem.cchTextMax = sizeof(szText) / sizeof(WCHAR);
602 szText[0] = 0;
603
604 /* Get the item text, it will be the drive letter */
605 SendMessage(hListView, LVM_GETITEMTEXT, iItem, (LPARAM)&lvItem);
606 return szText[0];
607 }
608
609 /* Nothing selected */
610 return 0;
611}
#define LVM_GETITEMTEXT
Definition: commctrl.h:2682
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define LVM_GETNEXTITEM
Definition: commctrl.h:2433
#define LVITEM
Definition: commctrl.h:2375
int32_t INT
Definition: typedefs.h:58

Referenced by EjectDrive(), HandleNotify(), MountImage(), RemountImage(), and RemoveDrive().

◆ HandleCommand()

static INT_PTR HandleCommand ( WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 750 of file vcdcontroltool.c.

752{
753 WORD Msg;
754
755 /* Dispatch the message for the controls we manage */
756 Msg = LOWORD(wParam);
757 switch (Msg)
758 {
759 case IDC_MAINCONTROL:
761 return TRUE;
762
763 case IDC_MAINOK:
765 return TRUE;
766
767 case IDC_MAINADD:
768 AddDrive();
769 return TRUE;
770
771 case IDC_MAINMOUNT:
772 MountImage();
773 return TRUE;
774
775 case IDC_MAINREMOUNT:
776 RemountImage();
777 return TRUE;
778
779 case IDC_MAINEJECT:
780 EjectDrive();
781 return TRUE;
782
783 case IDC_MAINREMOVE:
784 RemoveDrive();
785 return TRUE;
786 }
787
788 return FALSE;
789}
struct @1609 Msg[]
unsigned short WORD
Definition: ntddk_ex.h:93
#define IDC_MAINOK
Definition: resource.h:8
#define IDC_MAINMOUNT
Definition: resource.h:16
#define IDC_MAINREMOVE
Definition: resource.h:15
#define IDC_MAINREMOUNT
Definition: resource.h:18
#define IDC_MAINCONTROL
Definition: resource.h:19
#define IDC_MAINADD
Definition: resource.h:14
#define IDC_MAINEJECT
Definition: resource.h:17
#define LOWORD(l)
Definition: pedump.c:82
static VOID RemoveDrive(VOID)
static VOID MountImage(VOID)
static VOID AddDrive(VOID)
static VOID EjectDrive(VOID)
static VOID DriverControl(VOID)
static VOID RemountImage(VOID)

Referenced by MainDialogProc().

◆ HandleDriverCommand()

static INT_PTR HandleDriverCommand ( WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 336 of file vcdcontroltool.c.

338{
339 WORD Msg;
340
341 /* Dispatch the message for the controls we manage */
342 Msg = LOWORD(wParam);
343 switch (Msg)
344 {
345 case IDC_DRIVEROK:
347 return TRUE;
348
349 case IDC_DRIVERSTART:
350 StartDriver();
351 return TRUE;
352
353 case IDC_DRIVERSTOP:
354 StopDriver();
355 return TRUE;
356 }
357
358 return FALSE;
359}
#define IDC_DRIVEROK
Definition: resource.h:26
#define IDC_DRIVERSTOP
Definition: resource.h:29
#define IDC_DRIVERSTART
Definition: resource.h:28
static VOID StartDriver(VOID)
static VOID StopDriver(VOID)
HWND hDriverWnd

Referenced by DriverDialogProc().

◆ HandleMountCommand()

static INT_PTR HandleMountCommand ( WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 508 of file vcdcontroltool.c.

510{
511 WORD Msg;
512
513 /* Dispatch the message for the controls we manage */
514 Msg = LOWORD(wParam);
515 switch (Msg)
516 {
517 case IDC_MOUNTCANCEL:
519 return TRUE;
520
521 case IDC_MOUNTOK:
522 PerformMount();
523 return TRUE;
524 }
525
526 return FALSE;
527}
#define IDC_MOUNTCANCEL
Definition: resource.h:21
#define IDC_MOUNTOK
Definition: resource.h:20
HWND hMountWnd
static VOID PerformMount(VOID)

Referenced by MountDialogProc().

◆ HandleNotify()

static INT_PTR HandleNotify ( LPARAM  lParam)
static

Definition at line 815 of file vcdcontroltool.c.

816{
818 LPNMHDR NmHdr;
819 WCHAR szText[255];
820 HWND hEditText;
821 DWORD ClusterSector, SectorSize, FreeClusters, Clusters, Sectors;
822
823 NmHdr = (LPNMHDR)lParam;
824
825 /* We only want notifications on click on our devices list */
826 if (NmHdr->code == NM_CLICK &&
827 NmHdr->idFrom == IDC_MAINDEVICES)
828 {
829 /* Get the newly selected device */
831 if (Letter != 0)
832 {
833 /* Setup its name */
834 szText[0] = Letter;
835 szText[1] = L':';
836 szText[2] = 0;
837
838 /* And get its capacities */
839 if (GetDiskFreeSpace(szText, &ClusterSector, &SectorSize, &FreeClusters, &Clusters))
840 {
841 /* Nota: the application returns the total amount of clusters and sectors
842 * So, compute it
843 */
844 Sectors = ClusterSector * Clusters;
845
846 /* And now, update statistics about the device */
847 hEditText = GetDlgItem(hWnd, IDC_MAINSECTORS);
848 wsprintf(szText, L"%ld", Sectors);
849 SendMessage(hEditText, WM_SETTEXT, 0, (LPARAM)szText);
850
851 hEditText = GetDlgItem(hWnd, IDC_MAINSIZE);
852 wsprintf(szText, L"%ld", SectorSize);
853 SendMessage(hEditText, WM_SETTEXT, 0, (LPARAM)szText);
854
855 hEditText = GetDlgItem(hWnd, IDC_MAINFREE);
856 wsprintf(szText, L"%ld", FreeClusters);
857 SendMessage(hEditText, WM_SETTEXT, 0, (LPARAM)szText);
858
859 hEditText = GetDlgItem(hWnd, IDC_MAINTOTAL);
860 wsprintf(szText, L"%ld", Clusters);
861 SendMessage(hEditText, WM_SETTEXT, 0, (LPARAM)szText);
862
863 return TRUE;
864 }
865 }
866
867 /* We failed somewhere, make sure we're at 0 */
868 ResetStats();
869
870 return TRUE;
871 }
872
873 return FALSE;
874}
NTSTATUS FreeClusters(PNTFS_VCB Vcb, PNTFS_ATTR_CONTEXT AttrContext, ULONG AttrOffset, PFILE_RECORD_HEADER FileRecord, ULONG ClustersToFree)
Definition: attrib.c:1057
#define IDC_MAINSIZE
Definition: resource.h:11
#define IDC_MAINTOTAL
Definition: resource.h:13
#define IDC_MAINFREE
Definition: resource.h:12
#define IDC_MAINSECTORS
Definition: resource.h:10
#define NM_CLICK
Definition: commctrl.h:130
UINT_PTR idFrom
Definition: winuser.h:3148
UINT code
Definition: winuser.h:3149
#define GetDiskFreeSpace
Definition: winbase.h:3678
#define WM_SETTEXT
Definition: winuser.h:1607
struct tagNMHDR * LPNMHDR
#define wsprintf
Definition: winuser.h:5855
_In_ ULONG SectorSize
Definition: halfuncs.h:291

Referenced by MainDialogProc().

◆ MainDialogProc()

static INT_PTR CALLBACK MainDialogProc ( HWND  hDlg,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 920 of file vcdcontroltool.c.

924{
925 /* Dispatch the message */
926 switch (Message)
927 {
928 case WM_INITDIALOG:
929 return CreateListViewColumns(hDlg);
930
931 case WM_COMMAND:
932 return HandleCommand(wParam, lParam);
933
934 case WM_NOTIFY:
935 return HandleNotify(lParam);
936
937 case WM_CLOSE:
938 return DestroyWindow(hDlg);
939
940 case WM_DESTROY:
942 return TRUE;
943 }
944
945 return FALSE;
946}
#define WM_NOTIFY
Definition: richedit.h:61
static INT_PTR HandleCommand(WPARAM wParam, LPARAM lParam)
static INT_PTR HandleNotify(LPARAM lParam)
static INT_PTR CreateListViewColumns(HWND hDlg)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_DESTROY
Definition: winuser.h:1599

Referenced by wWinMain().

◆ Min()

FORCEINLINE DWORD Min ( DWORD  a,
DWORD  b 
)

Definition at line 418 of file vcdcontroltool.c.

419{
420 return (a > b ? b : a);
421}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ MountDialogProc()

static INT_PTR CALLBACK MountDialogProc ( HWND  hDlg,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 532 of file vcdcontroltool.c.

536{
537 /* Dispatch the message */
538 switch (Message)
539 {
540 case WM_INITDIALOG:
541 return SetMountFileName(hDlg, lParam);
542
543 case WM_COMMAND:
545
546 case WM_CLOSE:
547 return DestroyWindow(hDlg);
548 }
549
550 return FALSE;
551}
static INT_PTR HandleMountCommand(WPARAM wParam, LPARAM lParam)
static INT_PTR SetMountFileName(HWND hDlg, LPARAM lParam)

Referenced by MountImage().

◆ MountImage()

static VOID MountImage ( VOID  )
static

Definition at line 615 of file vcdcontroltool.c.

616{
617 WCHAR szFilter[255];
618 WCHAR szFileName[MAX_PATH];
619 OPENFILENAMEW ImageOpen;
620
621 /* Get the selected drive letter
622 * FIXME: I make it global, because I don't know how to pass
623 * it properly to the later involved functions.
624 * Feel free to improve (without breaking ;-))
625 */
627 /* We can only mount if we have a device */
628 if (wMountLetter != 0)
629 {
630 /* First of all, we need an image to mount */
631 ZeroMemory(&ImageOpen, sizeof(OPENFILENAMEW));
632
633 ImageOpen.lStructSize = sizeof(ImageOpen);
634 ImageOpen.hwndOwner = NULL;
635 ImageOpen.lpstrFilter = szFilter;
636 ImageOpen.lpstrFile = szFileName;
637 ImageOpen.nMaxFile = MAX_PATH;
639
640 /* Get our filter (only supported images) */
641 szFileName[0] = 0;
642 szFilter[0] = 0;
644 szFilter[(sizeof(szFilter) / sizeof(WCHAR)) - 1] = L'\0';
645
646 /* Get the image name */
647 if (!GetOpenFileName(&ImageOpen))
648 {
649 /* The user canceled... */
650 return;
651 }
652
653 /* Start the mount dialog, so that user can select mount options */
656 NULL,
658 (LPARAM)szFileName);
659 }
660}
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define GetOpenFileName
Definition: commdlg.h:665
#define MAX_PATH
Definition: compat.h:34
#define IDD_MOUNTWINDOW
Definition: resource.h:4
#define IDS_FILTER
Definition: resource.h:37
LPTSTR szFilter
Definition: mplay32.c:30
HWND hwndOwner
Definition: commdlg.h:361
DWORD Flags
Definition: commdlg.h:373
LPWSTR lpstrFile
Definition: commdlg.h:367
DWORD lStructSize
Definition: commdlg.h:360
DWORD nMaxFile
Definition: commdlg.h:368
LPCWSTR lpstrFilter
Definition: commdlg.h:363
WCHAR wMountLetter
static INT_PTR CALLBACK MountDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)

Referenced by HandleCommand().

◆ OpenLetter()

static HANDLE OpenLetter ( WCHAR  Letter)
static

Definition at line 48 of file vcdcontroltool.c.

49{
50 WCHAR Device[255];
51
52 /* Make name */
53 wsprintf(Device, L"\\\\.\\%c:", Letter);
54
55 /* And open */
58}
#define OPEN_EXISTING
Definition: compat.h:775
#define GENERIC_READ
Definition: compat.h:135
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define CreateFile
Definition: winbase.h:3620

Referenced by EjectDrive(), PerformMount(), RefreshDevicesList(), RemountImage(), and RemoveDrive().

◆ OpenMaster()

static HANDLE OpenMaster ( VOID  )
static

Definition at line 39 of file vcdcontroltool.c.

40{
41 /* Just open the device */
42 return CreateFile(L"\\\\.\\\\VirtualCdRom", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
44}

Referenced by AddDrive(), and RefreshDevicesList().

◆ PerformMount()

static VOID PerformMount ( VOID  )
static

Definition at line 425 of file vcdcontroltool.c.

426{
427 HWND hControl;
428 WCHAR szFileName[MAX_PATH];
429 MOUNT_PARAMETERS MountParams;
430 UNICODE_STRING NtPathName;
431 HANDLE hLet;
433 BOOLEAN bPersist, Res;
434 WCHAR szKeyName[256];
435 HKEY hKey;
436
437 /* Zero our input structure */
438 ZeroMemory(&MountParams, sizeof(MOUNT_PARAMETERS));
439
440 /* Do we have to suppress UDF? */
441 hControl = GetDlgItem(hMountWnd, IDC_MOUNTUDF);
442 if (SendMessage(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED)
443 {
444 MountParams.Flags |= MOUNT_FLAG_SUPP_UDF;
445 }
446
447 /* Do we have to suppress Joliet? */
449 if (SendMessage(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED)
450 {
451 MountParams.Flags |= MOUNT_FLAG_SUPP_JOLIET;
452 }
453
454 /* Should the mount be persistent? */
456 bPersist = (SendMessage(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED);
457
458 /* Get the file name */
460 GetWindowText(hControl, szFileName, sizeof(szFileName) / sizeof(WCHAR));
461
462 /* Get NT path for the driver */
463 if (RtlDosPathNameToNtPathName_U(szFileName, &NtPathName, NULL, NULL))
464 {
465 /* Copy it in the parameter structure */
466 wcsncpy(MountParams.Path, NtPathName.Buffer, 255);
467 MountParams.Length = Min(NtPathName.Length, 255 * sizeof(WCHAR));
468 RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathName.Buffer);
469
470 /* Open the device */
471 hLet = OpenLetter(wMountLetter);
472 if (hLet != INVALID_HANDLE_VALUE)
473 {
474 /* And issue the mount IOCTL */
475 Res = DeviceIoControl(hLet, IOCTL_VCDROM_MOUNT_IMAGE, &MountParams, sizeof(MountParams), NULL, 0, &BytesRead, NULL);
476
477 CloseHandle(hLet);
478
479 /* Refresh the list so that our mount appears */
481
482 /* If mount succeed and has to persistent, write it to registry */
483 if (Res && bPersist)
484 {
485 wsprintf(szKeyName, L"SYSTEM\\CurrentControlSet\\Services\\Vcdrom\\Parameters\\Device%c", wMountLetter);
487 {
488 wcsncpy(szKeyName, MountParams.Path, MountParams.Length);
489 szKeyName[MountParams.Length / sizeof(WCHAR)] = 0;
490 RegSetValueExW(hKey, L"IMAGE", 0, REG_SZ, (BYTE *)szKeyName, MountParams.Length);
491
492 szKeyName[0] = wMountLetter;
493 szKeyName[1] = L':';
494 szKeyName[2] = 0;
495 RegSetValueExW(hKey, L"DRIVE", 0, REG_SZ, (BYTE *)szKeyName, 3 * sizeof(WCHAR));
496
498 }
499 }
500 }
501 }
502
504}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define RegCloseKey(hKey)
Definition: registry.h:47
#define Min(a, b)
Definition: cdprocs.h:74
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4900
FxAutoRegKey hKey
#define REG_SZ
Definition: layer.c:22
#define IDC_MOUNTJOLIET
Definition: resource.h:24
#define IDC_MOUNTIMAGE
Definition: resource.h:22
#define IDC_MOUNTPERSIST
Definition: resource.h:25
#define IDC_MOUNTUDF
Definition: resource.h:23
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
Definition: nt_native.h:1018
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_SET_VALUE
Definition: nt_native.h:1017
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
WCHAR Path[255]
Definition: vcdioctl.h:10
#define MOUNT_FLAG_SUPP_UDF
Definition: vcdioctl.h:15
#define MOUNT_FLAG_SUPP_JOLIET
Definition: vcdioctl.h:16
#define IOCTL_VCDROM_MOUNT_IMAGE
Definition: vcdioctl.h:4
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define RegCreateKeyEx
Definition: winreg.h:501
#define GetWindowText
Definition: winuser.h:5788
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1908
unsigned char BYTE
Definition: xxhash.c:193

Referenced by HandleMountCommand().

◆ QueryDriverInfo()

INT_PTR QueryDriverInfo ( HWND  hDlg)

Definition at line 200 of file vcdcontroltool.c.

201{
203 SC_HANDLE hMgr, hSvc;
205 WCHAR szText[2 * MAX_PATH];
206 HWND hControl;
208
209 hDriverWnd = hDlg;
210
211 /* Open service manager */
213 if (hMgr != NULL)
214 {
215 /* Open our service */
217 if (hSvc != NULL)
218 {
219 /* Probe its config size */
220 if (!QueryServiceConfig(hSvc, NULL, 0, &dwSize) &&
222 {
223 /* And get its config */
224 pConfig = HeapAlloc(GetProcessHeap(), 0, dwSize);
225
226 if (QueryServiceConfig(hSvc, pConfig, dwSize, &dwSize))
227 {
228 /* Display name & driver */
229 wsprintf(szText, L"%s:\n(%s)", pConfig->lpDisplayName, pConfig->lpBinaryPathName);
231 SendMessage(hControl, WM_SETTEXT, 0, (LPARAM)szText);
232 }
233
234 HeapFree(GetProcessHeap(), 0, pConfig);
235 }
236
237 /* Get its status */
238 if (QueryServiceStatus(hSvc, &Status))
239 {
240 if (Status.dwCurrentState != SERVICE_RUNNING &&
241 Status.dwCurrentState != SERVICE_START_PENDING)
242 {
244 }
245 else
246 {
248 }
249 }
250
251 CloseServiceHandle(hSvc);
252 }
253
254 CloseServiceHandle(hMgr);
255 }
256
257 /* FIXME: we don't allow uninstall/install */
258 {
260 EnableWindow(hControl, FALSE);
262 EnableWindow(hControl, FALSE);
263 }
264
265 /* Display our sub window */
266 ShowWindow(hDlg, SW_SHOW);
267
268 return TRUE;
269}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
Status
Definition: gdiplustypes.h:25
#define IDC_DRIVERREMOVE
Definition: resource.h:30
#define IDC_DRIVERINFO
Definition: resource.h:31
#define IDC_DRIVERINSTALL
Definition: resource.h:27
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:2793
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
LPWSTR lpBinaryPathName
Definition: winsvc.h:159
VOID SetServiceState(BOOLEAN Started)
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define QueryServiceConfig
Definition: winsvc.h:580
#define SERVICE_QUERY_STATUS
Definition: winsvc.h:55
#define OpenSCManager
Definition: winsvc.h:575
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14
#define SERVICE_START_PENDING
Definition: winsvc.h:22
#define SERVICE_RUNNING
Definition: winsvc.h:24
#define SERVICE_QUERY_CONFIG
Definition: winsvc.h:53
#define OpenService
Definition: winsvc.h:576
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define SW_SHOW
Definition: winuser.h:769

Referenced by DriverDialogProc().

◆ RefreshDevicesList()

static VOID RefreshDevicesList ( WCHAR  Letter)
static

Definition at line 62 of file vcdcontroltool.c.

63{
64 HWND hListView;
65 WCHAR szFormat[50];
66 WCHAR szText[MAX_PATH + 50];
67 WCHAR szImage[MAX_PATH];
68 HANDLE hMaster, hLet;
70 DRIVES_LIST Drives;
71 BOOLEAN Res;
73 LVITEMW lvItem;
74 LRESULT lResult;
75 INT iSelected;
76
77 /* Get our list view */
78 hListView = GetDlgItem(hWnd, IDC_MAINDEVICES);
79
80 /* Purge it */
81 SendMessage(hListView, LVM_DELETEALLITEMS, 0, 0);
82
83 /* Now, query the driver for all the devices */
84 hMaster = OpenMaster();
85 if (hMaster != INVALID_HANDLE_VALUE)
86 {
87 Res = DeviceIoControl(hMaster, IOCTL_VCDROM_ENUMERATE_DRIVES, NULL, 0, &Drives, sizeof(Drives), &BytesRead, NULL);
88 CloseHandle(hMaster);
89
90 if (Res)
91 {
92 /* Loop to add all the devices to the list */
93 iSelected = -1;
94 for (i = 0; i < Drives.Count; ++i)
95 {
96 /* We'll query device one by one */
97 hLet = OpenLetter(Drives.Drives[i]);
98 if (hLet != INVALID_HANDLE_VALUE)
99 {
100 /* Get info about the mounted image */
102 if (Res)
103 {
104 /* First of all, add our driver letter to the list */
105 ZeroMemory(&lvItem, sizeof(LVITEMW));
106 lvItem.mask = LVIF_TEXT;
107 lvItem.pszText = szText;
108 lvItem.iItem = i;
109 szText[0] = Drives.Drives[i];
110 szText[1] = L':';
111 szText[2] = 0;
112
113 /* If it worked, we'll complete with the info about the device:
114 * (mounted? which image?)
115 */
116 lResult = SendMessage(hListView, LVM_INSERTITEM, 0, (LPARAM)&lvItem);
117 if (lResult != -1)
118 {
119 /* If it matches arg, that's the letter to select at the end */
120 if (Drives.Drives[i] == Letter)
121 {
122 iSelected = lResult;
123 }
124
125 /* We'll fill second column with info */
126 lvItem.iSubItem = 1;
127
128 /* Gather the image path */
129 if (Image.Length != 0)
130 {
131 memcpy(szImage, Image.Path, Image.Length);
132 szImage[(Image.Length / sizeof(WCHAR))] = L'\0';
133 }
134
135 /* It's not mounted... */
136 if (Image.Mounted == 0)
137 {
138 /* If we don't have an image, set default text instead */
139 if (Image.Length == 0)
140 {
141 szImage[0] = 0;
142 LoadString(hInstance, IDS_NONE, szImage, sizeof(szImage) / sizeof(WCHAR));
143 szImage[(sizeof(szImage) / sizeof(WCHAR)) - 1] = L'\0';
144 }
145
146 /* Display the last known image */
147 szFormat[0] = 0;
148 LoadString(hInstance, IDS_NOMOUNTED, szFormat, sizeof(szFormat) / sizeof(WCHAR));
149 szFormat[(sizeof(szFormat) / sizeof(WCHAR)) - 1] = L'\0';
150
151 swprintf(szText, szFormat, szImage);
152 lvItem.pszText = szText;
153 }
154 else
155 {
156 /* Mounted, just display the image path */
157 lvItem.pszText = szImage;
158 }
159
160 /* Set text */
161 SendMessage(hListView, LVM_SETITEM, lResult, (LPARAM)&lvItem);
162 }
163 }
164
165 /* Don't leak our device */
166 CloseHandle(hLet);
167 }
168 }
169
170 /* If we had something to select, then just do it */
171 if (iSelected != -1)
172 {
173 ZeroMemory(&lvItem, sizeof(LVITEMW));
174
175 lvItem.mask = LVIF_STATE;
176 lvItem.iItem = iSelected;
179 SendMessage(hListView, LVM_SETITEMSTATE, iSelected, (LPARAM)&lvItem);
180 }
181 }
182 }
183}
#define IDS_NONE
Definition: resource.h:133
#define swprintf
Definition: precomp.h:40
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
Definition: glfuncs.h:248
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IDS_NOMOUNTED
Definition: resource.h:35
#define LVM_DELETEALLITEMS
Definition: commctrl.h:2413
#define LVIF_STATE
Definition: commctrl.h:2312
#define LVM_SETITEMSTATE
Definition: commctrl.h:2672
#define LVM_SETITEM
Definition: commctrl.h:2399
#define LVM_INSERTITEM
Definition: commctrl.h:2406
#define LVIS_SELECTED
Definition: commctrl.h:2319
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVIS_FOCUSED
Definition: commctrl.h:2318
WCHAR Drives[26]
Definition: vcdioctl.h:21
USHORT Count
Definition: vcdioctl.h:20
LPWSTR pszText
Definition: commctrl.h:2365
int iSubItem
Definition: commctrl.h:2362
UINT state
Definition: commctrl.h:2363
UINT mask
Definition: commctrl.h:2360
UINT stateMask
Definition: commctrl.h:2364
#define IOCTL_VCDROM_GET_IMAGE_PATH
Definition: vcdioctl.h:6
#define IOCTL_VCDROM_ENUMERATE_DRIVES
Definition: vcdioctl.h:5
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by AddDrive(), CreateListViewColumns(), EjectDrive(), PerformMount(), RemountImage(), RemoveDrive(), StartDriver(), and StopDriver().

◆ RemountImage()

static VOID RemountImage ( VOID  )
static

Definition at line 664 of file vcdcontroltool.c.

665{
667 HANDLE hLet;
669
670 /* Get the select drive letter */
672 if (Letter != 0)
673 {
674 /* Open it */
675 hLet = OpenLetter(Letter);
676 if (hLet != INVALID_HANDLE_VALUE)
677 {
678 /* And ask the driver for a remount */
680
681 CloseHandle(hLet);
682
683 /* Refresh the list, to display the fact the image is now mounted.
684 * Make sure it's selected as it was previously selected.
685 */
687 }
688 }
689}
#define IOCTL_STORAGE_LOAD_MEDIA
Definition: ntddstor.h:110

Referenced by HandleCommand().

◆ RemoveDrive()

static VOID RemoveDrive ( VOID  )
static

Definition at line 723 of file vcdcontroltool.c.

724{
726 HANDLE hLet;
728
729 /* Get the select drive letter */
731 if (Letter != 0)
732 {
733 /* Open it */
734 hLet = OpenLetter(Letter);
735 if (hLet != INVALID_HANDLE_VALUE)
736 {
737 /* And ask the driver for a deletion */
739
740 CloseHandle(hLet);
741
742 /* Refresh the list, to make the device disappear */
744 }
745 }
746}
#define IOCTL_VCDROM_DELETE_DRIVE
Definition: vcdioctl.h:3

Referenced by HandleCommand().

◆ ResetStats()

static VOID ResetStats ( VOID  )
static

Definition at line 792 of file vcdcontroltool.c.

793{
794 HWND hEditText;
795 static const WCHAR szText[] = { L'0', 0 };
796
797 /* Simply set '0' in all the edittext controls we
798 * manage regarding statistics.
799 */
800 hEditText = GetDlgItem(hWnd, IDC_MAINSECTORS);
801 SendMessage(hEditText, WM_SETTEXT, 0, (LPARAM)szText);
802
803 hEditText = GetDlgItem(hWnd, IDC_MAINSIZE);
804 SendMessage(hEditText, WM_SETTEXT, 0, (LPARAM)szText);
805
806 hEditText = GetDlgItem(hWnd, IDC_MAINFREE);
807 SendMessage(hEditText, WM_SETTEXT, 0, (LPARAM)szText);
808
809 hEditText = GetDlgItem(hWnd, IDC_MAINTOTAL);
810 SendMessage(hEditText, WM_SETTEXT, 0, (LPARAM)szText);
811}

Referenced by CreateListViewColumns(), and HandleNotify().

◆ SetMountFileName()

static INT_PTR SetMountFileName ( HWND  hDlg,
LPARAM  lParam 
)
static

Definition at line 399 of file vcdcontroltool.c.

401{
402 HWND hEditText;
403
404 hMountWnd = hDlg;
405
406 /* Set the file name that was passed when creating dialog */
407 hEditText = GetDlgItem(hMountWnd, IDC_MOUNTIMAGE);
408 SendMessage(hEditText, WM_SETTEXT, 0, lParam);
409
410 /* Show our window */
411 ShowWindow(hDlg, SW_SHOW);
412
413 return TRUE;
414}

Referenced by MountDialogProc().

◆ SetServiceState()

VOID SetServiceState ( BOOLEAN  Started)

Definition at line 186 of file vcdcontroltool.c.

187{
188 HWND hControl;
189
190 /* If started, disable start button */
192 EnableWindow(hControl, !Started);
193
194 /* If started, enable stop button */
196 EnableWindow(hControl, Started);
197}
@ Started
Definition: acpisys.h:14

Referenced by DECLARE_INTERFACE_(), QueryDriverInfo(), StartDriver(), and StopDriver().

◆ StartDriver()

static VOID StartDriver ( VOID  )
static

Definition at line 273 of file vcdcontroltool.c.

274{
275 SC_HANDLE hMgr, hSvc;
276
277 /* Open the SC manager */
279 if (hMgr != NULL)
280 {
281 /* Open the service matching our driver */
282 hSvc = OpenService(hMgr, L"Vcdrom", SERVICE_START);
283 if (hSvc != NULL)
284 {
285 /* Start it */
286 /* FIXME: improve */
287 StartService(hSvc, 0, NULL);
288
289 CloseServiceHandle(hSvc);
290
291 /* Refresh the list in case there were persistent mounts */
293
294 /* Update buttons */
296 }
297
298 CloseServiceHandle(hMgr);
299 }
300}
#define SERVICE_START
Definition: winsvc.h:57
#define StartService
Definition: winsvc.h:585

Referenced by HandleDriverCommand().

◆ StopDriver()

static VOID StopDriver ( VOID  )
static

Definition at line 304 of file vcdcontroltool.c.

305{
306 SC_HANDLE hMgr, hSvc;
308
309 /* Open the SC manager */
311 if (hMgr != NULL)
312 {
313 /* Open the service matching our driver */
314 hSvc = OpenService(hMgr, L"Vcdrom", SERVICE_STOP);
315 if (hSvc != NULL)
316 {
317 /* Stop it */
318 /* FIXME: improve */
320
321 CloseServiceHandle(hSvc);
322
323 /* Refresh the list to clear it */
325
326 /* Update buttons */
328 }
329
330 CloseServiceHandle(hMgr);
331 }
332}
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:622
#define SERVICE_STOP
Definition: winsvc.h:58
#define SERVICE_CONTROL_STOP
Definition: winsvc.h:36

Referenced by HandleDriverCommand(), and UsermodeMethod().

◆ wWinMain()

INT WINAPI wWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPWSTR  lpCmdLine,
int  nShowCmd 
)

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{
955 MSG Msg;
956
958
959 /* Just start our main window */
962 NULL,
964 0);
965 /* And dispatch messages in case of a success */
966 if (hWnd != NULL)
967 {
968 while (GetMessageW(&Msg, NULL, 0, 0) != 0)
969 {
972 }
973 }
974
975 return 0;
976}
HINSTANCE hInst
Definition: dxdiag.c:13
#define IDD_MAINWINDOW
Definition: resource.h:3
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
static INT_PTR CALLBACK MainDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Variable Documentation

◆ hDriverWnd

HWND hDriverWnd

Definition at line 32 of file vcdcontroltool.c.

Referenced by HandleDriverCommand(), QueryDriverInfo(), and SetServiceState().

◆ hInstance

◆ hMountWnd

HWND hMountWnd

Definition at line 31 of file vcdcontroltool.c.

Referenced by HandleMountCommand(), PerformMount(), and SetMountFileName().

◆ hWnd

◆ wMountLetter

WCHAR wMountLetter

Definition at line 35 of file vcdcontroltool.c.

Referenced by MountImage(), and PerformMount().