summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Mao <[email protected]>2023-01-15 16:30:47 -0800
committerGitHub <[email protected]>2023-01-15 16:30:47 -0800
commit29709008d34efefd594d7da5ef67ee0d66f615fd (patch)
treeb6e40e63c027a79100b2e26fc03abc80d32d551d
parent13092c638c30acbe2dec7d4be53d0d0d5bfb7487 (diff)
parent38434bf5c6409cf9243b34c13e837d093c777f56 (diff)
Merge pull request #836 [general/toaster] Update GetDeviceDescription
-rw-r--r--general/toaster/toastDrv/exe/notify/notify.c12
-rw-r--r--general/toaster/toastDrv/exe/notify/notify.h2
-rw-r--r--general/toaster/umdf2/exe/notify/notify.c12
-rw-r--r--general/toaster/umdf2/exe/notify/notify.h2
4 files changed, 14 insertions, 14 deletions
diff --git a/general/toaster/toastDrv/exe/notify/notify.c b/general/toaster/toastDrv/exe/notify/notify.c
index 3362ce3d..15e5a615 100644
--- a/general/toaster/toastDrv/exe/notify/notify.c
+++ b/general/toaster/toastDrv/exe/notify/notify.c
@@ -35,7 +35,7 @@ Revision History:
// Annotation to indicate to prefast that this is nondriver user-mode code.
//
#include <DriverSpecs.h>
-_Analysis_mode_(_Analysis_code_type_user_code_)
+_Analysis_mode_(_Analysis_code_type_user_code_)
#include <windows.h>
#include <stdlib.h>
@@ -494,7 +494,7 @@ HandleDeviceInterfaceChange(
if(!GetDeviceDescription(dip->dbcc_name,
- (PBYTE)deviceInfo->DeviceName,
+ deviceInfo->DeviceName,
sizeof(deviceInfo->DeviceName),
&deviceInfo->SerialNo)) {
MessageBox(hWnd, TEXT("GetDeviceDescription failed"), TEXT("Error!"), MB_OK);
@@ -783,7 +783,7 @@ EnumExistingDevices(
// Get the device details such as friendly name and SerialNo
//
if(!GetDeviceDescription(deviceInterfaceDetailData->DevicePath,
- (PBYTE)deviceInfo->DeviceName,
+ deviceInfo->DeviceName,
sizeof(deviceInfo->DeviceName),
&deviceInfo->SerialNo)){
goto Error;
@@ -873,7 +873,7 @@ BOOLEAN Cleanup(HWND hWnd)
BOOL
GetDeviceDescription(
_In_ LPTSTR DevPath,
- _Out_writes_bytes_(OutBufferLen) PBYTE OutBuffer,
+ _Out_writes_bytes_(OutBufferLen) PTSTR OutBuffer,
_In_ ULONG OutBufferLen,
_In_ PULONG SerialNo
)
@@ -917,14 +917,14 @@ GetDeviceDescription(
if(!SetupDiGetDeviceRegistryProperty(hardwareDeviceInfo, &deviceInfoData,
SPDRP_FRIENDLYNAME,
&dwRegType,
- OutBuffer,
+ (PBYTE) OutBuffer,
OutBufferLen,
NULL))
{
if(!SetupDiGetDeviceRegistryProperty(hardwareDeviceInfo, &deviceInfoData,
SPDRP_DEVICEDESC,
&dwRegType,
- OutBuffer,
+ (PBYTE) OutBuffer,
OutBufferLen,
NULL)){
goto Error;
diff --git a/general/toaster/toastDrv/exe/notify/notify.h b/general/toaster/toastDrv/exe/notify/notify.h
index 98db2918..7bddb547 100644
--- a/general/toaster/toastDrv/exe/notify/notify.h
+++ b/general/toaster/toastDrv/exe/notify/notify.h
@@ -154,7 +154,7 @@ BOOLEAN Cleanup(
BOOL
GetDeviceDescription(
_In_ LPTSTR DevPath,
- _Out_writes_bytes_(OutBufferLen) PBYTE OutBuffer,
+ _Out_writes_bytes_(OutBufferLen) PTSTR OutBuffer,
_In_ ULONG OutBufferLen,
_In_ PULONG SerialNo
);
diff --git a/general/toaster/umdf2/exe/notify/notify.c b/general/toaster/umdf2/exe/notify/notify.c
index 3362ce3d..15e5a615 100644
--- a/general/toaster/umdf2/exe/notify/notify.c
+++ b/general/toaster/umdf2/exe/notify/notify.c
@@ -35,7 +35,7 @@ Revision History:
// Annotation to indicate to prefast that this is nondriver user-mode code.
//
#include <DriverSpecs.h>
-_Analysis_mode_(_Analysis_code_type_user_code_)
+_Analysis_mode_(_Analysis_code_type_user_code_)
#include <windows.h>
#include <stdlib.h>
@@ -494,7 +494,7 @@ HandleDeviceInterfaceChange(
if(!GetDeviceDescription(dip->dbcc_name,
- (PBYTE)deviceInfo->DeviceName,
+ deviceInfo->DeviceName,
sizeof(deviceInfo->DeviceName),
&deviceInfo->SerialNo)) {
MessageBox(hWnd, TEXT("GetDeviceDescription failed"), TEXT("Error!"), MB_OK);
@@ -783,7 +783,7 @@ EnumExistingDevices(
// Get the device details such as friendly name and SerialNo
//
if(!GetDeviceDescription(deviceInterfaceDetailData->DevicePath,
- (PBYTE)deviceInfo->DeviceName,
+ deviceInfo->DeviceName,
sizeof(deviceInfo->DeviceName),
&deviceInfo->SerialNo)){
goto Error;
@@ -873,7 +873,7 @@ BOOLEAN Cleanup(HWND hWnd)
BOOL
GetDeviceDescription(
_In_ LPTSTR DevPath,
- _Out_writes_bytes_(OutBufferLen) PBYTE OutBuffer,
+ _Out_writes_bytes_(OutBufferLen) PTSTR OutBuffer,
_In_ ULONG OutBufferLen,
_In_ PULONG SerialNo
)
@@ -917,14 +917,14 @@ GetDeviceDescription(
if(!SetupDiGetDeviceRegistryProperty(hardwareDeviceInfo, &deviceInfoData,
SPDRP_FRIENDLYNAME,
&dwRegType,
- OutBuffer,
+ (PBYTE) OutBuffer,
OutBufferLen,
NULL))
{
if(!SetupDiGetDeviceRegistryProperty(hardwareDeviceInfo, &deviceInfoData,
SPDRP_DEVICEDESC,
&dwRegType,
- OutBuffer,
+ (PBYTE) OutBuffer,
OutBufferLen,
NULL)){
goto Error;
diff --git a/general/toaster/umdf2/exe/notify/notify.h b/general/toaster/umdf2/exe/notify/notify.h
index 98db2918..7bddb547 100644
--- a/general/toaster/umdf2/exe/notify/notify.h
+++ b/general/toaster/umdf2/exe/notify/notify.h
@@ -154,7 +154,7 @@ BOOLEAN Cleanup(
BOOL
GetDeviceDescription(
_In_ LPTSTR DevPath,
- _Out_writes_bytes_(OutBufferLen) PBYTE OutBuffer,
+ _Out_writes_bytes_(OutBufferLen) PTSTR OutBuffer,
_In_ ULONG OutBufferLen,
_In_ PULONG SerialNo
);