Maintenance: Add mandatory field offset markers /* XXXX */ and assertions to Network headers (ConnectionBuffer, CURLMgr, PacketLength

Batch #1058 by ragnarok-clanker: no function's compiled code changes; checked with 28 compiled unit(s), including every includer of Source/Network/Connection/ConnectionBuffer.h, Source/Network/Http/CURLMgr.h, Source/Network/Packets/PacketLengths.h.
This commit is contained in:
ragnarok-clanker 2026-10-27 13:41:30 +00:00
commit bed005bc9d
3 changed files with 45 additions and 22 deletions

View file

@ -24,10 +24,10 @@ public:
}
private:
char* m_data;
int m_read;
int m_write;
std::vector<char> m_storage;
/* 0000 */ char* m_data;
/* 0004 */ int m_read;
/* 0008 */ int m_write;
/* 000C */ std::vector<char> m_storage;
ConnectionBuffer(const ConnectionBuffer&) = delete;
ConnectionBuffer& operator=(const ConnectionBuffer&) = delete;
};

View file

@ -1,6 +1,7 @@
#ifndef RAGNAROK_SOURCE_NETWORK_HTTP_CURLMGR_H
#define RAGNAROK_SOURCE_NETWORK_HTTP_CURLMGR_H
#include <cstddef>
#include <windows.h>
struct curl_slist;
@ -13,25 +14,38 @@ public:
static bool Initialize();
static void Shutdown();
int(__cdecl* globalInit)(long);
void(__cdecl* globalCleanup)();
curl_slist*(__cdecl* slistAppend)(curl_slist*, const char*);
int(__cdecl* formAdd)(curl_httppost**, curl_httppost**, ...);
void*(__cdecl* easyInit)();
int(__cdecl* easySetopt)(void*, int, ...);
int(__cdecl* easyPerform)(void*);
void(__cdecl* easyCleanup)(void*);
void(__cdecl* formFree)(curl_httppost*);
void(__cdecl* slistFreeAll)(curl_slist*);
int(__cdecl* easyGetinfo)(void*, int, ...);
bool m_enabled;
HMODULE m_module;
/* 0004 */ int(__cdecl* globalInit)(long);
/* 0008 */ void(__cdecl* globalCleanup)();
/* 000C */ curl_slist*(__cdecl* slistAppend)(curl_slist*, const char*);
/* 0010 */ int(__cdecl* formAdd)(curl_httppost**, curl_httppost**, ...);
/* 0014 */ void*(__cdecl* easyInit)();
/* 0018 */ int(__cdecl* easySetopt)(void*, int, ...);
/* 001C */ int(__cdecl* easyPerform)(void*);
/* 0020 */ void(__cdecl* easyCleanup)(void*);
/* 0024 */ void(__cdecl* formFree)(curl_httppost*);
/* 0028 */ void(__cdecl* slistFreeAll)(curl_slist*);
/* 002C */ int(__cdecl* easyGetinfo)(void*, int, ...);
/* 0030 */ bool m_enabled;
/* 0034 */ HMODULE m_module;
};
extern CCURLMgr* g_curlMgr;
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CCURLMgr) == 56);
static_assert(offsetof(CCURLMgr, globalInit) == 0x0004);
static_assert(offsetof(CCURLMgr, globalCleanup) == 0x0008);
static_assert(offsetof(CCURLMgr, slistAppend) == 0x000C);
static_assert(offsetof(CCURLMgr, formAdd) == 0x0010);
static_assert(offsetof(CCURLMgr, easyInit) == 0x0014);
static_assert(offsetof(CCURLMgr, easySetopt) == 0x0018);
static_assert(offsetof(CCURLMgr, easyPerform) == 0x001C);
static_assert(offsetof(CCURLMgr, easyCleanup) == 0x0020);
static_assert(offsetof(CCURLMgr, formFree) == 0x0024);
static_assert(offsetof(CCURLMgr, slistFreeAll) == 0x0028);
static_assert(offsetof(CCURLMgr, easyGetinfo) == 0x002C);
static_assert(offsetof(CCURLMgr, m_enabled) == 0x0030);
static_assert(offsetof(CCURLMgr, m_module) == 0x0034);
#endif
#endif

View file

@ -1,17 +1,18 @@
#ifndef RAGNAROK_SOURCE_NETWORK_PACKETS_PACKETLENGTHS_H
#define RAGNAROK_SOURCE_NETWORK_PACKETS_PACKETLENGTHS_H
#include <cstddef>
#include <map>
struct PacketLengthValue {
int length;
int variable;
int record;
/* 0000 */ int length;
/* 0004 */ int variable;
/* 0008 */ int record;
};
struct PacketLengthResult {
int kind;
int length;
/* 0000 */ int kind;
/* 0004 */ int length;
};
struct PacketLengths {
@ -22,4 +23,12 @@ struct PacketLengths {
static void Initialize(std::map<int, PacketLengthValue>& values);
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(PacketLengthValue) == 0x0C);
static_assert(offsetof(PacketLengthValue, variable) == 0x04);
static_assert(offsetof(PacketLengthValue, record) == 0x08);
static_assert(sizeof(PacketLengthResult) == 0x08);
static_assert(offsetof(PacketLengthResult, length) == 0x04);
#endif
#endif