1 | /* $Id: internal-r3-nt.h 62477 2016-07-22 18:27:37Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - Internal Header for the Native NT code.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2016 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 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 |
|
---|
28 | #ifndef ___internal_r3_nt_h___
|
---|
29 | #define ___internal_r3_nt_h___
|
---|
30 |
|
---|
31 | #ifdef IN_SUP_HARDENED_R3
|
---|
32 | # include <iprt/nt/nt-and-windows.h>
|
---|
33 | #else
|
---|
34 | # include <iprt/nt/nt.h>
|
---|
35 | #endif
|
---|
36 | #include "internal/iprt.h"
|
---|
37 |
|
---|
38 |
|
---|
39 | #ifdef DEBUG_bird
|
---|
40 | /** Enables the "\\!\" NT path pass thru as well as hacks for listing NT object
|
---|
41 | * directories. */
|
---|
42 | # define IPRT_WITH_NT_PATH_PASSTHRU 1
|
---|
43 | #endif
|
---|
44 |
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * Internal helper for comparing a WCHAR string with a char string.
|
---|
48 | *
|
---|
49 | * @returns @c true if equal, @c false if not.
|
---|
50 | * @param pwsz1 The first string.
|
---|
51 | * @param cch1 The length of the first string, in bytes.
|
---|
52 | * @param psz2 The second string.
|
---|
53 | * @param cch2 The length of the second string.
|
---|
54 | */
|
---|
55 | DECLINLINE(bool) rtNtCompWideStrAndAscii(WCHAR const *pwsz1, size_t cch1, const char *psz2, size_t cch2)
|
---|
56 | {
|
---|
57 | if (cch1 != cch2 * 2)
|
---|
58 | return false;
|
---|
59 | while (cch2-- > 0)
|
---|
60 | {
|
---|
61 | unsigned ch1 = *pwsz1++;
|
---|
62 | unsigned ch2 = (unsigned char)*psz2++;
|
---|
63 | if (ch1 != ch2)
|
---|
64 | return false;
|
---|
65 | }
|
---|
66 | return true;
|
---|
67 | }
|
---|
68 |
|
---|
69 | #endif
|
---|
70 |
|
---|