summaryrefslogtreecommitdiff
path: root/usb/wdf_osrfx2_lab/umdf/step4/dllsup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'usb/wdf_osrfx2_lab/umdf/step4/dllsup.cpp')
-rw-r--r--usb/wdf_osrfx2_lab/umdf/step4/dllsup.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/usb/wdf_osrfx2_lab/umdf/step4/dllsup.cpp b/usb/wdf_osrfx2_lab/umdf/step4/dllsup.cpp
index e8bad81b..bd681ac2 100644
--- a/usb/wdf_osrfx2_lab/umdf/step4/dllsup.cpp
+++ b/usb/wdf_osrfx2_lab/umdf/step4/dllsup.cpp
@@ -1,5 +1,5 @@
/*++
-
+
Copyright (C) Microsoft Corporation, All Rights Reserved.
Module Name:
@@ -8,24 +8,24 @@ Module Name:
Abstract:
- This module contains the implementation of the UMDF Skeleton Sample
+ This module contains the implementation of the UMDF Skeleton Sample
Driver's entry point and its exported functions for providing COM support.
This module can be copied without modification to a new UMDF driver. It
- depends on some of the code in comsup.cpp & comsup.h to handle DLL
+ depends on some of the code in comsup.cpp & comsup.h to handle DLL
registration and creating the first class factory.
This module is dependent on the following defines:
- MYDRIVER_TRACING_ID - A wide string passed to WPP when initializing
- tracing. For example the skeleton uses
+ MYDRIVER_TRACING_ID - A wide string passed to WPP when initializing
+ tracing. For example the skeleton uses
L"Microsoft\\UMDF\\Skeleton"
- MYDRIVER_CLASS_ID - A GUID encoded in struct format used to
- initialize the driver's ClassID.
+ MYDRIVER_CLASS_ID - A GUID encoded in struct format used to
+ initialize the driver's ClassID.
These are defined in internal.h for the skeleton sample. If you choose
- to use a different primary include file, you should ensure they are
+ to use a different primary include file, you should ensure they are
defined there as well.
Environment:
@@ -50,10 +50,10 @@ DllMain(
Routine Description:
- This is the entry point and exit point for the I/O trace driver. This
+ This is the entry point and exit point for the I/O trace driver. This
does very little as the I/O trace driver has minimal global data.
- This method initializes tracing, and saves the module handle away in a
+ This method initializes tracing, and saves the module handle away in a
global variable so that it can be referenced should the COM registration
code (Dll[Un]RegisterServer) be called.
@@ -72,7 +72,7 @@ DllMain(
--*/
{
UNREFERENCED_PARAMETER(ModuleHandle);
-
+
if (DLL_PROCESS_ATTACH == Reason)
{
//
@@ -93,6 +93,7 @@ DllMain(
return TRUE;
}
+_Use_decl_annotations_
HRESULT
STDAPICALLTYPE
DllCanUnloadNow(
@@ -100,7 +101,7 @@ DllCanUnloadNow(
)
/*++
- Routine Description:
+ Routine Description:
Called by the COM runtime when determining whether or not this module
can be unloaded. Our answer is always "no".
@@ -118,18 +119,19 @@ DllCanUnloadNow(
return S_FALSE;
}
+_Use_decl_annotations_
HRESULT
STDAPICALLTYPE
DllGetClassObject(
- _In_ REFCLSID ClassId,
- _In_ REFIID InterfaceId,
- _Outptr_ LPVOID *Interface
+ REFCLSID ClassId,
+ REFIID InterfaceId,
+ LPVOID *Interface
)
/*++
Routine Description:
- This routine is called by COM in order to instantiate the
+ This routine is called by COM in order to instantiate the
skeleton driver callback object and do an initial query interface on it.
This method only creates an instance of the driver's class factory, as this
@@ -145,7 +147,7 @@ DllGetClassObject(
Return Value:
- S_OK if the function succeeds or error indicating the cause of the
+ S_OK if the function succeeds or error indicating the cause of the
failure.
--*/
@@ -157,9 +159,9 @@ DllGetClassObject(
*Interface = NULL;
//
- // If the CLSID doesn't match that of our "coclass" (defined in the IDL
- // file) then we can't create the object the caller wants. This may
- // indicate that the COM registration is incorrect, and another CLSID
+ // If the CLSID doesn't match that of our "coclass" (defined in the IDL
+ // file) then we can't create the object the caller wants. This may
+ // indicate that the COM registration is incorrect, and another CLSID
// is referencing this drvier.
//
@@ -180,19 +182,19 @@ DllGetClassObject(
factory = new CClassFactory();
- if (NULL == factory)
+ if (NULL == factory)
{
hr = E_OUTOFMEMORY;
}
- //
+ //
// Query the object we created for the interface the caller wants. After
- // that we release the object. This will drive the reference count to
+ // that we release the object. This will drive the reference count to
// 1 (if the QI succeeded an referenced the object) or 0 (if the QI failed).
// In the later case the object is automatically deleted.
//
- if (SUCCEEDED(hr))
+ if (SUCCEEDED(hr))
{
hr = factory->QueryInterface(InterfaceId, Interface);
factory->Release();