VirtualBox

Ignore:
Timestamp:
Apr 29, 2016 2:26:58 PM (9 years ago)
Author:
vboxsync
Message:

API: stop using ATL and use a vastly smaller lookalike instead, plus a lot of cleanups

File:
1 edited

Legend:

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

    r59369 r60765  
    66
    77/*
    8  * Copyright (C) 2004-2013 Oracle Corporation
     8 * Copyright (C) 2004-2016 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#include <stdio.h>
    2121#include <stdlib.h>
     22#include <tchar.h>
    2223
    2324#include "VBox/com/defs.h"
     
    4142#include <iprt/message.h>
    4243
    43 #include <atlbase.h>
    44 #include <atlcom.h>
    45 
    46 #define _ATL_FREE_THREADED
    47 
    48 class CExeModule : public CComModule
     44class CExeModule : public ATL::CComModule
    4945{
    5046public:
     
    7066LONG CExeModule::Unlock()
    7167{
    72     LONG l = CComModule::Unlock();
     68    LONG l = ATL::CComModule::Unlock();
    7369    if (l == 0)
    7470    {
     
    9288        } while (dwWait == WAIT_OBJECT_0);
    9389        /* timed out */
    94         if (!bActivity && m_nLockCnt == 0) /* if no activity let's really bail */
     90        if (!bActivity && GetLockCount() == 0) /* if no activity let's really bail */
    9591        {
    9692            /* Disable log rotation at this point, worst case a log file
     
    114110                }
    115111            }
    116 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
     112#if _WIN32_WINNT >= 0x0400
    117113            CoSuspendClassObjects();
    118             if (!bActivity && m_nLockCnt == 0)
     114            if (!bActivity && GetLockCount() == 0)
    119115#endif
    120116                break;
     
    135131}
    136132
    137 CExeModule _Module;
     133static CExeModule _Module;
    138134
    139135BEGIN_OBJECT_MAP(ObjectMap)
     
    384380    {
    385381        _Module.StartMonitor();
    386 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
     382#if _WIN32_WINNT >= 0x0400
    387383        hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED);
    388384        _ASSERTE(SUCCEEDED(hRes));
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