ReactOS  0.4.14-dev-606-g14ebc0b
vfdguisave.c File Reference
#include <windows.h>
#include <commdlg.h>
#include "vfdtypes.h"
#include "vfdapi.h"
#include "vfdlib.h"
#include "vfdmsg.h"
#include "vfdguirc.h"
Include dependency graph for vfdguisave.c:

Go to the source code of this file.

Macros

#define WIN32_LEAN_AND_MEAN
 

Functions

static INT CALLBACK SaveDialogProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static void OnInit (HWND hDlg, PCSAVE_PARAM pParam)
 
static void OnTarget (HWND hDlg, HWND hEdit)
 
static void OnBrowse (HWND hDlg)
 
static void OnOverwrite (HWND hDlg, HWND hCheck)
 
static void OnTruncate (HWND hDlg, HWND hCheck)
 
static DWORD OnOK (HWND hDlg)
 
DWORD WINAPI VfdGuiSave (HWND hParent, ULONG nDevice)
 
DWORD GuiSaveParam (HWND hParent, PCSAVE_PARAM pParam)
 

Macro Definition Documentation

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 15 of file vfdguisave.c.

Function Documentation

◆ GuiSaveParam()

DWORD GuiSaveParam ( HWND  hParent,
PCSAVE_PARAM  pParam 
)

Definition at line 101 of file vfdguisave.c.

104 {
105  switch (DialogBoxParam(
106  g_hDllModule,
108  hParent,
110  (LPARAM)pParam))
111  {
112  case IDOK:
113  return ERROR_SUCCESS;
114 
115  case IDCANCEL:
116  return ERROR_CANCELLED;
117 
118  default:
119  return GetLastError();
120  }
121 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDOK
Definition: winuser.h:824
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
LONG_PTR LPARAM
Definition: windef.h:208
static INT CALLBACK SaveDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: vfdguisave.c:127
HINSTANCE g_hDllModule
#define DialogBoxParam
Definition: winuser.h:5739
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define IDD_SAVEDIALOG
Definition: vfdguirc.h:7
#define ERROR_CANCELLED
Definition: winerror.h:726
#define IDCANCEL
Definition: winuser.h:825

Referenced by VfdGuiClose(), and VfdGuiSave().

◆ OnBrowse()

void OnBrowse ( HWND  hDlg)
static

Definition at line 393 of file vfdguisave.c.

395 {
397  PSTR title;
398  CHAR file[MAX_PATH];
399  CHAR dir[MAX_PATH];
400  DWORD len;
401 
402  title = ModuleMessage(MSG_SAVE_TITLE);
403 
404  ZeroMemory(&ofn, sizeof(ofn));
405  ZeroMemory(file, sizeof(file));
406  ZeroMemory(dir, sizeof(dir));
407 
408  len = GetDlgItemText(hDlg, IDC_TARGETFILE, file, sizeof(file));
409 
410  if (len && file[len - 1] == '\\') {
411  strcpy(dir, file);
412  ZeroMemory(file, sizeof(file));
413  }
414 
415  // Different structure sizes must be used for NT and 2K/XP
418 
419  ofn.hwndOwner = hDlg;
420  ofn.lpstrFile = file;
421  ofn.nMaxFile = sizeof(file);
423  ofn.lpstrTitle = title ? title : "Save Image";
424  ofn.lpstrFilter = "*.*\0*.*\0";
426 
427  if (GetSaveFileName(&ofn)) {
430  }
431 
432  if (title) {
433  LocalFree(title);
434  }
435 }
PSTR ModuleMessage(DWORD nFormat,...)
Definition: vfdlib.c:124
#define IS_WINDOWS_NT()
Definition: vfdcmd.c:159
HWND hwndOwner
Definition: commdlg.h:330
char CHAR
Definition: xmlstorage.h:175
OPENFILENAME ofn
Definition: main.cpp:37
#define ZeroMemory
Definition: winbase.h:1642
HWND WINAPI SetFocus(_In_opt_ HWND)
DWORD nMaxFile
Definition: commdlg.h:337
#define GetSaveFileName
Definition: commdlg.h:666
unsigned int dir
Definition: maze.c:112
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
#define GetDlgItemText
Definition: winuser.h:5760
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetDlgItemText
Definition: winuser.h:5824
GLenum GLsizei len
Definition: glext.h:6722
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OPENFILENAME_SIZE_VERSION_400
Definition: commdlg.h:402
LPSTR lpstrFile
Definition: commdlg.h:336
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
signed char * PSTR
Definition: retypes.h:7
LPCSTR lpstrFilter
Definition: commdlg.h:332
#define IDC_TARGETFILE
Definition: vfdguirc.h:19
LPCSTR lpstrTitle
Definition: commdlg.h:341
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define OFN_ENABLESIZING
Definition: commdlg.h:101
static char title[]
Definition: ps.c:92
DWORD Flags
Definition: commdlg.h:342
Definition: fci.c:126

Referenced by SaveDialogProc().

◆ OnInit()

void OnInit ( HWND  hDlg,
PCSAVE_PARAM  pParam 
)
static

Definition at line 192 of file vfdguisave.c.

195 {
196  // Store parameters
197 
198  SetWindowLongPtr(hDlg, GWLP_USERDATA, (ULONG_PTR)pParam);
199 
200  // clear the target existence flag
201 
202  SetWindowLong(hDlg, DWL_USER, 0);
203 
204  // Set dialog window title
205 
206  SetControlText(hDlg, 0, MSG_SAVE_TITLE);
207 
208  // Set control captions
209 
210  SetControlText(hDlg, IDC_IMAGEFILE_LABEL, MSG_IMAGEFILE_LABEL);
211  SetControlText(hDlg, IDC_DISKTYPE_LABEL, MSG_DISKTYPE_LABEL);
212  SetControlText(hDlg, IDC_MEDIATYPE_LABEL, MSG_MEDIATYPE_LABEL);
213  SetControlText(hDlg, IDC_TARGETFILE_LABEL, MSG_TARGETFILE_LABEL);
214  SetControlText(hDlg, IDC_IMAGEDESC_LABEL, MSG_DESCRIPTION_LABEL);
215  SetControlText(hDlg, IDC_BROWSE, MSG_BROWSE_BUTTON);
216  SetControlText(hDlg, IDC_OVERWRITE, MSG_OVERWRITE_CHECK);
217  SetControlText(hDlg, IDC_TRUNCATE, MSG_TRUNCATE_CHECK);
218  SetControlText(hDlg, IDOK, MSG_SAVE_BUTTON);
219  SetControlText(hDlg, IDCANCEL, MSG_CANCEL_BUTTON);
220 
221  // set disk type
222 
223  if (pParam->DiskType == VFD_DISKTYPE_FILE) {
224  SetDlgItemText(hDlg, IDC_DISKTYPE, "FILE");
225  }
226  else {
227  SetDlgItemText(hDlg, IDC_DISKTYPE, "RAM");
228  }
229 
230  // display media type
231 
233  VfdMediaTypeName(pParam->MediaType));
234 
235  // set current image and initial target
236 
237  if (pParam->ImageName[0]) {
238  SetDlgItemText(hDlg, IDC_IMAGEFILE, pParam->ImageName);
239  SetDlgItemText(hDlg, IDC_TARGETFILE, pParam->ImageName);
240  }
241  else if (pParam->DiskType != VFD_DISKTYPE_FILE) {
242  SetDlgItemText(hDlg, IDC_IMAGEFILE, "<RAM>");
243  OnTarget(hDlg, GetDlgItem(hDlg, IDC_TARGETFILE));
244  }
245 }
VFD_MEDIA MediaType
Definition: vfdlib.h:94
#define IDOK
Definition: winuser.h:824
#define IDC_DISKTYPE_LABEL
Definition: vfdguirc.h:20
#define IDC_BROWSE
Definition: resource.h:21
#define IDC_MEDIATYPE_LABEL
Definition: vfdguirc.h:24
#define SetWindowLong
Definition: winuser.h:5828
#define SetWindowLongPtr
Definition: treelist.c:70
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define DWL_USER
Definition: winuser.h:861
#define IDC_IMAGEFILE
Definition: vfdguirc.h:14
#define GWLP_USERDATA
Definition: treelist.c:63
static void OnTarget(HWND hDlg, HWND hEdit)
Definition: vfdguisave.c:250
PSTR ImageName
Definition: vfdlib.h:98
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_MEDIATYPE
Definition: vfdguirc.h:25
#define IDC_IMAGEFILE_LABEL
Definition: vfdguirc.h:13
#define SetDlgItemText
Definition: winuser.h:5824
PCSTR WINAPI VfdMediaTypeName(VFD_MEDIA nMediaType)
Definition: vfdctl.c:3280
#define IDC_TRUNCATE
Definition: vfdguirc.h:35
#define IDC_TARGETFILE_LABEL
Definition: vfdguirc.h:18
#define IDC_DISKTYPE
Definition: vfdguirc.h:21
#define IDC_TARGETFILE
Definition: vfdguirc.h:19
#define IDC_OVERWRITE
Definition: vfdguirc.h:34
VFD_DISKTYPE DiskType
Definition: vfdlib.h:93
#define IDCANCEL
Definition: winuser.h:825
#define IDC_IMAGEDESC_LABEL
Definition: vfdguirc.h:15
void SetControlText(HWND hWnd, UINT nCtrl, DWORD nMsg)
Definition: vfdguiut.c:350

Referenced by SaveDialogProc().

◆ OnOK()

DWORD OnOK ( HWND  hDlg)
static

Definition at line 463 of file vfdguisave.c.

465 {
467  CHAR path[MAX_PATH];
468  BOOL overwrite;
469  BOOL truncate;
470  DWORD ret;
471 
473 
474  if (!param) {
475  return ERROR_INVALID_FUNCTION;
476  }
477 
478  // get the target image name
479 
480  if (GetDlgItemText(hDlg, IDC_TARGETFILE, path, sizeof(path)) == 0) {
481  return ERROR_INVALID_FUNCTION;
482  }
483 
484  if (GetWindowLong(hDlg, DWL_USER)) {
485  // the target file exists and overwritable
486  overwrite = (IsDlgButtonChecked(hDlg, IDC_OVERWRITE) == BST_CHECKED);
487  truncate = (IsDlgButtonChecked(hDlg, IDC_TRUNCATE) == BST_CHECKED);
488  }
489  else {
490  overwrite = FALSE;
491  truncate = TRUE;
492  }
493 
494 retry:
495  ret = VfdDismountVolume(param->hDevice, FALSE);
496 
497  if (ret == ERROR_ACCESS_DENIED) {
498  PSTR msg = ModuleMessage(MSG_UNMOUNT_CONFIRM);
499 
500  int reply = MessageBox(
501  hDlg, msg ? msg : "retry", VFD_MSGBOX_TITLE,
503 
504  if (msg) {
505  LocalFree(msg);
506  }
507 
508  if (reply == IDRETRY) {
509  goto retry;
510  }
511  else if (reply == IDCANCEL) {
512  return ERROR_CANCELLED;
513  }
514  else {
515  VfdDismountVolume(param->hDevice, TRUE);
516  }
517  }
518  else if (ret != ERROR_SUCCESS) {
519 
522 
523  return ret;
524  }
525 
526  ret = VfdSaveImage(param->hDevice, path, overwrite, truncate);
527 
528  if (ret != ERROR_SUCCESS) {
529 
530  // show error message
531 
534  }
535 
536  return ret;
537 }
PSTR ModuleMessage(DWORD nFormat,...)
Definition: vfdlib.c:124
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define VFD_MSGBOX_TITLE
Definition: vfdlib.h:53
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
char CHAR
Definition: xmlstorage.h:175
const SAVE_PARAM * PCSAVE_PARAM
Definition: vfdlib.h:101
#define MB_ICONSTOP
Definition: winuser.h:797
DWORD WINAPI VfdDismountVolume(HANDLE hDevice, BOOL bForce)
Definition: vfdctl.c:2629
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
#define DWL_USER
Definition: winuser.h:861
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GWLP_USERDATA
Definition: treelist.c:63
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define GetDlgItemText
Definition: winuser.h:5760
PCSTR SystemMessage(DWORD nError)
Definition: vfdlib.c:147
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDRETRY
Definition: winuser.h:827
#define IDC_TRUNCATE
Definition: vfdguirc.h:35
int ret
#define GetWindowLong
Definition: winuser.h:5771
#define MessageBox
Definition: winuser.h:5797
#define ERROR_CANCELLED
Definition: winerror.h:726
DWORD WINAPI VfdSaveImage(HANDLE hDevice, PCSTR sFileName, BOOL bOverWrite, BOOL bTruncate)
Definition: vfdctl.c:2685
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
signed char * PSTR
Definition: retypes.h:7
#define IDC_TARGETFILE
Definition: vfdguirc.h:19
#define BST_CHECKED
Definition: winuser.h:197
#define MB_CANCELTRYCONTINUE
Definition: vfdguiut.c:34
#define msg(x)
Definition: auth_time.c:54
#define IDC_OVERWRITE
Definition: vfdguirc.h:34
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825

Referenced by SaveDialogProc().

◆ OnOverwrite()

void OnOverwrite ( HWND  hDlg,
HWND  hCheck 
)
static

Definition at line 437 of file vfdguisave.c.

440 {
441  if (GetWindowLong(hDlg, DWL_USER)) {
442  // the target file exists and overwritable
443  if (SendMessage(hCheck, BM_GETCHECK, 0, 0) != BST_CHECKED) {
445  }
446  else {
447  EnableWindow(GetDlgItem(hDlg, IDOK), TRUE);
448  }
449  }
450 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define DWL_USER
Definition: winuser.h:861
#define BM_GETCHECK
Definition: winuser.h:1900
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define GetWindowLong
Definition: winuser.h:5771
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define BST_CHECKED
Definition: winuser.h:197
#define SendMessage
Definition: winuser.h:5818

Referenced by SaveDialogProc().

◆ OnTarget()

void OnTarget ( HWND  hDlg,
HWND  hEdit 
)
static

Definition at line 250 of file vfdguisave.c.

253 {
255  CHAR buf[MAX_PATH];
258  DWORD file_attr;
259  DWORD ret;
260 
261  // clear the target existence flag
262 
263  SetWindowLong(hDlg, DWL_USER, 0);
264 
265  // clear the description and hint text
266 
269 
270  // get the target file name
271 
272  if (GetWindowText(hEdit, buf, sizeof(buf)) == 0) {
273 
274  // target file is blank
275 
279 
280  return;
281  }
282  else {
283  CHAR full[MAX_PATH];
284  PSTR file;
285 
286  // convert into a full path
287 
288  if (GetFullPathName(buf, sizeof(full), full, &file)) {
289  strcpy(buf, full);
290  }
291  }
292 
293  //
294  // get the current image info
295  //
297 
298  if (_stricmp(param->ImageName, buf) == 0) {
299 
300  // target is the current file
301 
302  char desc[MAX_PATH];
303 
304  VfdMakeFileDesc(desc, sizeof(desc),
305  param->FileType, param->ImageSize,
306  GetFileAttributes(param->ImageName));
307 
309  SetControlText(hDlg, IDC_IMAGEFILE_HINT, MSG_CURRENT_FILE);
310 
311  if (param->DiskType == VFD_DISKTYPE_FILE) {
312 
313  // cannot overwrite the current FILE disk image
314 
318  return;
319  }
320  }
321 
322  //
323  // check target image file
324  //
326  buf, &file_attr, &file_type, &file_size);
327 
328  if (ret == ERROR_FILE_NOT_FOUND) {
329  // file does not exist
330  SetControlText(hDlg, IDC_IMAGEFILE_DESC, MSG_DESC_NEW_FILE);
333  EnableWindow(GetDlgItem(hDlg, IDOK), TRUE);
334  return;
335  }
336  else if (ret != ERROR_SUCCESS) {
341  return;
342  }
343 
344  // set target file description
345 
346  VfdMakeFileDesc(buf, sizeof(buf),
347  file_type, file_size, file_attr);
348 
350 
351  // check target file type
352 
353  if (file_type == VFD_FILETYPE_ZIP) {
354  SetControlText(hDlg, IDC_IMAGEFILE_HINT, MSG_TARGET_IS_ZIP);
358  return;
359  }
360 
361  // the target is an existing raw file
362 
364 
365  // set truncate box
366 
367  if (file_size > VfdGetMediaSize(param->MediaType)) {
369  SetControlText(hDlg, IDC_IMAGEFILE_HINT, MSG_SIZE_MISMATCH);
370  }
371  else {
373  }
374 
375  // check overwrite setting
376 
379  }
380  else {
381  EnableWindow(GetDlgItem(hDlg, IDOK), TRUE);
382  }
383 
384  // target file exists and overwritable
385 
386  SetWindowLong(hDlg, DWL_USER, 1);
387 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
char CHAR
Definition: xmlstorage.h:175
const SAVE_PARAM * PCSAVE_PARAM
Definition: vfdlib.h:101
#define SetWindowLong
Definition: winuser.h:5828
ULONG WINAPI VfdGetMediaSize(VFD_MEDIA nMediaType)
Definition: vfdctl.c:3272
#define _stricmp
Definition: cat.c:22
#define GetWindowText
Definition: winuser.h:5773
#define DWL_USER
Definition: winuser.h:861
static const WCHAR desc[]
Definition: protectdata.c:36
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
PCSTR SystemMessage(DWORD nError)
Definition: vfdlib.c:147
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:26
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
FD_TYPE file_type(FDSC **curr, char *fixed)
Definition: file.c:221
#define SetDlgItemText
Definition: winuser.h:5824
#define IDC_TRUNCATE
Definition: vfdguirc.h:35
int ret
UCHAR VFD_FILETYPE
Definition: vfdtypes.h:62
#define IDC_IMAGEFILE_HINT
Definition: vfdguirc.h:17
#define GetFullPathName
Definition: winbase.h:3655
static HWND hEdit
Definition: autocomplete.c:34
#define IDC_IMAGEFILE_DESC
Definition: vfdguirc.h:16
#define GetFileAttributes
Definition: winbase.h:3649
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
signed char * PSTR
Definition: retypes.h:7
DWORD WINAPI VfdCheckImageFile(PCSTR sFileName, PDWORD pAttributes, PVFD_FILETYPE pFileType, PULONG pImageSize)
Definition: vfdctl.c:3035
#define BST_CHECKED
Definition: winuser.h:197
#define IDC_OVERWRITE
Definition: vfdguirc.h:34
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1
void WINAPI VfdMakeFileDesc(PSTR pBuffer, ULONG nBufSize, VFD_FILETYPE nFileType, ULONG nFileSize, DWORD nFileAttr)
Definition: vfdguiut.c:376
#define GetWindowLongPtr
Definition: treelist.c:73
void SetControlText(HWND hWnd, UINT nCtrl, DWORD nMsg)
Definition: vfdguiut.c:350
#define file_size(inode)
Definition: reiserfs_fs.h:1869
Definition: fci.c:126

Referenced by OnInit(), and SaveDialogProc().

◆ OnTruncate()

void OnTruncate ( HWND  hDlg,
HWND  hCheck 
)
static

Definition at line 452 of file vfdguisave.c.

455 {
457  UNREFERENCED_PARAMETER(hCheck);
458 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323

Referenced by SaveDialogProc().

◆ SaveDialogProc()

INT CALLBACK SaveDialogProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 127 of file vfdguisave.c.

135 {
136  switch (uMsg) {
137  case WM_INITDIALOG:
138  OnInit(hDlg, (PCSAVE_PARAM)lParam);
139  return TRUE;
140 
141  case WM_COMMAND:
142  switch (wParam) {
144  OnTarget(hDlg, (HWND)lParam);
145  return TRUE;
146 
147  case IDC_BROWSE:
148  OnBrowse(hDlg);
149  return TRUE;
150 
151  case IDC_OVERWRITE:
152  OnOverwrite(hDlg, (HWND)lParam);
153  return TRUE;
154 
155  case IDC_TRUNCATE:
156  OnTruncate(hDlg, (HWND)lParam);
157  return TRUE;
158 
159  case IDOK:
160  if (OnOK(hDlg) == ERROR_SUCCESS) {
161  EndDialog(hDlg, IDOK);
162  }
163  return TRUE;
164 
165  case IDCANCEL:
166  EndDialog(hDlg, IDCANCEL);
167  return TRUE;
168  }
169  break;
170 
171  case WM_CONTEXTMENU:
173  break;
174 
175  case WM_HELP:
176  {
178 
179  if (info->iContextType == HELPINFO_WINDOW) {
180  ShowHelpWindow(hDlg, info->iCtrlId);
181  }
182  }
183  return TRUE;
184  }
185 
186  return FALSE;
187 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define IDC_BROWSE
Definition: resource.h:21
static void OnBrowse(HWND hDlg)
Definition: vfdguisave.c:393
void ShowContextMenu(HWND hDlg, HWND hCtl, LPARAM lParam)
Definition: vfdguiut.c:456
void ShowHelpWindow(HWND hDlg, UINT nCtl)
Definition: vfdguiut.c:507
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
struct tagHELPINFO * LPHELPINFO
#define MAKELONG(a, b)
Definition: typedefs.h:248
static void OnTarget(HWND hDlg, HWND hEdit)
Definition: vfdguisave.c:250
#define IDC_TRUNCATE
Definition: vfdguirc.h:35
#define WM_COMMAND
Definition: winuser.h:1722
static void OnOverwrite(HWND hDlg, HWND hCheck)
Definition: vfdguisave.c:437
#define IDC_TARGETFILE
Definition: vfdguirc.h:19
#define IDC_OVERWRITE
Definition: vfdguirc.h:34
#define IDCANCEL
Definition: winuser.h:825
#define HELPINFO_WINDOW
Definition: winuser.h:1158
static void OnInit(HWND hDlg, PCSAVE_PARAM pParam)
Definition: vfdguisave.c:192
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
static DWORD OnOK(HWND hDlg)
Definition: vfdguisave.c:463
static void OnTruncate(HWND hDlg, HWND hCheck)
Definition: vfdguisave.c:452
#define EN_CHANGE
Definition: winuser.h:2004

Referenced by GuiSaveParam().

◆ VfdGuiSave()

DWORD WINAPI VfdGuiSave ( HWND  hParent,
ULONG  nDevice 
)

Definition at line 58 of file vfdguisave.c.

61 {
64  DWORD ret;
65 
66  // open the source device
67 
68  param.hDevice = VfdOpenDevice(nDevice);
69 
70  if (param.hDevice == INVALID_HANDLE_VALUE) {
71  return GetLastError();
72  }
73 
74  // get current image information
75 
76  param.ImageName = path;
77 
79  param.hDevice,
80  param.ImageName,
81  &param.DiskType,
82  &param.MediaType,
83  &param.MediaFlags,
84  &param.FileType,
85  &param.ImageSize);
86 
87  if (ret == ERROR_SUCCESS) {
88 
89  // show dialog box
90 
92  }
93 
94  // close the source device
95 
96  CloseHandle(param.hDevice);
97 
98  return ret;
99 }
#define CloseHandle
Definition: compat.h:406
#define ERROR_SUCCESS
Definition: deptool.c:10
GLsizei const GLchar ** path
Definition: glext.h:7234
char CHAR
Definition: xmlstorage.h:175
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD GuiSaveParam(HWND hParent, PCSAVE_PARAM pParam)
Definition: vfdguisave.c:101
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
HANDLE WINAPI VfdOpenDevice(ULONG nTarget)
Definition: vfdctl.c:1215
DWORD WINAPI VfdGetImageInfo(HANDLE hDevice, PSTR sFileName, PVFD_DISKTYPE pDiskType, PVFD_MEDIA pMediaType, PVFD_FLAGS pMediaFlags, PVFD_FILETYPE pFileType, PULONG pImageSize)
Definition: vfdctl.c:1839

Referenced by CVfdShExt::DoVfdSave().