VirtualBox

Ignore:
Timestamp:
Mar 16, 2017 9:44:53 AM (8 years ago)
Author:
vboxsync
Message:

Main/svcmain: cleanups, make functions static and use IPRT where sensible/possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/win/svcmain.cpp

    r65543 r66121  
    3939#include <iprt/getopt.h>
    4040#include <iprt/message.h>
    41 #include <iprt\asm.h>
     41#include <iprt/asm.h>
    4242
    4343class CExeModule : public ATL::CComModule
     
    151151* This function defined starting from Vista only.
    152152*/
    153 BOOL ShutdownBlockReasonCreateAPI(HWND hWnd,LPCWSTR pwszReason)
     153static BOOL ShutdownBlockReasonCreateAPI(HWND hWnd, LPCWSTR pwszReason)
    154154{
    155155    BOOL fResult = FALSE;
     
    158158    PFNSHUTDOWNBLOCKREASONCREATE pfn = (PFNSHUTDOWNBLOCKREASONCREATE)GetProcAddress(
    159159            GetModuleHandle(L"User32.dll"), "ShutdownBlockReasonCreate");
    160     _ASSERTE(pfn);
     160    AssertPtrValid(pfn);
    161161    if (pfn)
    162162        fResult = pfn(hWnd, pwszReason);
     
    168168* This function defined starting from Vista only.
    169169*/
    170 BOOL ShutdownBlockReasonDestroyAPI(HWND hWnd)
     170static BOOL ShutdownBlockReasonDestroyAPI(HWND hWnd)
    171171{
    172172    BOOL fResult = FALSE;
     
    175175    PFNSHUTDOWNBLOCKREASONDESTROY pfn = (PFNSHUTDOWNBLOCKREASONDESTROY)GetProcAddress(
    176176        GetModuleHandle(L"User32.dll"), "ShutdownBlockReasonDestroy");
    177     _ASSERTE(pfn);
     177    AssertPtrValid(pfn);
    178178    if (pfn)
    179179        fResult = pfn(hWnd);
     
    181181}
    182182
    183 
    184 LRESULT CALLBACK WinMainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
     183static LRESULT CALLBACK WinMainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    185184{
    186185    LRESULT rc = 0;
     
    231230}
    232231
    233 
    234 int CreateMainWindow()
     232static int CreateMainWindow()
    235233{
    236234    int rc = VINF_SUCCESS;
    237     _ASSERTE(g_hMainWindow == NULL);
     235    Assert(g_hMainWindow == NULL);
    238236
    239237    LogFlow(("CreateMainWindow\n"));
     
    280278
    281279
    282 void DestroyMainWindow()
    283 {
    284     _ASSERTE(g_hMainWindow != NULL);
     280static void DestroyMainWindow()
     281{
     282    Assert(g_hMainWindow != NULL);
    285283    Log(("SVCMain: DestroyMainWindow \n"));
    286284    if (g_hMainWindow != NULL)
     
    333331    RTR3InitExe(argc, &argv, 0);
    334332
    335 
    336     /* Note that all options are given lowercase/camel case/uppercase to
    337      * approximate case insensitive matching, which RTGetOpt doesn't offer. */
    338333    static const RTGETOPTDEF s_aOptions[] =
    339334    {
     
    502497    int nRet = 0;
    503498    HRESULT hRes = com::Initialize(false /*fGui*/, fRun /*fAutoRegUpdate*/);
    504     _ASSERTE(SUCCEEDED(hRes));
     499    AssertLogRelMsg(SUCCEEDED(hRes), ("SVCMAIN: init failed: %Rhrc\n", hRes));
    505500
    506501    g_pModule = new CExeModule();
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