VirtualBox

source: vbox/trunk/src/VBox/Runtime/r3/nt/internal-r3-nt.h@ 51441

Last change on this file since 51441 was 49150, checked in by vboxsync, 11 years ago

SUPR3: Use NtDeviceIoControlFile instead of DeviceIoControl to avoid wasting precious ticks on silly API conversions.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1/* $Id: internal-r3-nt.h 49150 2013-10-17 07:22:02Z vboxsync $ */
2/** @file
3 * IPRT - Internal Header for the Native NT code.
4 */
5
6/*
7 * Copyright (C) 2010-2013 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
32#include <iprt/nt/nt.h>
33#include "internal/iprt.h"
34
35
36#ifdef DEBUG_bird
37/** Enables the "\\!\" NT path pass thru as well as hacks for listing NT object
38 * directories. */
39# define IPRT_WITH_NT_PATH_PASSTHRU 1
40#endif
41
42
43/**
44 * Internal helper for comparing a WCHAR string with a char string.
45 *
46 * @returns @c true if equal, @c false if not.
47 * @param pwsz1 The first string.
48 * @param cb1 The length of the first string, in bytes.
49 * @param psz2 The second string.
50 * @param cch2 The length of the second string.
51 */
52DECLINLINE(bool) rtNtCompWideStrAndAscii(WCHAR const *pwsz1, size_t cch1, const char *psz2, size_t cch2)
53{
54 if (cch1 != cch2 * 2)
55 return false;
56 while (cch2-- > 0)
57 {
58 unsigned ch1 = *pwsz1++;
59 unsigned ch2 = (unsigned char)*psz2++;
60 if (ch1 != ch2)
61 return false;
62 }
63 return true;
64}
65
66#endif
67
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