diff options
| author | Dave Wilson <[email protected]> | 2015-03-17 19:50:07 -0700 |
|---|---|---|
| committer | Dave Wilson <[email protected]> | 2015-03-17 19:50:07 -0700 |
| commit | 97cf5197cf5b882b2c689d8dc2b555f2edf8f418 (patch) | |
| tree | 46f3701832d70b420eb0fc0eb93261f9da45db3f /general/registry/regfltr/exe/regctrl.h | |
| parent | ef1905bf1e8825bb31120dfb27e0daf3154d859a (diff) | |
Initial publish
Diffstat (limited to 'general/registry/regfltr/exe/regctrl.h')
| -rw-r--r-- | general/registry/regfltr/exe/regctrl.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/general/registry/regfltr/exe/regctrl.h b/general/registry/regfltr/exe/regctrl.h new file mode 100644 index 00000000..798b29fc --- /dev/null +++ b/general/registry/regfltr/exe/regctrl.h @@ -0,0 +1,108 @@ +/*++ +Copyright (c) Microsoft Corporation. All rights reserved. + + THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + PURPOSE. + +Module Name: + + regctrl.h + +Environment: + + User mode only + +--*/ + +#pragma once + +#include <windows.h> +#include <stdlib.h> +#include <stdio.h> +#include <devioctl.h> +#include <tchar.h> +#include <strsafe.h> + +#include "common.h" + +// +// Utility macro +// + +#define ARRAY_LENGTH(array) (sizeof (array) / sizeof (array[0])) + +// +// Logging macros +// + +#define InfoPrint(str, ...) \ + printf(##str"\n", \ + __VA_ARGS__) + +#define ErrorPrint(str, ...) \ + printf("ERROR: %u: "##str"\n", \ + __LINE__, \ + __VA_ARGS__) + +// +// Global variables +// + +// +// Handle to the driver +// +extern HANDLE g_Driver; + +// +// Handle to the root test key +// +extern HKEY g_RootKey; + +// +// Version number for the registry callback +// +extern ULONG g_MajorVersion; +extern ULONG g_MinorVersion; + + +// +// The user mode samples +// + +VOID +PreNotificationBlockSample(); + +VOID +PreNotificationBypassSample(); + +VOID +PostNotificationOverrideSuccessSample(); + +VOID +PostNotificationOverrideErrorSample(); + +VOID +CaptureSample(); + +// +// Utility routines to load and unload the driver +// + +BOOL +UtilLoadDriver( + _In_ LPTSTR szDriverNameNoExt, + _In_ LPTSTR szDriverNameWithExt, + _In_ LPTSTR szWin32DeviceName, + _Out_ HANDLE *pDriver + ); + +BOOL +UtilUnloadDriver( + _In_ HANDLE hDriver, + _In_opt_ SC_HANDLE hSCM, + _In_ LPTSTR szDriverNameNoExt + ); + + |
