ReactOS  0.4.14-dev-384-g5b37caa
vfdapi.h
Go to the documentation of this file.
1 /*
2  vfdapi.h
3 
4  Virtual Floppy Drive for Windows
5  Driver control library API header
6 
7  Copyright (C) 2003-2008 Ken Kato
8 */
9 
10 #ifndef _VFDAPI_H_
11 #define _VFDAPI_H_
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif // __cplusplus
16 
17 //
18 // custom SERVICE STATE value returned by VfdGetDriverState
19 //
20 #define VFD_NOT_INSTALLED 0xffffffff
21 
22 //
23 // VFD operation code for VFD notification message
24 //
25 typedef enum _VFD_OPERATION {
26  VFD_OPERATION_NONE, // No operation
27  VFD_OPERATION_INSTALL, // The driver was installed
28  VFD_OPERATION_CONFIG, // The driver config was changed
29  VFD_OPERATION_REMOVE, // The driver was removed
30  VFD_OPERATION_START, // The driver was started
31  VFD_OPERATION_STOP, // The driver was stopped
32  VFD_OPERATION_OPEN, // An image was opened
33  VFD_OPERATION_SAVE, // An image was saved
34  VFD_OPERATION_CLOSE, // An image was closed
35  VFD_OPERATION_SETLINK, // A drive letter was created
36  VFD_OPERATION_DELLINK, // A drive letter was removed
37  VFD_OPERATION_PROTECT, // Write protect state was changed
38  VFD_OPERATION_SHELL, // Shell extension was installed/removed
39  VFD_OPERATION_MAX // Maximum value place holder
41 
42 //==============================
43 // Driver management functions
44 //==============================
45 
46 // Install the driver
47 
49  PCSTR sFileName,
50  DWORD nStart);
51 
52 // Uninstall the driver
53 
55 
56 // Configure the driver
57 
59  DWORD nStart);
60 
61 // Start the driver
62 
64  PDWORD pState);
65 
66 // Stop the driver
67 
69  PDWORD pState);
70 
71 // Get current driver config information
72 
74  PSTR sFileName,
75  PDWORD pStart);
76 
77 // Get current driver state
78 
80  PDWORD pState);
81 
82 //==============================
83 // Device control functions
84 //==============================
85 
86 // Open a VFD device
87 
89  ULONG nTarget);
90 
91 // Get the device number
92 
94  HANDLE hDevice,
95  PULONG pNumber);
96 
97 // Get the device name
98 
100  HANDLE hDevice,
101  PCHAR pName,
102  ULONG nLength);
103 
104 // Get the driver version
105 
107  HANDLE hDevice,
108  PULONG pVersion);
109 
110 //==============================
111 // image functions
112 //==============================
113 
114 // Open a virtual floppy image
115 
117  HANDLE hDevice,
118  PCSTR sFileName,
119  VFD_DISKTYPE nDiskType,
120  VFD_MEDIA nMediaType,
121  VFD_FLAGS nMediaFlags);
122 
123 // Close the current virtual floppy image
124 
126  HANDLE hDevice,
127  BOOL bForce);
128 
129 // Get the current image information
130 
132  HANDLE hDevice,
133  PSTR sFileName,
134  PVFD_DISKTYPE pDiskType,
135  PVFD_MEDIA pMediaType,
136  PVFD_FLAGS pMediaFlags,
137  PVFD_FILETYPE pFileType,
138  PULONG pImageSize);
139 
140 // Save the current image into a file
141 
143  HANDLE hDevice,
144  PCSTR sFileName,
145  BOOL bOverWrite,
146  BOOL bTruncate);
147 
148 // Format the current virtual media
149 
151  HANDLE hDevice);
152 
153 // Get the current media state (opened / write protected)
154 
156  HANDLE hDevice);
157 
158 // Set write protect state
159 
161  HANDLE hDevice,
162  BOOL bProtect);
163 
164 // Dismount the volume (should be called before Save, Format)
165 
167  HANDLE hDevice,
168  BOOL bForce);
169 
170 //==============================
171 // Drive letter functions
172 //==============================
173 
174 // Assign or remove a persistent drive letter
175 
177  HANDLE hDevice,
178  CHAR cLetter);
179 
180 // Get the current persistent drive letter
181 
183  HANDLE hDevice,
184  PCHAR pLetter);
185 
186 // Assign or remove an ephemeral drive letter
187 
189  HANDLE hDevice,
190  CHAR cLetter);
191 
192 // Get the first ephemeral drive letter
193 
195  HANDLE hDevice,
196  PCHAR pLetter);
197 
198 // Choose the first available drive letter
199 
201 
202 //==============================
203 // utility functions
204 //==============================
205 
206 // Check running platform
207 
209 
210 // Get VFD notification message value
211 
213 
214 // Check if specified file is a valid VFD driver
215 
217  PCSTR sFileName,
218  PULONG pFileVersion);
219 
220 // Check if specified path is a valid image file
221 
223  PCSTR sFileName,
224  PDWORD pAttributes,
225  PVFD_FILETYPE pFileType,
226  PULONG pImageSize);
227 
228 // Create a formatted new image file
229 
231  PCSTR sFileName,
232  VFD_MEDIA nMediaType,
233  VFD_FILETYPE nFileType,
234  BOOL bOverWrite);
235 
236 // Lookup the largest media to fit in a size
237 
239  ULONG nSize);
240 
241 // Get media size (in bytes) of a media type
242 
244  VFD_MEDIA nMediaType);
245 
246 // Get media type name
247 
249  VFD_MEDIA nMediaType);
250 
251 // Make a file description text
252 
254  PSTR pBuffer,
255  ULONG nBufSize,
256  VFD_FILETYPE nFileType,
257  ULONG nFileSize,
258  DWORD nFileAttr);
259 
260 //==============================
261 // Shell Extension functions
262 //==============================
263 
264 // install the shell extension
265 
267 
268 // uninstall the shell extension
269 
271 
272 // check if the shell extension is installed
273 
275 
276 //==============================
277 // GUI utility functions
278 //==============================
279 
280 // open an existing image file
281 
283  HWND hParent, // parent window
284  ULONG nDevice); // device number
285 
286 // Save the current image
287 
289  HWND hParent, // parent window
290  ULONG nDevice); // device number
291 
292 // close the current image
293 
295  HWND hParent, // parent window
296  ULONG nDevice); // device number
297 
298 // format the current media
299 
301  HWND hParent, // parent window
302  ULONG nDevice); // device number
303 
304 // display a tooltip window
305 
306 void WINAPI VfdToolTip(
307  HWND hParent, // parent window
308  PCSTR sText, // tooltip text
309  int pos_x, // position x
310  int pos_y, // position y
311  BOOL stick); // stick (remain until losing the focus) or
312  // non-stick (remain until the mouse leaves)
313 
314 // Show image information tooltip
315 
316 void WINAPI VfdImageTip(
317  HWND hParent,
318  ULONG nDevice);
319 
320 #ifdef __cplusplus
321 }
322 #endif // __cplusplus
323 
324 #endif // _VFDAPI_H_
signed char * PCHAR
Definition: retypes.h:7
DWORD WINAPI VfdGetDriverVersion(HANDLE hDevice, PULONG pVersion)
Definition: vfdctl.c:2446
UCHAR VFD_DISKTYPE
Definition: vfdtypes.h:60
DWORD WINAPI VfdGuiFormat(HWND hParent, ULONG nDevice)
Definition: vfdguiut.c:262
char CHAR
Definition: xmlstorage.h:175
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2031
_In_ DWORD nLength
Definition: wincon.h:461
DWORD WINAPI VfdCheckHandlers()
Definition: vfdshutil.cpp:393
UCHAR VFD_FLAGS
Definition: vfdtypes.h:63
ULONG WINAPI VfdGetMediaSize(VFD_MEDIA nMediaType)
Definition: vfdctl.c:3272
DWORD WINAPI VfdCreateImageFile(PCSTR sFileName, VFD_MEDIA nMediaType, VFD_FILETYPE nFileType, BOOL bOverWrite)
Definition: vfdctl.c:3126
DWORD WINAPI VfdDismountVolume(HANDLE hDevice, BOOL bForce)
Definition: vfdctl.c:2629
DWORD WINAPI VfdStartDriver(PDWORD pState)
Definition: vfdctl.c:647
DWORD WINAPI VfdGetDeviceNumber(HANDLE hDevice, PULONG pNumber)
Definition: vfdctl.c:2359
UINT WINAPI VfdGetNotifyMessage()
Definition: vfdlib.c:115
DWORD WINAPI VfdConfigDriver(DWORD nStart)
Definition: vfdctl.c:468
DWORD WINAPI VfdGetDriverConfig(PSTR sFileName, PDWORD pStart)
Definition: vfdctl.c:959
DWORD WINAPI VfdGetLocalLink(HANDLE hDevice, PCHAR pLetter)
Definition: vfdctl.c:2281
unsigned int BOOL
Definition: ntddk_ex.h:94
VFD_MEDIA WINAPI VfdLookupMedia(ULONG nSize)
Definition: vfdctl.c:3256
DWORD WINAPI VfdWriteProtect(HANDLE hDevice, BOOL bProtect)
Definition: vfdctl.c:2484
DWORD WINAPI VfdGuiSave(HWND hParent, ULONG nDevice)
Definition: vfdguisave.c:58
DWORD WINAPI VfdUnregisterHandlers()
Definition: vfdshutil.cpp:297
PVOID pBuffer
DWORD WINAPI VfdRegisterHandlers()
Definition: vfdshutil.cpp:100
DWORD WINAPI VfdGetDeviceName(HANDLE hDevice, PCHAR pName, ULONG nLength)
Definition: vfdctl.c:2396
DWORD WINAPI VfdSetLocalLink(HANDLE hDevice, CHAR cLetter)
Definition: vfdctl.c:2154
UCHAR * PVFD_FLAGS
Definition: vfdtypes.h:63
DWORD WINAPI VfdSetGlobalLink(HANDLE hDevice, CHAR cLetter)
Definition: vfdctl.c:1984
static LPSTR pName
Definition: security.c:75
DWORD WINAPI VfdGuiOpen(HWND hParent, ULONG nDevice)
Definition: vfdguiopen.c:71
_VFD_OPERATION
Definition: vfdapi.h:25
DWORD WINAPI VfdGetMediaState(HANDLE hDevice)
Definition: vfdctl.c:1949
#define WINAPI
Definition: msvc.h:8
DWORD WINAPI VfdFormatMedia(HANDLE hDevice)
Definition: vfdctl.c:2523
void WINAPI VfdToolTip(HWND hParent, PCSTR sText, int pos_x, int pos_y, BOOL stick)
Definition: vfdguitip.c:134
unsigned long DWORD
Definition: ntddk_ex.h:95
UCHAR * PVFD_FILETYPE
Definition: vfdtypes.h:62
PCSTR WINAPI VfdMediaTypeName(VFD_MEDIA nMediaType)
Definition: vfdctl.c:3280
DWORD WINAPI VfdGetGlobalLink(HANDLE hDevice, PCHAR pLetter)
Definition: vfdctl.c:2114
DWORD WINAPI VfdGetDriverState(PDWORD pState)
Definition: vfdctl.c:1121
DWORD WINAPI VfdCloseImage(HANDLE hDevice, BOOL bForce)
Definition: vfdctl.c:1702
UCHAR VFD_FILETYPE
Definition: vfdtypes.h:62
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
void WINAPI VfdImageTip(HWND hParent, ULONG nDevice)
Definition: vfdguitip.c:266
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
DWORD WINAPI VfdInstallDriver(PCSTR sFileName, DWORD nStart)
Definition: vfdctl.c:241
DWORD WINAPI VfdSaveImage(HANDLE hDevice, PCSTR sFileName, BOOL bOverWrite, BOOL bTruncate)
Definition: vfdctl.c:2685
DWORD WINAPI VfdCheckDriverFile(PCSTR sFileName, PULONG pFileVersion)
Definition: vfdctl.c:2867
signed char * PSTR
Definition: retypes.h:7
DWORD WINAPI VfdCheckImageFile(PCSTR sFileName, PDWORD pAttributes, PVFD_FILETYPE pFileType, PULONG pImageSize)
Definition: vfdctl.c:3035
unsigned int * PULONG
Definition: retypes.h:1
DWORD WINAPI VfdGuiClose(HWND hParent, ULONG nDevice)
Definition: vfdguiut.c:114
unsigned int UINT
Definition: ndis.h:50
CHAR WINAPI VfdChooseLetter()
Definition: vfdctl.c:3205
enum _VFD_OPERATION VFD_OPERATION
DWORD * PDWORD
Definition: pedump.c:68
DWORD WINAPI VfdRemoveDriver()
Definition: vfdctl.c:557
unsigned int ULONG
Definition: retypes.h:1
UCHAR * PVFD_MEDIA
Definition: vfdtypes.h:61
void WINAPI VfdMakeFileDesc(PSTR pBuffer, ULONG nBufSize, VFD_FILETYPE nFileType, ULONG nFileSize, DWORD nFileAttr)
Definition: vfdguiut.c:376
UCHAR * PVFD_DISKTYPE
Definition: vfdtypes.h:60
DWORD WINAPI VfdOpenImage(HANDLE hDevice, PCSTR sFileName, VFD_DISKTYPE nDiskType, VFD_MEDIA nMediaType, VFD_FLAGS nMediaFlags)
Definition: vfdctl.c:1301
const char * PCSTR
Definition: typedefs.h:51
BOOL WINAPI VfdIsValidPlatform()
Definition: vfdlib.c:87
enum _VFD_OPERATION * PVFD_OPERATION
UCHAR VFD_MEDIA
Definition: vfdtypes.h:61
DWORD WINAPI VfdStopDriver(PDWORD pState)
Definition: vfdctl.c:801