diff options
| author | J M Rossy <[email protected]> | 2015-07-29 15:40:09 -0700 |
|---|---|---|
| committer | J M Rossy <[email protected]> | 2015-07-29 16:34:40 -0700 |
| commit | 5d61a4a79a1e96dc5d9af1e5e712c84507307544 (patch) | |
| tree | 49ed270893578cd18758b74ffcca16dc7ab948d6 /wpd/WpdBasicHardwareDriver/WpdBasicHardwareDriver.cpp | |
| parent | 5d41613e26e147d2300c786bb2b34cb4b4067a25 (diff) | |
Samples update for public Windows 10 release
Fix #2 Enabling WPP Recorder in Sensors Samples causes errors
Fix #4 Add back fixed KMDOD sample
Add new BarcodeScanner sample in pos folder
Add new MagneticStripeReader sample in pos folder
Add new SynpaticsTouch sample in input folder
Add new Power Engine Plugin sample in pofx folder
Add new DeviceMft sample in avstream folder
Add new AvsCamera sample in root
Add new SimBatt sample in root
Add other pre-existing samples not yet released for Win10
Diffstat (limited to 'wpd/WpdBasicHardwareDriver/WpdBasicHardwareDriver.cpp')
| -rw-r--r-- | wpd/WpdBasicHardwareDriver/WpdBasicHardwareDriver.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/wpd/WpdBasicHardwareDriver/WpdBasicHardwareDriver.cpp b/wpd/WpdBasicHardwareDriver/WpdBasicHardwareDriver.cpp new file mode 100644 index 00000000..2620e909 --- /dev/null +++ b/wpd/WpdBasicHardwareDriver/WpdBasicHardwareDriver.cpp @@ -0,0 +1,60 @@ +#include "stdafx.h" + +#include "WpdBasicHardwareDriver.tmh" + +HINSTANCE g_hInstance = NULL; + +class CWpdBasicHardwareDriverModule : public CAtlDllModuleT< CWpdBasicHardwareDriverModule > +{ +public : + DECLARE_REGISTRY_APPID_RESOURCEID(IDR_WpdBasicHardwareDriver, "{021AD204-6411-4698-8CFB-C1A72B581733}") + DECLARE_LIBID(LIBID_WpdBasicHardwareDriverLib) +}; + +CWpdBasicHardwareDriverModule _AtlModule; + +// DLL Entry Point +extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) +{ + if(dwReason == DLL_PROCESS_ATTACH) + { + g_hInstance = hInstance; + + // Initialize tracing. + WPP_INIT_TRACING(MYDRIVER_TRACING_ID); + } + else if (dwReason == DLL_PROCESS_DETACH) + { + // Cleanup tracing. + WPP_CLEANUP(); + } + + return _AtlModule.DllMain(dwReason, lpReserved); +} + +// Used to determine whether the DLL can be unloaded by OLE +STDAPI DllCanUnloadNow(void) +{ + return _AtlModule.DllCanUnloadNow(); +} + +// Returns a class factory to create an object of the requested type +STDAPI DllGetClassObject(_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID* ppv) +{ + return _AtlModule.DllGetClassObject(rclsid, riid, ppv); +} + +// DllRegisterServer - Adds entries to the system registry +STDAPI DllRegisterServer(void) +{ + // registers object, typelib and all interfaces in typelib + HRESULT hr = _AtlModule.DllRegisterServer(); + return hr; +} + +// DllUnregisterServer - Removes entries from the system registry +STDAPI DllUnregisterServer(void) +{ + HRESULT hr = _AtlModule.DllUnregisterServer(); + return hr; +} |
