- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
158 lines
3.9 KiB
C++
158 lines
3.9 KiB
C++
//
|
|
//**************************************************************************
|
|
//
|
|
// BOleCMan.cpp -- Declares an IBClassMgr "factory" which can create Bolero
|
|
// helper objects.
|
|
//
|
|
// Since callers of BOleClassManager don't have the class
|
|
// definition, they can't call operator new to create a
|
|
// helper object.
|
|
//
|
|
// BOleClassMgr has a pointer to the service, so you need a
|
|
// BOleClassMgr for every Bolero connection you maintain.
|
|
//
|
|
// Copyright (c) 1993,94 by Borland International, Inc. All rights reserved
|
|
//
|
|
//**************************************************************************
|
|
|
|
#include "BOleCMan.h"
|
|
#include "BOleSvc.h"
|
|
#include "BOleDoc.h"
|
|
#include "BOleIPS.h"
|
|
#include "BOleSite.h"
|
|
#include "BOleCont.h"
|
|
#include "BOleData.h"
|
|
#include "BOleFact.h"
|
|
|
|
HRESULT _IFUNC BOleClassManager::QueryInterfaceMain(REFIID iid, LPVOID FAR *ppv)
|
|
{
|
|
HRESULT hr = ResultFromScode(E_NOINTERFACE);
|
|
*ppv = NULL;
|
|
|
|
// interfaces
|
|
SUCCEEDED(hr = IBClassMgr_QueryInterface(this, iid, ppv))
|
|
|
|
// base classes
|
|
|| SUCCEEDED(hr = BOleComponent::QueryInterfaceMain(iid, ppv))
|
|
|
|
// helpers
|
|
;
|
|
|
|
return hr;
|
|
}
|
|
|
|
|
|
BOleClassManager::BOleClassManager(IBUnknownMain *pObj) :
|
|
pSvc (NULLP), BOleComponent(this, pObj)
|
|
{
|
|
nServerCount = 0;
|
|
}
|
|
|
|
//
|
|
|
|
BOleClassManager::~BOleClassManager()
|
|
{
|
|
if (pSvc != NULLP) {
|
|
pSvc->ReleaseMain();
|
|
pSvc = NULLP;
|
|
}
|
|
|
|
OLE::OleUninitialize (); // Req'd to free OLE2's clipboard window
|
|
}
|
|
|
|
int _IFUNC BOleClassManager::ServerCount (int nDelta)
|
|
{
|
|
nServerCount += nDelta;
|
|
if (nServerCount == 0) {
|
|
if (pSvc && (nDelta != 0))
|
|
// call ShutdownMaybe on TRANSITION to 0
|
|
(pSvc->GetApplication())->ShutdownMaybe();
|
|
}
|
|
return nServerCount;
|
|
}
|
|
|
|
HRESULT _IFUNC BOleClassManager::ComponentCreate( PIUnknown FAR * ppObj, PIUnknown pO, BCID cid)
|
|
{
|
|
*ppObj = NULL;
|
|
PIBUnknownMain pOuter = AsPIUnknownMain(pO);
|
|
|
|
switch (cid) {
|
|
case cidBOleService:
|
|
{
|
|
if (pSvc != NULLP)
|
|
pSvc->ReleaseMain(); // ref count on helper (not aggregator)
|
|
pSvc = new BOleService(this, pOuter);
|
|
*ppObj = AsPIUnknown(pSvc);
|
|
if (pSvc != NULLP)
|
|
pSvc->AddRefMain();
|
|
break;
|
|
}
|
|
case cidBOleDocument:
|
|
{
|
|
if (pSvc != NULLP)
|
|
*ppObj = AsPIUnknown(new BOleDocument(this, pOuter, pSvc));
|
|
break;
|
|
}
|
|
case cidBOleContainer:
|
|
{
|
|
*ppObj = AsPIUnknown(new BOleContainer(this, pOuter));
|
|
break;
|
|
}
|
|
case cidBOlePart:
|
|
{
|
|
if (pSvc != NULLP)
|
|
*ppObj = AsPIUnknown(new BOlePart(this, pOuter, pSvc->pActiveDoc));
|
|
break;
|
|
}
|
|
case cidBOleSite:
|
|
{
|
|
*ppObj = AsPIUnknown(new BOleSite(this, pOuter, pSvc));
|
|
break;
|
|
}
|
|
case cidBOleInProcSite:
|
|
{
|
|
*ppObj = AsPIUnknown(new BOleInProcServer(this, pOuter, pSvc));
|
|
break;
|
|
}
|
|
case cidBOleInProcHandler:
|
|
{
|
|
*ppObj = AsPIUnknown(new BOleInProcHandler(this, pOuter, pSvc));
|
|
break;
|
|
}
|
|
case cidBOleData:
|
|
*ppObj = AsPIUnknown (new BOleData(this, pOuter));
|
|
break;
|
|
|
|
case cidBOleFactory:
|
|
// not aggregated directly by clients
|
|
// we create one on the clients behalf in IService::RegisterClass
|
|
// and release it in IService::UnregisterClass
|
|
{
|
|
*ppObj = AsPIUnknown (new BOleFact(this, pOuter));
|
|
break;
|
|
}
|
|
}
|
|
return (*ppObj) ? NOERROR : ResultFromScode (E_FAIL);
|
|
}
|
|
|
|
// CreateClassMgr -- This is the way to initiate a connection with Bolero.
|
|
// To help us be version-resilient, it's the only exported
|
|
// function which is visible to Bolero customers
|
|
//
|
|
extern "C"
|
|
|
|
HRESULT PASCAL FAR _export _loadds CreateClassMgr (
|
|
PIUnknown FAR *pCM,
|
|
PIUnknown pOuter,
|
|
IMalloc FAR *pMalloc)
|
|
{
|
|
OLE::OleInitialize(pMalloc);
|
|
*pCM = new BOleClassManager (AsPIUnknownMain(pOuter));
|
|
return (*pCM) ?NOERROR:ResultFromScode(E_OUTOFMEMORY);
|
|
}
|
|
|
|
|
|
|
|
|
|
|