terminal/src/server/WinNTControl.h
Michael Niksa d711d731d7
Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016)
## Summary of the Pull Request
- Enables auditing of some Terminal libraries (Connection, Core, Settings)
- Also audit WinConPTY.LIB since Connection depends on it

## PR Checklist
* [x] Rolls audit out to more things
* [x] I work here
* [x] Tests should still pass
* [x] Am core contributor

## Detailed Description of the Pull Request / Additional comments
This is turning on the auditing of these projects (as enabled by the heavier lifting in the other refactor) and then cleaning up the remaining warnings.

## Validation Steps Performed
- [x] Built it
- [x] Ran the tests
2020-01-03 10:44:27 -08:00

42 lines
1.2 KiB
C++

/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- WinNTControl.h
Abstract:
- This module helps wrap methods from NTDLL.dll to avoid needing Driver Kit headers in the project.
Author:
- Michael Niksa (MiNiksa) 14-Sept-2016
Revision History:
--*/
#pragma once
class WinNTControl
{
public:
[[nodiscard]] static NTSTATUS NtOpenFile(_Out_ PHANDLE FileHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_In_ ULONG ShareAccess,
_In_ ULONG OpenOptions);
private:
WinNTControl();
WinNTControl(WinNTControl const&) = delete;
void operator=(WinNTControl const&) = delete;
static WinNTControl& GetInstance();
wil::unique_hmodule const _NtDllDll;
typedef NTSTATUS(NTAPI* PfnNtOpenFile)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, ULONG, ULONG);
PfnNtOpenFile const _NtOpenFile;
};