From 40bc5bf4899161e901ffc6afe730b05eced65184 Mon Sep 17 00:00:00 2001 From: Thamatip Chitpong Date: Fri, 24 Nov 2023 07:47:01 +0700 Subject: [PATCH] [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;