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/obcallback/control/common.h | |
| parent | ef1905bf1e8825bb31120dfb27e0daf3154d859a (diff) | |
Initial publish
Diffstat (limited to 'general/obcallback/control/common.h')
| -rw-r--r-- | general/obcallback/control/common.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/general/obcallback/control/common.h b/general/obcallback/control/common.h new file mode 100644 index 00000000..1ba366a2 --- /dev/null +++ b/general/obcallback/control/common.h @@ -0,0 +1,86 @@ + +// Notice: +// +// Use this sample code at your own risk; there is no support from Microsoft for the sample code. +// In addition, this sample code is licensed to you under the terms of the Microsoft Public License +// (http://www.microsoft.com/opensource/licenses.mspx) + +#pragma once + +#pragma warning (disable: 4201) // nonstandard extension used : nameless struct/union + +#include "..\driver\shared.h" + +// +// Logging support macros. +// +// LOG_INFO +// LOG_INFO_FAILURE +// LOG_PASSED +// LOG_ERROR +// + + +#ifdef DEBUG +#define LOG_INFO(fmt, ...) \ + _tprintf(_T("%hs: ") fmt, __FUNCTION__, __VA_ARGS__);_tprintf(_T("\n")); +#define LOG_INFO_FAILURE(fmt, ...) \ + _tprintf(_T("ReportFailure %hs: ") fmt, __FUNCTION__, __VA_ARGS__);_tprintf(_T("\n")); + +#define LOG_PASSED(fmt, ...) \ + _tprintf(_T("\n!!!PASSED: %hs (%hs:%u): ") fmt, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__);_tprintf(_T("\n")); +#define LOG_ERROR(fmt, ...) \ + _tprintf(_T("\n!!!FAILED: %hs (%hs:%u): ") fmt, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); _tprintf(_T("\n")); + +#else + +#define LOG_INFO(FormatString, ...) +#define LOG_INFO_FAILURE(FormatString, ...) + +#define LOG_PASSED(FormatString, ...) +#define LOG_ERROR(FormatString, ...) + +#endif + + +extern HANDLE TcDeviceHandle; + +BOOL TcInitialize(); +BOOL TcUnInitialize(); +BOOL TcCleanupSCM(); + +BOOL TcInstallDriver(); + +BOOL TcUninstallDriver(); + +BOOL TcRemoveProtection (); + +BOOL TcProcessName ( + _In_ int argc, + _In_reads_(argc) LPCWSTR argv[], + _In_ ULONG ulOperation +); + +BOOL TcUnprotectCallback (); + +BOOL TcProcessNameCallback ( + _In_reads_(NAME_SIZE+1) PCWSTR pnametoprotect, + _In_ ULONG ulOperation +); + +// +// Utility functions +// + +BOOL TcInitializeGlobals(); +BOOL TcLoadDriver(); +BOOL TcUnloadDriver(); + +BOOL TcCreateService(); +BOOL TcDeleteService(); +BOOL TcStartService(); +BOOL TcStopService(); + +BOOL TcOpenDevice(); +BOOL TcCloseDevice(); + |
