[SETUPAPI] CM_Request_Device_Eject_ExW: Allow ulNameLength to be zero when pszVetoName is not NULL (#6031)

Addendum to 7f346b1aa (#5943)
This commit is contained in:
Thamatip Chitpong 2023-11-24 07:47:01 +07:00 committed by GitHub
parent c77a5ff99b
commit 40bc5bf489
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7550,6 +7550,11 @@ CM_Request_Device_Eject_ExW(
if (pszVetoName == NULL && ulNameLength != 0) if (pszVetoName == NULL && ulNameLength != 0)
return CR_INVALID_POINTER; return CR_INVALID_POINTER;
/* Windows 2003 SP2 ignores pszVetoName when ulNameLength is zero
* and behaves like when pszVetoName is NULL */
if (ulNameLength == 0)
pszVetoName = NULL;
if (hMachine != NULL) if (hMachine != NULL)
{ {
BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;