diff --git a/.gitignore b/.gitignore index 57a1574c4..7f8fa260b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,6 @@ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ -x64/ -x86/ build/ bld/ [Bb]in/ diff --git a/network/wlan/ihvfrm/x64/rc4utils.dll b/network/wlan/ihvfrm/x64/rc4utils.dll new file mode 100644 index 000000000..a5a8228f1 Binary files /dev/null and b/network/wlan/ihvfrm/x64/rc4utils.dll differ diff --git a/network/wlan/ihvfrm/x64/rc4utils.lib b/network/wlan/ihvfrm/x64/rc4utils.lib new file mode 100644 index 000000000..15b4d2991 Binary files /dev/null and b/network/wlan/ihvfrm/x64/rc4utils.lib differ diff --git a/network/wlan/ihvfrm/x86/rc4utils.dll b/network/wlan/ihvfrm/x86/rc4utils.dll new file mode 100644 index 000000000..aebeab234 Binary files /dev/null and b/network/wlan/ihvfrm/x86/rc4utils.dll differ diff --git a/network/wlan/ihvfrm/x86/rc4utils.lib b/network/wlan/ihvfrm/x86/rc4utils.lib new file mode 100644 index 000000000..4de2c1746 Binary files /dev/null and b/network/wlan/ihvfrm/x86/rc4utils.lib differ diff --git a/print/XPSDrvSmpl/.gitignore b/print/XPSDrvSmpl/.gitignore new file mode 100644 index 000000000..4a89120b2 --- /dev/null +++ b/print/XPSDrvSmpl/.gitignore @@ -0,0 +1,2 @@ +# Allow tracking debug folder for this sample +!debug/ diff --git a/print/XPSDrvSmpl/src/debug/debug.cpp b/print/XPSDrvSmpl/src/debug/debug.cpp new file mode 100644 index 000000000..330a4a1d9 --- /dev/null +++ b/print/XPSDrvSmpl/src/debug/debug.cpp @@ -0,0 +1,189 @@ +/*++ + +Copyright (c) 2005 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. + +File Name: + + debug.cpp + +Abstract: + + Debug implementations. + +--*/ + +#include "precomp.h" +#include "debug.h" +#include "xdstring.h" + +/*++ + +Routine Name: + + RealDebugMessage + +Routine Description: + + This routine takes a debug message and va_list and outputs the message via OutputDebugString + +Arguments: + + dwSize - Maximum size of the debug message in number of characters + pszMessage - The debug message string + arglist - The arg list for the debug message string + +Return Value: + + BOOL + TRUE - On success + FALSE - On error + +--*/ +BOOL +RealDebugMessage( + _In_ DWORD dwSize, + _In_ PCSTR pszMessage, + va_list arglist + ) +{ + HRESULT hr = S_OK; + PSTR pszMsgBuf; + + if (NULL == pszMessage || + 0 == dwSize) + { + hr = E_INVALIDARG; + } + + if (SUCCEEDED(hr)) + { + // + // Allocate memory for message buffer. + // + pszMsgBuf = new(std::nothrow) CHAR[dwSize + 1]; + + if (NULL != pszMsgBuf) + { + // + // Pass the variable parameters to wvsprintf to be formated. + // + hr = StringCbVPrintfA(pszMsgBuf, (dwSize + 1) * sizeof(CHAR), pszMessage, arglist); + + // + // Dump string to debug output. + // + OutputDebugStringA(pszMsgBuf); + + // + // Clean up. + // + delete[] pszMsgBuf; + pszMsgBuf = NULL; + } + else + { + hr = E_OUTOFMEMORY; + } + } + + return SUCCEEDED(hr); +} + +/*++ + +Routine Name: + + DbgPrint + +Routine Description: + + This routine takes a format string and arguments and outputs as a debug string + +Arguments: + + pszFormatString - Format string for the debug message + ... - argument list + +Return Value: + + BOOL + TRUE - On success + FALSE - On error + +--*/ +BOOL +DbgPrint( + _In_ PCSTR pszFormatString, + ... + ) +{ + BOOL bResult; + va_list VAList; + + // + // Pass the variable parameters to RealDebugMessage to be processed. + // + va_start(VAList, pszFormatString); + bResult = RealDebugMessage(0x8000, pszFormatString, VAList); + va_end(VAList); + + return bResult; +} + +/*++ + +Routine Name: + + DbgDOMDoc + +Routine Description: + + This routine outputs an XML DOM document to the debug output stream + +Arguments: + + pszMessage - Debug message + pDomDoc - DOM document to be output + +Return Value: + + None. + +--*/ +VOID +DbgDOMDoc( + _In_ PCSTR pszMessage, + _In_ IXMLDOMDocument2* pDomDoc + ) +{ + try + { + CComBSTR xml; + + if (pDomDoc != NULL && + SUCCEEDED(pDomDoc->get_xml(&xml))) + { + CStringXDA ansi(xml); + + if (pszMessage != NULL) + { + DbgPrint("%s%s\n", pszMessage, ansi.GetBuffer()); + } + else + { + DbgPrint("%s\n", ansi.GetBuffer()); + } + } + } + catch (CXDException&) + { + } +} + diff --git a/print/XPSDrvSmpl/src/debug/debug.h b/print/XPSDrvSmpl/src/debug/debug.h new file mode 100644 index 000000000..ddfdc038b --- /dev/null +++ b/print/XPSDrvSmpl/src/debug/debug.h @@ -0,0 +1,186 @@ +/*++ + +Copyright (c) 2005 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. + +File Name: + + xdsdbg.h + +Abstract: + + Debug definitions. + +--*/ + +#pragma once + +// +// These macros are used for debugging purposes. They expand +// to white spaces on a free build. Here is a brief description +// of what they do and how they are used: +// +// giDebugLevel +// Global variable which set the current debug level to control +// the amount of debug messages emitted. +// +// VERBOSE(msg) +// Display a message if the current debug level is <= DBG_VERBOSE. +// +// TERSE(msg) +// Display a message if the current debug level is <= DBG_TERSE. +// +// WARNING(msg) +// Display a message if the current debug level is <= DBG_WARNING. +// The message format is: WRN filename (linenumber): message +// +// ERR(msg) +// Similiar to WARNING macro above - displays a message +// if the current debug level is <= DBG_ERROR. +// +// ASSERT(cond) +// Verify a condition is true. If not, force a breakpoint. +// +// ASSERTMSG(cond, msg) +// Verify a condition is true. If not, display a message and +// force a breakpoint. +// +// RIP(msg) +// Display a message and force a breakpoint. +// +// Usage: +// These macros require extra parantheses for the msg argument +// example, ASSERTMSG(x > 0, ("x is less than 0\n")); +// WARNING(("App passed NULL pointer, ignoring...\n")); +// + +#pragma once + +#define DBG_VERBOSE 1 +#define DBG_TERSE 2 +#define DBG_WARNING 3 +#define DBG_ERROR 4 +#define DBG_RIP 5 + +BOOL +RealDebugMessage( + _In_ DWORD dwSize, + _In_ PCSTR pszMessage, + va_list arglist + ); + +BOOL +DbgPrint( + _In_ PCSTR pszFormatString, + ... + ); + +VOID +DbgDOMDoc( + _In_ PCSTR pszMessage, + _In_ IXMLDOMDocument2* pDomDoc + ); + +#if DBG + +#ifndef MAX_DEBUG_LEVEL +#define MAX_DEBUG_LEVEL DBG_VERBOSE +#endif + +#define DBGMSG(level, prefix, msg) { \ + INT dbgLevel = level; \ + if (MAX_DEBUG_LEVEL <= (dbgLevel)) { \ + DbgPrint("%s %s (%d): ", prefix, __FILE__, __LINE__); \ + DbgPrint(msg); \ + } \ + } + +#define DBGMSG_ON_HR(level, prefix, hr) { \ + INT dbgLevel = level; \ + HRESULT hres = hr; \ + if (MAX_DEBUG_LEVEL <= (dbgLevel) && FAILED(hres)) { \ + DbgPrint("%s %s (%d): Call failed with HRESULT = 0x%x\n", prefix, __FILE__, __LINE__, hr); \ + } \ + } + +#define DBGMSG_ON_HR_EXC(level, prefix, hr, hr_exc) { \ + INT dbgLevel = level; \ + HRESULT hres = hr; \ + if (MAX_DEBUG_LEVEL <= (dbgLevel) && FAILED(hres) && hres != hr_exc) { \ + DbgPrint("%s %s (%d): Call failed with HRESULT = 0x%x\n", prefix, __FILE__, __LINE__, hr); \ + } \ + } + +#define DBGPRINT(level, msg) { \ + INT dbgLevel = level; \ + if (MAX_DEBUG_LEVEL <= (dbgLevel)) { \ + DbgPrint(msg); \ + } \ + } + +#define DBGXML(msg, pDomDoc) { \ + INT dbgLevel = DBG_VERBOSE; \ + if (MAX_DEBUG_LEVEL <= dbgLevel) { \ + DbgDOMDoc(msg, pDomDoc); \ + } \ + } + +#define VERBOSE(msg) DBGPRINT(DBG_VERBOSE, msg) +#define TERSE(msg) DBGPRINT(DBG_TERSE, msg) +#define WARNING(msg) DBGMSG(DBG_WARNING, "WRN", msg) +#define ERR(msg) DBGMSG(DBG_ERROR, "ERR", msg) +#define ERR_ON_HR(hr) DBGMSG_ON_HR(DBG_ERROR, "ERR", hr) +#define ERR_ON_HR_EXC(hr, hr_exc) DBGMSG_ON_HR_EXC(DBG_ERROR, "ERR", hr, hr_exc) + +#define ASSERT(cond) { \ + if (! (cond)) { \ + RIP(("\n")); \ + } \ + } + +#define ASSERTMSG(cond, msg) { \ + if (!(cond)) { \ + RIP(msg); \ + } \ + } + +#define RIP(msg) { \ + DBGMSG(DBG_RIP, "RIP", msg); \ + DebugBreak(); \ + } + +#define DBG_ONLY(p) p + +#else // !DBG + +#define VERBOSE(msg) +#define TERSE(msg) +#define WARNING(msg) +#define ERR(msg) +#define ERR_ON_HR(hr) +#define ERR_ON_HR_EXC(hr, hr_exc) + +#define ASSERT(cond) + +#define ASSERTMSG(cond, msg) + +#define RIP(msg) + +#define DBG_ONLY(p) + +#define DBGMSG(level, prefix, msg) + +#define DBGMSG_ON_HR(level, prefix, hr) + +#define DBGPRINT(level, msg) + +#define DBGXML(msg, pDomDoc) + +#endif + diff --git a/print/XPSDrvSmpl/src/debug/precomp.h b/print/XPSDrvSmpl/src/debug/precomp.h new file mode 100644 index 000000000..fe3809587 --- /dev/null +++ b/print/XPSDrvSmpl/src/debug/precomp.h @@ -0,0 +1,67 @@ +/*++ + +Copyright (c) 2005 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. + +File Name: + + precomp.h + +Abstract: + + Precompiled header. + +--*/ + +#pragma once + +// +// Annotate this as a usermode driver for static analysis +// +#include +_Analysis_mode_(_Analysis_code_type_user_driver_) + +// +// Standard Annotation Language include +// +#include + +// +// Windows includes +// +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif // WIN32_LEAN_AND_MEAN +#include + +// +// COM includes +// +#include +#include + +// +// ATL Includes +// +#include + +// +// STL Includes +// +#include + +// +// MSXML includes +// +#include + +#include + +#include "common.ver" + diff --git a/print/XPSDrvSmpl/src/debug/precompsrc.cpp b/print/XPSDrvSmpl/src/debug/precompsrc.cpp new file mode 100644 index 000000000..5944cf515 --- /dev/null +++ b/print/XPSDrvSmpl/src/debug/precompsrc.cpp @@ -0,0 +1 @@ +#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj b/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj new file mode 100644 index 000000000..5b0050497 --- /dev/null +++ b/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj @@ -0,0 +1,195 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {5DD79EE3-3778-4674-9537-70EA840F13B4} + $(MSBuildProjectName) + false + true + Debug + Win32 + {338FD8A5-95F5-403D-9637-6BE35412F9C7} + + + + Windows10 + False + Desktop + + WindowsApplicationForDrivers10.0 + StaticLibrary + + + Windows10 + True + Desktop + + WindowsApplicationForDrivers10.0 + StaticLibrary + + + Windows10 + False + Desktop + + WindowsApplicationForDrivers10.0 + StaticLibrary + + + Windows10 + True + Desktop + + WindowsApplicationForDrivers10.0 + StaticLibrary + + + + $(IntDir) + + + + + + + + + + + + + + + + xdsdbg + + + xdsdbg + + + xdsdbg + + + xdsdbg + + + + MultiThreaded + MultiThreadedDebug + Sync + true + Level4 + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + + + MultiThreaded + MultiThreadedDebug + Sync + true + Level4 + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + + + MultiThreaded + MultiThreadedDebug + Sync + true + Level4 + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + + + MultiThreaded + MultiThreadedDebug + Sync + true + Level4 + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE + %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) + + + + + ;%(AdditionalIncludeDirectories) + precomp.h + Use + $(IntDir)\precomp.h.pch + + + ;%(AdditionalIncludeDirectories) + precomp.h + Create + $(IntDir)\precomp.h.pch + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters b/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters new file mode 100644 index 000000000..a250ce5e3 --- /dev/null +++ b/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters @@ -0,0 +1,25 @@ + + + + + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* + {1AC0F303-AF4F-4DCA-A630-2304E2DAD1E1} + + + h;hpp;hxx;hm;inl;inc;xsd + {84B52639-2381-44A5-94B2-CE2323343A4E} + + + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml + {41355B51-46D2-499F-BB82-8C06DFD9DC2F} + + + + + Source Files + + + Source Files + + + \ No newline at end of file