ReactOS  0.4.14-dev-358-gbef841c
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
27 extern "C" {
28 #endif // __cplusplus
29 
30 //
31 // DLL instance handle
32 //
33 extern HINSTANCE g_hDllModule;
34 
35 //
36 // Reference count for the DLL
37 //
38 extern UINT g_cDllRefCnt;
39 
40 //
41 // VFD notification message value
42 //
43 extern 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 
77  HANDLE hFile,
78  ULONG *pSize);
79 
80 // Extract original image from a zip compressed file
81 
83  HANDLE hFile,
84  PUCHAR *pBuffer,
85  PULONG pLength);
86 
87 //=====================================
88 // GUI utility functions
89 //=====================================
90 
91 typedef struct _SAVE_PARAM {
100 
102 
104  HWND hParent,
105  PCSAVE_PARAM pParam);
106 
107 void ShowContextMenu(
108  HWND hDlg,
109  HWND hCtl,
110  LPARAM lParam);
111 
112 void ShowHelpWindow(
113  HWND hDlg,
114  UINT nCtl);
115 
116 //
117 // Set a message to a control window
118 //
119 void 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
149 extern ULONG TraceFlags;
150 #ifndef __REACTOS__
151 extern PCHAR TraceFile;
152 #else
153 extern CHAR const * TraceFile;
154 #endif
155 extern ULONG TraceLine;
156 
157 #define VFDTRACE(LEVEL,STRING) \
158  if ((TraceFlags & (LEVEL)) == (LEVEL)) { \
159  TraceFile = __FILE__; \
160  TraceLine = __LINE__; \
161  DebugTrace STRING; \
162  }
163 
164 void 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_
signed char * PCHAR
Definition: retypes.h:7
const SAVE_PARAM CSAVE_PARAM
Definition: vfdlib.h:101
VFD_MEDIA MediaType
Definition: vfdlib.h:94
UCHAR VFD_DISKTYPE
Definition: vfdtypes.h:60
ULONG ImageSize
Definition: vfdlib.h:97
PCSTR SystemMessage(DWORD nError)
Definition: vfdlib.c:147
unsigned char * PUCHAR
Definition: retypes.h:3
HINSTANCE g_hDllModule
char CHAR
Definition: xmlstorage.h:175
#define DebugTrace(INDENT, LEVEL, X, Y)
Definition: fatdata.h:313
UINT g_nNotifyMsg
HWND hWnd
Definition: settings.c:17
const SAVE_PARAM * PCSAVE_PARAM
Definition: vfdlib.h:101
DWORD ExtractZipInfo(HANDLE hFile, ULONG *pSize)
Definition: vfdzip.c:133
void ShowContextMenu(HWND hDlg, HWND hCtl, LPARAM lParam)
Definition: vfdguiut.c:456
UCHAR VFD_FLAGS
Definition: vfdtypes.h:63
VFD_FLAGS MediaFlags
Definition: vfdlib.h:95
VFD_FILETYPE FileType
Definition: vfdlib.h:96
UINT g_cDllRefCnt
PVOID pBuffer
PSTR ModuleMessage(DWORD nFormat,...)
Definition: vfdlib.c:124
LONG_PTR LPARAM
Definition: windef.h:208
PSTR ImageName
Definition: vfdlib.h:98
void ShowHelpWindow(HWND hDlg, UINT nCtl)
Definition: vfdguiut.c:507
struct _SAVE_PARAM PSAVE_PARAM
unsigned long DWORD
Definition: ntddk_ex.h:95
void SetControlText(HWND hWnd, UINT nCtrl, DWORD nMsg)
Definition: vfdguiut.c:350
struct _SAVE_PARAM SAVE_PARAM
DWORD ExtractZipImage(HANDLE hFile, PUCHAR *pBuffer, PULONG pLength)
Definition: vfdzip.c:182
HANDLE hDevice
Definition: vfdlib.h:92
UCHAR VFD_FILETYPE
Definition: vfdtypes.h:62
DWORD GuiSaveParam(HWND hParent, PCSAVE_PARAM pParam)
Definition: vfdguisave.c:101
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
_In_ HANDLE hFile
Definition: mswsock.h:90
signed char * PSTR
Definition: retypes.h:7
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
VFD_DISKTYPE DiskType
Definition: vfdlib.h:93
unsigned int ULONG
Definition: retypes.h:1
DWORD FormatBufferFat(PUCHAR pBuffer, ULONG nSectors)
Definition: vfdfat.c:116
const char * PCSTR
Definition: typedefs.h:51
LPARAM lParam
Definition: combotst.c:139
UCHAR VFD_MEDIA
Definition: vfdtypes.h:61