VirtualBox

Ignore:
Timestamp:
Dec 21, 2022 9:56:31 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154937
Message:

FE/VBoxAutostart-win: Fix giving the dependencies as com::Bstr doesn't handle double null terminated strings and CreateServcieW() would scan pas the string end to find the double termination, ticketref:21349

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp

    r96407 r97851  
    775775            com::Bstr bstrUserFullName(sUserFullName);
    776776            com::Bstr bstrPwd(strPwd);
    777             com::Bstr bstrDependencies("Winmgmt\0RpcSs\0\0");
    778777
    779778            SC_HANDLE hSvc = CreateServiceW(hSCM,                            /* hSCManager */
     
    787786                                            NULL,                            /* lpLoadOrderGroup */
    788787                                            NULL,                            /* lpdwTagId */
    789                                             bstrDependencies.raw(),          /* lpDependencies */
     788                                            L"Winmgmt\0RpcSs\0\0",           /* lpDependencies */
    790789                                            bstrUserFullName.raw(),          /* lpServiceStartName (NULL => LocalSystem) */
    791790                                            bstrPwd.raw());                  /* lpPassword */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette