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