internal-r3-nt.h revision 1eda04de692c4c416332941e87bab4cc8fc45a18
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync/* $Id$ */
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync/** @file
fa11a1e5d812c442cfc865cfdcf9934074d35b7fvboxsync * IPRT - Internal Header for the Native NT code.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync */
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync/*
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2010-2013 Oracle Corporation
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync *
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * available from http://www.virtualbox.org. This file is free software;
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * you can redistribute it and/or modify it under the terms of the GNU
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * General Public License (GPL) as published by the Free Software
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync *
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * The contents of this file may alternatively be used under the terms
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * of the Common Development and Distribution License Version 1.0
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * VirtualBox OSE distribution, in which case the provisions of the
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * CDDL are applicable instead of those of the GPL.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync *
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * You may elect to license modified versions of this file under the
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * terms and conditions of either the GPL or the CDDL or both.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync */
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#ifndef ___internal_r3_nt_h___
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#define ___internal_r3_nt_h___
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#ifdef IN_SUP_HARDENED_R3
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync# include <iprt/nt/nt-and-windows.h>
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#else
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync# include <iprt/nt/nt.h>
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#endif
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#include "internal/iprt.h"
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#ifdef DEBUG_bird
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync/** Enables the "\\!\" NT path pass thru as well as hacks for listing NT object
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * directories. */
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync# define IPRT_WITH_NT_PATH_PASSTHRU 1
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#endif
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
188b39ae923237e5efe949661eeec5aa150425a0vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync/**
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * Internal helper for comparing a WCHAR string with a char string.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync *
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * @returns @c true if equal, @c false if not.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * @param pwsz1 The first string.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * @param cb1 The length of the first string, in bytes.
40788f70a2bd319d0d36dfbe7b73c0e9c364d87dvboxsync * @param psz2 The second string.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync * @param cch2 The length of the second string.
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync */
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsyncDECLINLINE(bool) rtNtCompWideStrAndAscii(WCHAR const *pwsz1, size_t cch1, const char *psz2, size_t cch2)
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync{
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync if (cch1 != cch2 * 2)
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync return false;
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync while (cch2-- > 0)
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync {
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync unsigned ch1 = *pwsz1++;
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync unsigned ch2 = (unsigned char)*psz2++;
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync if (ch1 != ch2)
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync return false;
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync }
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync return true;
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync}
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync#endif
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync
3cdf227bdf099f60b22215d6ea7685ec5ec64fe6vboxsync