33 #define DOKAN_GLOBAL_DEVICE_NAME L"\\\\.\\Dokan_" DOKAN_MAJOR_API_VERSION 35 #define DOKAN_DRIVER_SERVICE L"Dokan" DOKAN_MAJOR_API_VERSION 37 #define DOKAN_SERVICE_START 1 38 #define DOKAN_SERVICE_STOP 2 39 #define DOKAN_SERVICE_DELETE 3 42 extern BOOL g_DebugMode;
45 extern BOOL g_UseStdErr;
47 #if defined(_MSC_VER) || (defined(__GNUC__) && !defined(__CYGWIN__)) 49 static VOID DokanDbgPrint(LPCSTR format, ...) {
50 const char *outputString = format;
55 va_start(argp, format);
56 length = _vscprintf(format, argp) + 1;
57 if ((length - 1) != -1) {
58 buffer = (
char *)_malloca(length *
sizeof(
char));
60 if (buffer && vsprintf_s(buffer, length, format, argp) != -1) {
61 outputString = buffer;
64 fputs(outputString, stderr);
66 OutputDebugStringA(outputString);
74 static VOID DokanDbgPrintW(LPCWSTR format, ...) {
75 const WCHAR *outputString = format;
80 va_start(argp, format);
81 length = _vscwprintf(format, argp) + 1;
82 if ((length - 1) != -1) {
83 buffer = (WCHAR *)_malloca(length *
sizeof(WCHAR));
85 if (buffer && vswprintf_s(buffer, length, format, argp) != -1) {
86 outputString = buffer;
89 fputws(outputString, stderr);
91 OutputDebugStringW(outputString);
99 #define DbgPrint(format, ...) \ 102 DokanDbgPrint(format, __VA_ARGS__); \ 105 __pragma(warning(push)) __pragma(warning(disable : 4127)) while (0) \ 106 __pragma(warning(pop)) 108 #define DbgPrintW(format, ...) \ 111 DokanDbgPrintW(format, __VA_ARGS__); \ 114 __pragma(warning(push)) __pragma(warning(disable : 4127)) while (0) \ 115 __pragma(warning(pop)) 117 #endif // defined(_MSC_VER) 119 #if defined(__GNUC__) 121 #define DbgPrint(format, ...) \ 124 DokanDbgPrint(format, ##__VA_ARGS__); \ 128 #define DbgPrintW(format, ...) \ 131 DokanDbgPrintW(format, ##__VA_ARGS__); \ 135 #endif // defined(__GNUC__) 137 #endif // defined(_MSC_VER) || (defined(__GNUC__) && !defined(__CYGWIN__)) 139 #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) 146 VOID
DOKANAPI DokanUseStdErr(BOOL Status);
151 VOID
DOKANAPI DokanDebugMode(BOOL Status);
158 BOOL
DOKANAPI DokanServiceInstall(LPCWSTR ServiceName, DWORD ServiceType,
159 LPCWSTR ServiceFullPath);
166 BOOL
DOKANAPI DokanServiceDelete(LPCWSTR ServiceName);
173 BOOL
DOKANAPI DokanNetworkProviderInstall();
180 BOOL
DOKANAPI DokanNetworkProviderUninstall();
188 BOOL
DOKANAPI DokanSetDebugMode(ULONG Mode);
197 BOOL
DOKANAPI DokanMountPointsCleanUp();
#define DOKANAPI
Definition: dokan.h:40