- src.zip
- src
- tools.zip
- tools
- devcon
- amd64
- devcon.exe
- i386
- devcon.exe
- PlaneDemo
- DemoApp.exe
- DemoApp.pdb
- Microsoft.WindowsAPICodePack.dll
- Microsoft.WindowsAPICodePack.pdb
- Microsoft.WindowsAPICodePack.Sensors.dll
- Microsoft.WindowsAPICodePack.Sensors.pdb
- WiimoteTest
- WiimoteLib.dll
- WiimoteTest.exe
- i386.zip
- i386
- WiimoteSensor.dll
- WiimoteSensor.inf
- WiimoteSensor.pdb
- WUDFUpdate_01009.dll
- wiidiag.zip
- Wiidiag
- Microsoft.WindowsAPICodePack.dll
- Microsoft.WindowsAPICodePack.Sensors.dll
- Wiidiag.exe
- amd64.zip
- amd64
- WiimoteSensor.dll
- WiimoteSensor.inf
- WiimoteSensor.pdb
- WUDFUpdate_01009.dll
|
/*++
// 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.
Copyright (C) Microsoft Corporation, All Rights Reserved
Module Name:
dllsup.cpp
Abstract:
This module contains the implementation of the Sensor Skeleton Sample
Driver's entry point and its exported functions for providing COM support.
This module is dependent on the following defines:
MYDRIVER_TRACING_ID - A wide string passed to WPP when initializing
tracing.
--*/
#include "internal.h"
#include "DllMain.tmh"
class CWiimoteSensorDriverModule : public CAtlDllModuleT<CWiimoteSensorDriverModule> {} _AtlModule;
/////////////////////////////////////////////////////////////////////////
//
// DllMain
//
// This is the main DLL Entry Point.
//
// Parameters:
// hInstance - Handle to the DLL module
// dwReason - Indicates why the DLL entry point is being called
// lpReserved - Additional information based on dwReason
//
// Return Values:
// TRUE = initialization succeeds
// FALSE = initialization fails
//
/////////////////////////////////////////////////////////////////////////
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance,
DWORD dwReason,
LPVOID lpReserved)
{
(lpReserved);
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
// Initialize tracing
WPP_INIT_TRACING(MYDRIVER_TRACING_ID);
Trace(TRACE_LEVEL_INFORMATION, "%!FUNC! Entry");
DisableThreadLibraryCalls(hInstance);
break;
case DLL_PROCESS_DETACH:
Trace(TRACE_LEVEL_INFORMATION, "%!FUNC! Entry");
// Cleanup tracing.
WPP_CLEANUP();
_AtlModule.Term();
break;
default:
break;
}
// Call the ATL module class so it can initialize
return _AtlModule.DllMain(dwReason, lpReserved);
}
/////////////////////////////////////////////////////////////////////////
//
// DllCanUnloadNow
//
// Used to determine whether the DLL can be unloaded by OLE
//
// Parameters:
// void - (unused argument)
//
// Return Values:
// S_OK: DLL can be unloaded
// S_FALSE: DLL cannot be unloaded now
//
/////////////////////////////////////////////////////////////////////////
STDAPI DllCanUnloadNow(void)
{
return _AtlModule.DllCanUnloadNow();
}
/////////////////////////////////////////////////////////////////////////
//
// DllGetClassObject
//
// Returns a class factory to create an object of the requested type
//
// Parameters:
// rclsid - CLSID that will associate the correct data and code
// riid - Reference to the IID the caller will use
// ppv - pointer to an interface pointer requested in riid
//
// Return Values:
// S_OK: The object was retrieved successfully.
// CLASS_E_CLASSNOTAVAILABLE: The DLL does not support the class
//
/////////////////////////////////////////////////////////////////////////
STDAPI DllGetClassObject(__in REFCLSID rclsid, __in REFIID riid, __deref_out LPVOID* ppv)
{
return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
}
/////////////////////////////////////////////////////////////////////////
//
// DllRegisterServer
//
// Adds entries to the system registry
//
// Parameters:
// void - (unused argument)
//
// Return Values:
// S_OK: The registry entries were created successfully
// SELFREG_E_TYPELIB: The server was unable to complete the
// registration of all the type libraries used by its classes
// SELFREG_E_CLASS: The server was unable to complete the
// registration of all the object classes
//
/////////////////////////////////////////////////////////////////////////
STDAPI DllRegisterServer(void)
{
return S_OK;
}
/////////////////////////////////////////////////////////////////////////
//
// DllUnregisterServer
//
// Removes entries from the system registry
//
// Parameters:
// void - (unused argument)
//
// Return Values:
// S_OK: The registry entries were removed successfully
// S_FALSE: Unregistration of known entries was successful, but
// other entries still exist for this server's classes
// SELFREG_E_TYPELIB: The server was unable to remove the entries
// of all the type libraries used by its classes
// SELFREG_E_CLASS: The server was unable to to remove the entries
// of all the object classes
//
/////////////////////////////////////////////////////////////////////////
STDAPI DllUnregisterServer(void)
{
return S_OK;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.