Skip to content

Commit

Permalink
Log failure of send to target. Restore driver.cpp to have unload rout…
Browse files Browse the repository at this point in the history
…ine.
  • Loading branch information
ManOnTheMountainTech committed Mar 25, 2024
1 parent 53dc946 commit 6e6bbd6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions TailLight/SetTaillightBlack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ NTSTATUS SetBlackAsync(WDFDEVICE device,
WdfObjectDelete(request);
request = 0;
status = STATUS_UNSUCCESSFUL;
KdPrint(("TailLight: Request not delivered to HIDUSB.\n"));
}
}

Expand Down
24 changes: 17 additions & 7 deletions TailLight/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
NTSTATUS DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_STRING RegistryPath
)
)
{
KdPrint(("TailLight: DriverEntry - WDF version built on %s %s\n", __DATE__, __TIME__));

WDF_DRIVER_CONFIG params = {};
WDF_DRIVER_CONFIG_INIT(/*out*/&params, EvtDriverDeviceAdd);
params.DriverPoolTag = POOL_TAG;
params.EvtDriverUnload = EvtDriverUnload;

// Create the framework WDFDRIVER object, with the handle to it returned in Driver.
NTSTATUS status = WdfDriverCreate(DriverObject,
RegistryPath,
WDF_NO_OBJECT_ATTRIBUTES,
&params,
WDF_NO_HANDLE); // [out]
NTSTATUS status = WdfDriverCreate(DriverObject,
RegistryPath,
WDF_NO_OBJECT_ATTRIBUTES,
&params,
WDF_NO_HANDLE); // [out]
if (!NT_SUCCESS(status)) {
// Framework will automatically cleanup on error Status return
KdPrint(("TailLight: Error Creating WDFDRIVER 0x%x\n", status));
Expand All @@ -27,3 +27,13 @@ NTSTATUS DriverEntry(
return status;
}


/** Driver unload callback.
Used to perform operations that must take place before the driver is unloaded. */
VOID EvtDriverUnload(
_In_ WDFDRIVER Driver
)
{
UNREFERENCED_PARAMETER(Driver);
KdPrint(("TailLight: DriverUnload.\n"));
}

0 comments on commit 6e6bbd6

Please sign in to comment.