[EXPLORER] Implement ShowUndockMenuItem (#9068)

Follow-up of #9036.
ShowUndockMenuItem function
will detect system undocking ability.
JIRA issue: CORE-10675
- Do #include <cfgmgr32.h> in
  startmnusite.cpp.
- Implement ShowUndockMenuItem
  by using
  setupapi!CM_Is_Dock_Station_Present
  function.
This commit is contained in:
Katayama Hirofumi MZ
2026-05-29 12:56:00 +09:00
committed by GitHub
parent c32fa2c96c
commit d08a581eb1
+9 -5
View File
@@ -19,6 +19,7 @@
*/
#include "precomp.h"
#include <cfgmgr32.h>
class CStartMenuSite :
public CComCoClass<CStartMenuSite>,
@@ -99,12 +100,15 @@ public:
return E_NOTIMPL;
}
virtual BOOL
ShowUndockMenuItem(VOID)
virtual BOOL ShowUndockMenuItem(VOID)
{
TRACE("ShowUndockMenuItem() not implemented!\n");
/* FIXME: How do we detect this?! */
return FALSE;
BOOL bPresent;
CM_Is_Dock_Station_Present(&bPresent);
return bPresent &&
!SHRestricted(REST_NOSMEJECTPC) &&
SHTestTokenPrivilegeW(NULL, L"SeUndockPrivilege") &&
!GetSystemMetrics(SM_REMOTESESSION);
}
virtual BOOL