Initial commit: Complete open-source Decal rebuild
All 5 phases of the open-source Decal rebuild: Phase 1: 14 decompiled .NET projects (Interop.*, Adapter, FileService, DecalUtil) Phase 2: 10 native DLLs rewritten as C# COM servers with matching GUIDs - DecalDat, DHS, SpellFilter, DecalInput, DecalNet, DecalFilters - Decal.Core, DecalControls, DecalRender, D3DService Phase 3: C++ shims for Inject.DLL (D3D9 hooking) and LauncherHook.DLL Phase 4: DenAgent WinForms tray application Phase 5: WiX installer and build script 25 C# projects building with 0 errors. Native C++ projects require VS 2022 + Windows SDK (x86). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
d1442e3747
1382 changed files with 170725 additions and 0 deletions
90
Native/DecalNet/MessageRoot.h
Normal file
90
Native/DecalNet/MessageRoot.h
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
// MessageRoot.h : Declaration of the cMessageRoot
|
||||
|
||||
#ifndef __MESSAGEROOT_H_
|
||||
#define __MESSAGEROOT_H_
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include "MessageImpl.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// cMessageRoot
|
||||
class ATL_NO_VTABLE cMessageRoot :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public CComCoClass<cMessageRoot, &CLSID_MessageRoot>,
|
||||
public IMessageIteratorImpl< cMessageRoot >
|
||||
{
|
||||
public:
|
||||
cMessageRoot()
|
||||
{
|
||||
}
|
||||
|
||||
cMessage *m_pSource;
|
||||
|
||||
cMessage *getSource()
|
||||
{
|
||||
return m_pSource;
|
||||
}
|
||||
|
||||
DWORD getStartIndex()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD getEndIndex()
|
||||
{
|
||||
return m_pSource->m_fields.size();
|
||||
}
|
||||
|
||||
DWORD getNextIndex()
|
||||
{
|
||||
if( m_nIndex != -1 )
|
||||
return getNextIndex( m_dwIterator );
|
||||
|
||||
DWORD dwIterator = getStartIndex();
|
||||
|
||||
while( dwIterator == m_pSource->m_fields.size() )
|
||||
{
|
||||
if( !m_pSource->loadNextElement() )
|
||||
return eEndIndex;
|
||||
}
|
||||
|
||||
return dwIterator;
|
||||
}
|
||||
|
||||
DWORD getNextIndex( DWORD dwIndex )
|
||||
{
|
||||
// Calculate the next index
|
||||
DWORD dwNextIndex = dwIndex + ( m_pSource->m_fields.begin() + dwIndex )->m_nOwns;
|
||||
|
||||
// Insert this loop to make sure the cracking is done far enough ahead
|
||||
// This is a loop because it's entirely possible that loading a message element
|
||||
// will produce no fields (it's a rule that dosen't apply)
|
||||
while( dwNextIndex == m_pSource->m_fields.size() )
|
||||
{
|
||||
if( !m_pSource->loadNextElement() )
|
||||
return eEndIndex;
|
||||
}
|
||||
|
||||
return dwNextIndex;
|
||||
}
|
||||
|
||||
void init( cMessage *pSource )
|
||||
{
|
||||
m_pSource = pSource;
|
||||
IMessageIteratorImpl< cMessageRoot >::init();
|
||||
}
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_MESSAGEROOT)
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
BEGIN_COM_MAP(cMessageRoot)
|
||||
COM_INTERFACE_ENTRY(IMessageIterator)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
END_COM_MAP()
|
||||
|
||||
public:
|
||||
};
|
||||
|
||||
#endif //__MESSAGEROOT_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue