forked from keybase/kbfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbridge.h
69 lines (52 loc) · 2.18 KB
/
bridge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright 2016 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
#ifndef KBFS_DOKAN_BRIDGE_H__
#define KBFS_DOKAN_BRIDGE_H__
#if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
#define UNICODE 1
#define _UNICODE 1
#include <stdint.h>
#include <windows.h>
#include <ntdef.h>
#include <ntstatus.h>
/* Compatibility for older toolchains */
#define PWIN32_FIND_DATAW LPWIN32_FIND_DATAW
typedef struct kbfs_WIN32_FIND_STREAM_DATA_ {
LARGE_INTEGER StreamSize;
WCHAR cStreamName[MAX_PATH + 36];
} kbfs_WIN32_FIND_STREAM_DATA,*kbfs_PWIN32_FIND_STREAM_DATA;
#define PWIN32_FIND_STREAM_DATA kbfs_PWIN32_FIND_STREAM_DATA
#include "dokan_header/dokan.h"
typedef int32_t error_t;
typedef uint32_t go_fs_id;
struct kbfsLibdokanCtx {
DOKAN_OPERATIONS dokan_operations;
DOKAN_OPTIONS dokan_options;
};
DWORD kbfsLibdokanLoadLibrary(LPCWSTR location);
struct kbfsLibdokanCtx* kbfsLibdokanAllocCtx(ULONG64 fsslot);
error_t kbfsLibdokanFree(struct kbfsLibdokanCtx* ctx);
error_t kbfsLibdokanRun(struct kbfsLibdokanCtx* ctx);
void kbfsLibdokanSet_path(struct kbfsLibdokanCtx* ctx, void*);
int kbfsLibdokanFill_find(PFillFindData, PWIN32_FIND_DATAW, PDOKAN_FILE_INFO);
BOOL kbfsLibdokan_RemoveMountPoint(LPCWSTR MountPoint);
HANDLE kbfsLibdokan_OpenRequestorToken(PDOKAN_FILE_INFO DokanFileInfo);
enum {
kbfsLibdokanDebug = DOKAN_OPTION_DEBUG,
kbfsLibdokanStderr = DOKAN_OPTION_STDERR,
kbfsLibdokanRemovable = DOKAN_OPTION_REMOVABLE,
kbfsLibdokanMountManager = DOKAN_OPTION_MOUNT_MANAGER,
kbfsLibdokanCurrentSession = DOKAN_OPTION_CURRENT_SESSION,
kbfsLibdokanUseFindFilesWithPattern = 1<<24,
kbfsLibDokan_ERROR = DOKAN_ERROR,
kbfsLibDokan_DRIVE_LETTER_ERROR = DOKAN_DRIVE_LETTER_ERROR,
kbfsLibDokan_DRIVER_INSTALL_ERROR = DOKAN_DRIVER_INSTALL_ERROR,
kbfsLibDokan_START_ERROR = DOKAN_START_ERROR,
kbfsLibDokan_MOUNT_ERROR = DOKAN_MOUNT_ERROR,
kbfsLibDokan_MOUNT_POINT_ERROR = DOKAN_MOUNT_POINT_ERROR,
kbfsLibDokan_VERSION_ERROR = DOKAN_VERSION_ERROR,
kbfsLibDokan_DLL_LOAD_ERROR = -99,
};
#endif /* windows check */
#endif /* KBFS_DOKAN_BRIDGE_H__ */