1 | /* $Id: vbsfhlp.h 76563 2019-01-01 03:53:56Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Windows Guest Shared Folders - File System Driver helpers
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef GA_INCLUDED_SRC_WINNT_SharedFolders_driver_vbsfhlp_h
|
---|
19 | #define GA_INCLUDED_SRC_WINNT_SharedFolders_driver_vbsfhlp_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include <iprt/nt/nt.h> /* includes ntifs.h and wdm.h */
|
---|
25 | #include <iprt/win/ntverp.h>
|
---|
26 |
|
---|
27 | #include <VBox/log.h>
|
---|
28 | #include <VBox/VBoxGuestLibSharedFolders.h>
|
---|
29 |
|
---|
30 |
|
---|
31 | void vbsfHlpSleep(ULONG ulMillies);
|
---|
32 | NTSTATUS vbsfHlpCreateDriveLetter(WCHAR Letter, UNICODE_STRING *pDeviceName);
|
---|
33 | NTSTATUS vbsfHlpDeleteDriveLetter(WCHAR Letter);
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * Convert VBox IRT file attributes to NT file attributes
|
---|
37 | *
|
---|
38 | * @returns NT file attributes
|
---|
39 | * @param fMode IRT file attributes
|
---|
40 | *
|
---|
41 | */
|
---|
42 | uint32_t VBoxToNTFileAttributes(uint32_t fMode);
|
---|
43 |
|
---|
44 | /**
|
---|
45 | * Convert VBox IRT file attributes to NT file attributes
|
---|
46 | *
|
---|
47 | * @returns NT file attributes
|
---|
48 | * @param fMode IRT file attributes
|
---|
49 | *
|
---|
50 | */
|
---|
51 | uint32_t NTToVBoxFileAttributes(uint32_t fMode);
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Convert VBox error code to NT status code
|
---|
55 | *
|
---|
56 | * @returns NT status code
|
---|
57 | * @param vboxRC VBox error code
|
---|
58 | *
|
---|
59 | */
|
---|
60 | NTSTATUS VBoxErrorToNTStatus(int vboxRC);
|
---|
61 |
|
---|
62 | PVOID vbsfAllocNonPagedMem(ULONG ulSize);
|
---|
63 | void vbsfFreeNonPagedMem(PVOID lpMem);
|
---|
64 |
|
---|
65 | #if defined(DEBUG) || defined(LOG_ENABLED)
|
---|
66 | PCHAR MajorFunctionString(UCHAR MajorFunction, LONG MinorFunction);
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | NTSTATUS vbsfShflStringFromUnicodeAlloc(PSHFLSTRING *ppShflString, const WCHAR *pwc, uint16_t cb);
|
---|
70 |
|
---|
71 | #endif /* !GA_INCLUDED_SRC_WINNT_SharedFolders_driver_vbsfhlp_h */
|
---|
72 |
|
---|