https://git.reactos.org/?p=reactos.git;a=commitdiff;h=40bc5bf4899161e901ffc6afe730b05eced65184

commit 40bc5bf4899161e901ffc6afe730b05eced65184
Author:     Thamatip Chitpong <thamatip.chitp...@reactos.org>
AuthorDate: Fri Nov 24 07:47:01 2023 +0700
Commit:     GitHub <nore...@github.com>
CommitDate: Fri Nov 24 07:47:01 2023 +0700

    [SETUPAPI] CM_Request_Device_Eject_ExW: Allow ulNameLength to be zero when 
pszVetoName is not NULL (#6031)
    
    Addendum to 7f346b1aa (#5943)
---
 dll/win32/setupapi/cfgmgr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c
index 1b25536f9e3..929e35cc14d 100644
--- a/dll/win32/setupapi/cfgmgr.c
+++ b/dll/win32/setupapi/cfgmgr.c
@@ -7550,6 +7550,11 @@ CM_Request_Device_Eject_ExW(
     if (pszVetoName == NULL && ulNameLength != 0)
         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)
     {
         BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;

Reply via email to