ReactOS 0.4.15-dev-5666-gc548b97
vfdlib.h
Go to the documentation of this file.
1/*
2 vfdlib.h
3
4 Virtual Floppy Drive for Windows
5 Driver control library local header
6
7 Copyright (C) 2003-2005 Ken Kato
8*/
9
10#ifndef _VFDLIB_H_
11#define _VFDLIB_H_
12
13#ifdef __REACTOS__
14#define DWL_USER DWLP_USER
15#endif
16
17#define VFD_LIBRARY_FILENAME "vfd.dll"
18
19#ifdef VFD_EMBED_DRIVER
20#define VFD_DRIVER_NAME_ID VFD_DRIVER
21#define VFD_DRIVER_TYPE_ID BINARY
22#endif
23
24#ifndef RC_INVOKED
25
26#ifdef __cplusplus
27extern "C" {
28#endif // __cplusplus
29
30//
31// DLL instance handle
32//
34
35//
36// Reference count for the DLL
37//
38extern UINT g_cDllRefCnt;
39
40//
41// VFD notification message value
42//
43extern UINT g_nNotifyMsg;
44
45//
46// VFD notification message register string
47//
48#define VFD_NOTIFY_MESSAGE "VfdNotifyMessage"
49
50//
51// Message box title string
52//
53#define VFD_MSGBOX_TITLE "Virtual Floppy Drive"
54
55//
56// shell extention string constants
57//
58#define VFDEXT_DESCRIPTION "VFD shell extension"
59#define VFDEXT_MENU_REGKEY "Drive\\shellex\\ContextMenuHandlers\\VFD"
60#define VFDEXT_DND_REGKEY "Drive\\shellex\\DragDropHandlers\\VFD"
61#define VFDEXT_PROP_REGKEY "Drive\\shellex\\PropertySheetHandlers\\VFD"
62#define VFDEXT_INFO_REGKEY "Drive\\shellex\\{00021500-0000-0000-C000-000000000046}"
63
64//=====================================
65// Image handling functions
66//=====================================
67
68// Format a buffer with FAT12
69
72 ULONG nSectors);
73
74// Extract image information from a zip compressed file
75
78 ULONG *pSize);
79
80// Extract original image from a zip compressed file
81
85 PULONG pLength);
86
87//=====================================
88// GUI utility functions
89//=====================================
90
91typedef struct _SAVE_PARAM {
100
102
104 HWND hParent,
105 PCSAVE_PARAM pParam);
106
107void ShowContextMenu(
108 HWND hDlg,
109 HWND hCtl,
110 LPARAM lParam);
111
112void ShowHelpWindow(
113 HWND hDlg,
114 UINT nCtl);
115
116//
117// Set a message to a control window
118//
119void SetControlText(
120 HWND hWnd,
121 UINT nCtrl,
122 DWORD nMsg);
123
124//==============================
125// Message extract functions
126//==============================
127
128// Return a system error message
129
131 DWORD nError);
132
133// Return a message from this DLL module
134
136 DWORD nFormat, ...);
137
138//==============================
139// utility macros
140//==============================
141
142#define IS_WINDOWS_NT() ((GetVersion() & 0xff) < 5)
143
144//==============================
145// Debug functions
146//==============================
147
148#ifdef _DEBUG
149extern ULONG TraceFlags;
150#ifndef __REACTOS__
151extern PCHAR TraceFile;
152#else
153extern CHAR const * TraceFile;
154#endif
155extern ULONG TraceLine;
156
157#define VFDTRACE(LEVEL,STRING) \
158 if ((TraceFlags & (LEVEL)) == (LEVEL)) { \
159 TraceFile = __FILE__; \
160 TraceLine = __LINE__; \
161 DebugTrace STRING; \
162 }
163
164void DebugTrace(PCSTR sFormat, ...);
165
166#else // _DEBUG
167#define VFDTRACE(LEVEL,STRING)
168#endif // _DEBUG
169
170//
171// supplement old system headers
172//
173#ifndef INVALID_FILE_ATTRIBUTES
174#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
175#endif // INVALID_FILE_ATTRIBUTES
176
177#if defined(_INC_COMMDLG) && !defined(OPENFILENAME_SIZE_VERSION_400)
178// Pre Win2K system header is used
179// OPENFILENAME is defined without extra fields.
180#define OPENFILENAME_SIZE_VERSION_400 sizeof(OPENFILENAME)
181#endif // __INC_COMMDLG && !OPENFILENAME_SIZE_VERSION_400
182
183#ifdef __cplusplus
184}
185#endif // __cplusplus
186
187#endif // RC_INVOKED
188
189#endif // _VFDLIB_H_
HWND hWnd
Definition: settings.c:17
LPARAM lParam
Definition: combotst.c:139
#define DebugTrace(INDENT, LEVEL, X, Y)
Definition: fatdata.h:313
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned int * PULONG
Definition: retypes.h:1
signed char * PSTR
Definition: retypes.h:7
signed char * PCHAR
Definition: retypes.h:7
unsigned char * PUCHAR
Definition: retypes.h:3
unsigned int ULONG
Definition: retypes.h:1
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
PVOID pBuffer
VFD_FILETYPE FileType
Definition: vfdlib.h:96
HANDLE hDevice
Definition: vfdlib.h:92
ULONG ImageSize
Definition: vfdlib.h:97
VFD_FLAGS MediaFlags
Definition: vfdlib.h:95
PSTR ImageName
Definition: vfdlib.h:98
VFD_DISKTYPE DiskType
Definition: vfdlib.h:93
VFD_MEDIA MediaType
Definition: vfdlib.h:94
const char * PCSTR
Definition: typedefs.h:52
UINT g_cDllRefCnt
PSTR ModuleMessage(DWORD nFormat,...)
Definition: vfdlib.c:124
HINSTANCE g_hDllModule
DWORD ExtractZipImage(HANDLE hFile, PUCHAR *pBuffer, PULONG pLength)
Definition: vfdzip.c:182
void ShowHelpWindow(HWND hDlg, UINT nCtl)
Definition: vfdguiut.c:507
struct _SAVE_PARAM PSAVE_PARAM
const SAVE_PARAM * PCSAVE_PARAM
Definition: vfdlib.h:101
void SetControlText(HWND hWnd, UINT nCtrl, DWORD nMsg)
Definition: vfdguiut.c:350
DWORD FormatBufferFat(PUCHAR pBuffer, ULONG nSectors)
Definition: vfdfat.c:116
DWORD ExtractZipInfo(HANDLE hFile, ULONG *pSize)
Definition: vfdzip.c:133
PCSTR SystemMessage(DWORD nError)
Definition: vfdlib.c:147
DWORD GuiSaveParam(HWND hParent, PCSAVE_PARAM pParam)
Definition: vfdguisave.c:101
UINT g_nNotifyMsg
const SAVE_PARAM CSAVE_PARAM
Definition: vfdlib.h:101
void ShowContextMenu(HWND hDlg, HWND hCtl, LPARAM lParam)
Definition: vfdguiut.c:456
struct _SAVE_PARAM SAVE_PARAM
UCHAR VFD_FILETYPE
Definition: vfdtypes.h:62
UCHAR VFD_MEDIA
Definition: vfdtypes.h:61
UCHAR VFD_DISKTYPE
Definition: vfdtypes.h:60
UCHAR VFD_FLAGS
Definition: vfdtypes.h:63
LONG_PTR LPARAM
Definition: windef.h:208
char CHAR
Definition: xmlstorage.h:175