VirtualBox

source: kBuild/trunk/src/lib/nt/nthlp.h@ 2704

Last change on this file since 2704 was 2704, checked in by bird, 11 years ago

Drop the w32 createfile option, implemented sharing-violation fallback for stat() and lstat().

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1/* $Id: nthlp.h 2704 2013-11-21 01:26:52Z bird $ */
2/** @file
3 * MSC + NT helper functions.
4 */
5
6/*
7 * Copyright (c) 2005-2013 knut st. osmundsen <[email protected]>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 * IN THE SOFTWARE.
26 *
27 * Alternatively, the content of this file may be used under the terms of the
28 * GPL version 2 or later, or LGPL version 2.1 or later.
29 */
30
31#ifndef ___nt_nthlp_h
32#define ___nt_nthlp_h
33
34#include "ntstuff.h"
35
36
37/** Lazy resolving of the NTDLL imports. */
38#define birdResolveImports() do { if (g_fResolvedNtImports) {} else birdResolveImportsWorker(); } while (0)
39void birdResolveImportsWorker(void);
40extern int g_fResolvedNtImports;
41
42void *birdTmpAlloc(size_t cb);
43void birdTmpFree(void *pv);
44
45void *birdMemAlloc(size_t cb);
46void *birdMemAllocZ(size_t cb);
47void birdMemFree(void *pv);
48
49int birdSetErrnoFromNt(MY_NTSTATUS rcNt);
50int birdSetErrnoFromWin32(DWORD dwErr);
51int birdSetErrnoToNoMem(void);
52int birdSetErrnoToInvalidArg(void);
53int birdSetErrnoToBadFileNo(void);
54
55
56HANDLE birdOpenFile(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess,
57 ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs);
58HANDLE birdOpenParentDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess,
59 ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs,
60 MY_UNICODE_STRING *pNameUniStr);
61void birdCloseFile(HANDLE hFile);
62void birdFreeNtPath(MY_UNICODE_STRING *pNtPath);
63
64
65#endif
66
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette