rodecomp/Source/Utility/Async/NMessageQueue.h
ragnarok-clanker 18ed8cc485 Decompile 3 functions in Source/Utility/Async/NAsyncWorkThread.cpp, Source/Utility/Async/NAsyncWorkThread.h, ...
Batch #12020 by Yommy: 3 byte-identical, 0 confirmed by peer review.

- fn_07584 NAsyncWorkThread::Receive: byte-identical
- fn_07583 NAsyncWorkThread::RequestStop: byte-identical
- fn_07613 NMessageMgr::Send: byte-identical

Merged automatically: every function is byte-identical to the original.
2026-11-05 08:35:00 +00:00

55 lines
1.4 KiB
C++

#ifndef RAGNAROK_SOURCE_UTILITY_ASYNC_NMESSAGEQUEUE_H
#define RAGNAROK_SOURCE_UTILITY_ASYNC_NMESSAGEQUEUE_H
#include <cstddef>
#include <cstdint>
#include <deque>
#include <windows.h>
struct NMessage {
NMessage() : id(0), argumentHigh(0), argumentLow(0), valid(false) {
}
NMessage(std::uint32_t id, std::uint32_t argumentHigh, std::uint32_t argumentLow)
: id(id), argumentHigh(argumentHigh), argumentLow(argumentLow), valid(true) {
}
/* 0000 */ std::uint32_t id;
/* 0004 */ std::uint32_t argumentHigh;
/* 0008 */ std::uint32_t argumentLow;
/* 000C */ bool valid;
};
class NMessageQueue {
friend class NAsyncWorkThread;
public:
NMessageQueue();
virtual ~NMessageQueue();
NMessage Pop();
void Push(std::uint32_t argumentLow, std::uint32_t argumentHigh, std::uint32_t id);
void Clear();
protected:
struct Record {
/* 0000 */ std::uint32_t argumentLow;
/* 0004 */ std::uint32_t argumentHigh;
/* 0008 */ std::uint32_t id;
};
/* 0004 */ CRITICAL_SECTION m_criticalSection;
/* 001C */ std::deque<Record> m_messages;
/* 0030 */ HANDLE m_semaphore;
/* 0034 */ bool m_enabled;
};
static_assert(sizeof(NMessage) == 16);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(NMessage, argumentHigh) == 4);
static_assert(offsetof(NMessage, argumentLow) == 8);
static_assert(offsetof(NMessage, valid) == 12);
static_assert(sizeof(NMessageQueue) == 56);
#endif
#endif