mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-14 18:58:29 +12:00
Move to Endian agnostic read/write functions; add kernel
This commit is contained in:
parent
b8a83ab448
commit
1b7c4d8a2f
35 changed files with 468 additions and 222 deletions
|
@ -321,8 +321,8 @@ void coreinit_save(MemStreamWriter& s)
|
|||
s.writeSection("coreinit");
|
||||
|
||||
s.writeData(gCoreinitData, sizeof(coreinitData_t));
|
||||
s.writeBE(placeholderFont);
|
||||
s.writeBE(placeholderFontSize);
|
||||
s.write(placeholderFont);
|
||||
s.write(placeholderFontSize);
|
||||
|
||||
coreinit_Init_Save(s);
|
||||
coreinit::SysHeap_Save(s);
|
||||
|
@ -353,8 +353,8 @@ void coreinit_restore(MemStreamReader& s)
|
|||
coreinit::__OSDeleteAllActivePPCThreads();
|
||||
|
||||
s.readData(gCoreinitData, sizeof(coreinitData_t));
|
||||
s.readBE(placeholderFont);
|
||||
s.readBE(placeholderFontSize);
|
||||
s.read(placeholderFont);
|
||||
s.read(placeholderFontSize);
|
||||
|
||||
coreinit_Init_Restore(s);
|
||||
coreinit::SysHeap_Restore(s);
|
||||
|
|
|
@ -314,13 +314,13 @@ namespace coreinit
|
|||
s.writeMPTR(_g_alarmThreadStack);
|
||||
s.writeMPTR(_g_alarmThreadName);
|
||||
|
||||
s.writeBE(coreinit_getOSTime());
|
||||
s.write(coreinit_getOSTime());
|
||||
|
||||
s.writeBE((uint64)g_activeAlarms.size());
|
||||
s.write((uint64)g_activeAlarms.size());
|
||||
for (auto& itr : g_activeAlarms)
|
||||
{
|
||||
s.writeBE(memory_getVirtualOffsetFromPointer(itr.first));
|
||||
s.writeBE(itr.second->getNextFire());
|
||||
s.write(memory_getVirtualOffsetFromPointer(itr.first));
|
||||
s.write(itr.second->getNextFire());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,12 +336,12 @@ namespace coreinit
|
|||
s.readMPTR(_g_alarmThreadName);
|
||||
|
||||
uint64 currentTime = coreinit_getOSTime();
|
||||
uint64_t timeOffset = currentTime - s.readBE<uint64_t>();
|
||||
uint64_t timeOffset = currentTime - s.read<uint64_t>();
|
||||
|
||||
size_t alms = s.readBE<uint64>();
|
||||
size_t alms = s.read<uint64>();
|
||||
for (size_t alm = 0; alm < alms; alm++)
|
||||
{
|
||||
OSAlarm_t* alarm = (OSAlarm_t*)memory_getPointerFromVirtualOffset(s.readBE<MPTR>());
|
||||
OSAlarm_t* alarm = (OSAlarm_t*)memory_getPointerFromVirtualOffset(s.read<MPTR>());
|
||||
|
||||
uint64 startTime = _swapEndianU64(alarm->startTime) + timeOffset;
|
||||
uint64 nextTime = _swapEndianU64(alarm->nextTime) + timeOffset;
|
||||
|
@ -360,7 +360,7 @@ namespace coreinit
|
|||
}
|
||||
alarm->nextTime = _swapEndianU64(nextTime);
|
||||
|
||||
uint64 nextFire = s.readBE<uint64>() + timeOffset;
|
||||
uint64 nextFire = s.read<uint64>() + timeOffset;
|
||||
__OSLockScheduler();
|
||||
g_activeAlarms[alarm] = OSHostAlarmCreate(nextFire, period, __OSHostAlarmTriggered, nullptr);
|
||||
__OSUnlockScheduler();
|
||||
|
|
|
@ -132,19 +132,19 @@ namespace coreinit
|
|||
void DynLoad_Save(MemStreamWriter& s)
|
||||
{
|
||||
s.writeSection("coreinit_DynLoad");
|
||||
s.writeBE(_osDynLoadFuncAlloc);
|
||||
s.writeBE(_osDynLoadFuncFree);
|
||||
s.writeBE(_osDynLoadTLSFuncAlloc);
|
||||
s.writeBE(_osDynLoadTLSFuncFree);
|
||||
s.write(_osDynLoadFuncAlloc);
|
||||
s.write(_osDynLoadFuncFree);
|
||||
s.write(_osDynLoadTLSFuncAlloc);
|
||||
s.write(_osDynLoadTLSFuncFree);
|
||||
}
|
||||
|
||||
void DynLoad_Restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("coreinit_DynLoad");
|
||||
s.readBE(_osDynLoadFuncAlloc);
|
||||
s.readBE(_osDynLoadFuncFree);
|
||||
s.readBE(_osDynLoadTLSFuncAlloc);
|
||||
s.readBE(_osDynLoadTLSFuncFree);
|
||||
s.read(_osDynLoadFuncAlloc);
|
||||
s.read(_osDynLoadFuncFree);
|
||||
s.read(_osDynLoadTLSFuncAlloc);
|
||||
s.read(_osDynLoadTLSFuncFree);
|
||||
}
|
||||
|
||||
void InitializeDynLoad()
|
||||
|
|
|
@ -220,16 +220,16 @@ void coreinit_Init_Save(MemStreamWriter& s)
|
|||
{
|
||||
s.writeSection("coreinit_Init");
|
||||
s.writeData(_coreinitInfo, sizeof(coreinitInit_t));
|
||||
s.writeBE(argStorageIndex);
|
||||
s.write(argStorageIndex);
|
||||
s.writeMPTR(g_preinitUserParam);
|
||||
s.writeBE(_coreinitTitleEntryPoint);
|
||||
s.write(_coreinitTitleEntryPoint);
|
||||
}
|
||||
|
||||
void coreinit_Init_Restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("coreinit_Init");
|
||||
s.readData(_coreinitInfo, sizeof(coreinitInit_t));
|
||||
s.readBE(argStorageIndex);
|
||||
s.read(argStorageIndex);
|
||||
s.readMPTR(g_preinitUserParam);
|
||||
s.readBE(_coreinitTitleEntryPoint);
|
||||
s.read(_coreinitTitleEntryPoint);
|
||||
}
|
|
@ -276,7 +276,7 @@ namespace coreinit
|
|||
s.writeSection("coreinit_LockedCache");
|
||||
s.writeData(lcCacheMask, sizeof(uint8) * PPC_CORE_COUNT * (LC_LOCKED_CACHE_SIZE + LC_LOCKED_CACHE_GRANULARITY - 1) / LC_LOCKED_CACHE_GRANULARITY);
|
||||
s.writeData(lcAllocatedBlocks, sizeof(uint32) * PPC_CORE_COUNT);
|
||||
s.writeBE(_lcDisableErrorCounter);
|
||||
s.write(_lcDisableErrorCounter);
|
||||
}
|
||||
|
||||
void LockedCache_Restore(MemStreamReader& s)
|
||||
|
@ -284,7 +284,7 @@ namespace coreinit
|
|||
s.readSection("coreinit_LockedCache");
|
||||
s.readData(lcCacheMask, sizeof(uint8) * PPC_CORE_COUNT * (LC_LOCKED_CACHE_SIZE + LC_LOCKED_CACHE_GRANULARITY - 1) / LC_LOCKED_CACHE_GRANULARITY);
|
||||
s.readData(lcAllocatedBlocks, sizeof(uint32) * PPC_CORE_COUNT);
|
||||
s.readBE(_lcDisableErrorCounter);
|
||||
s.read(_lcDisableErrorCounter);
|
||||
}
|
||||
|
||||
void InitializeLC()
|
||||
|
|
|
@ -633,8 +633,8 @@ namespace coreinit
|
|||
void MEM_Save(MemStreamWriter& s)
|
||||
{
|
||||
s.writeSection("coreinit_MEM");
|
||||
s.writeBE(sysAreaAllocatorOffset);
|
||||
s.writeBE(g_heapTableCount);
|
||||
s.write(sysAreaAllocatorOffset);
|
||||
s.write(g_heapTableCount);
|
||||
s.writeData(g_heapTable, sizeof(MEMHeapBase) * MEM_MAX_HEAP_TABLE);
|
||||
s.writeBool(g_slockInitialized);
|
||||
s.writeBool(g_listsInitialized);
|
||||
|
@ -651,8 +651,8 @@ namespace coreinit
|
|||
void MEM_Restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("coreinit_MEM");
|
||||
s.readBE(sysAreaAllocatorOffset);
|
||||
s.readBE(g_heapTableCount);
|
||||
s.read(sysAreaAllocatorOffset);
|
||||
s.read(g_heapTableCount);
|
||||
s.readData(g_heapTable, sizeof(MEMHeapBase) * MEM_MAX_HEAP_TABLE);
|
||||
s.readBool(g_slockInitialized);
|
||||
s.readBool(g_listsInitialized);
|
||||
|
|
|
@ -155,26 +155,25 @@ namespace coreinit
|
|||
|
||||
void MemoryMapping_Save(MemStreamWriter& s)
|
||||
{
|
||||
s.writeSection("coreinit_MemoryMapping ");
|
||||
s.writeBE<uint32>(s_allocatedVirtMemory.size());
|
||||
s.writeSection("coreinit_MemoryMapping");
|
||||
s.write<uint32>(s_allocatedVirtMemory.size());
|
||||
for (auto i : s_allocatedVirtMemory)
|
||||
{
|
||||
s.writeBE(i.virtualAddress);
|
||||
s.writeBE(i.size);
|
||||
s.writeBE(i.alignment);
|
||||
s.write(i.virtualAddress);
|
||||
s.write(i.size);
|
||||
s.write(i.alignment);
|
||||
}
|
||||
}
|
||||
|
||||
void MemoryMapping_Restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("coreinit_MemoryMapping ");
|
||||
s.readPODVector(s_allocatedVirtMemory);
|
||||
uint32 s_allocatedVirtMemorySize = s.readBE<uint32>();
|
||||
s.readSection("coreinit_MemoryMapping");
|
||||
uint32 s_allocatedVirtMemorySize = s.read<uint32>();
|
||||
s_allocatedVirtMemory.clear();
|
||||
s_allocatedVirtMemory.reserve(s_allocatedVirtMemorySize);
|
||||
for (sint32 i = 0; i < s_allocatedVirtMemorySize; i++)
|
||||
{
|
||||
s_allocatedVirtMemory.push_back(OSVirtMemoryEntry(s.readBE<MPTR>(), s.readBE<uint32>(), s.readBE<uint32>()));
|
||||
s_allocatedVirtMemory.push_back(OSVirtMemoryEntry(s.read<MPTR>(), s.read<uint32>(), s.read<uint32>()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,16 +36,16 @@ namespace coreinit
|
|||
{
|
||||
s.writeSection("coreinit_SysHeap");
|
||||
s.writeData(_sysHeapHandle, sizeof(MEMHeapBase));
|
||||
s.writeBE(_sysHeapAllocCounter);
|
||||
s.writeBE(_sysHeapFreeCounter);
|
||||
s.write(_sysHeapAllocCounter);
|
||||
s.write(_sysHeapFreeCounter);
|
||||
}
|
||||
|
||||
void SysHeap_Restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("coreinit_SysHeap");
|
||||
s.readData(_sysHeapHandle, sizeof(MEMHeapBase));
|
||||
s.readBE(_sysHeapAllocCounter);
|
||||
s.readBE(_sysHeapFreeCounter);
|
||||
s.read(_sysHeapAllocCounter);
|
||||
s.read(_sysHeapFreeCounter);
|
||||
}
|
||||
|
||||
void InitializeSysHeap()
|
||||
|
|
|
@ -1335,19 +1335,19 @@ namespace coreinit
|
|||
{
|
||||
s.writeSection("coreinit_Thread");
|
||||
|
||||
s.writeBE((uint8)sSchedulerActive.load());
|
||||
s.write((uint8)sSchedulerActive.load());
|
||||
s.writeMPTR(g_activeThreadQueue);
|
||||
s.writeMPTR(g_coreRunQueue);
|
||||
|
||||
s.writeBE(activeThreadCount);
|
||||
s.write(activeThreadCount);
|
||||
for (sint32 i = 0; i < activeThreadCount; i++)
|
||||
{
|
||||
s.writeBE(activeThread[i]);
|
||||
s.write(activeThread[i]);
|
||||
}
|
||||
for (sint32 i = 0; i < PPC_CORE_COUNT; i++)
|
||||
{
|
||||
s.writePTR(__currentCoreThread[i]);
|
||||
s.writeBE(s_lehmer_lcg[i]);
|
||||
s.write(s_lehmer_lcg[i]);
|
||||
s.writeMPTR(s_terminatorThreads[i].terminatorThread);
|
||||
s.writeMPTR(s_terminatorThreads[i].threadStack);
|
||||
s.writeMPTR(s_terminatorThreads[i].threadName);
|
||||
|
@ -1362,14 +1362,14 @@ namespace coreinit
|
|||
{
|
||||
s.readSection("coreinit_Thread");
|
||||
|
||||
sSchedulerActive.store(s.readBE<uint8>());
|
||||
sSchedulerActive.store(s.read<uint8>());
|
||||
s.readMPTR(g_activeThreadQueue);
|
||||
s.readMPTR(g_coreRunQueue);
|
||||
|
||||
sint32 prevActiveThreadCount = s.readBE<sint32>();
|
||||
sint32 prevActiveThreadCount = s.read<sint32>();
|
||||
for (sint32 i = 0; i < prevActiveThreadCount; i++)
|
||||
{
|
||||
MPTR threadMPTR = s.readBE<MPTR>();
|
||||
MPTR threadMPTR = s.read<MPTR>();
|
||||
if (recreate)
|
||||
{
|
||||
__OSLockScheduler();
|
||||
|
@ -1385,7 +1385,7 @@ namespace coreinit
|
|||
for (sint32 i = 0; i < PPC_CORE_COUNT; i++)
|
||||
{
|
||||
s.readPTR(__currentCoreThread[i]);
|
||||
s.readBE(s_lehmer_lcg[i]);
|
||||
s.read(s_lehmer_lcg[i]);
|
||||
s.readMPTR(s_terminatorThreads[i].terminatorThread);
|
||||
s.readMPTR(s_terminatorThreads[i].threadStack);
|
||||
s.readMPTR(s_terminatorThreads[i].threadName);
|
||||
|
|
|
@ -111,13 +111,13 @@ void dmaeExport_DMAEGetRetiredTimeStamp(PPCInterpreter_t* hCPU)
|
|||
void dmae_save(MemStreamWriter& s)
|
||||
{
|
||||
s.writeSection("dmae");
|
||||
s.writeBE(dmaeRetiredTimestamp);
|
||||
s.write(dmaeRetiredTimestamp);
|
||||
}
|
||||
|
||||
void dmae_restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("dmae");
|
||||
s.readBE(dmaeRetiredTimestamp);
|
||||
s.read(dmaeRetiredTimestamp);
|
||||
}
|
||||
|
||||
void dmae_load()
|
||||
|
|
|
@ -1357,7 +1357,7 @@ void export_curl_global_init_mem(PPCInterpreter_t* hCPU)
|
|||
void save(MemStreamWriter& s)
|
||||
{
|
||||
s.writeSection("nlibcurl");
|
||||
s.writeBE(g_nlibcurl.initialized);
|
||||
s.write(g_nlibcurl.initialized);
|
||||
s.writeMPTR(g_nlibcurl.proxyConfig);
|
||||
s.writeMPTR(g_nlibcurl.malloc);
|
||||
s.writeMPTR(g_nlibcurl.free);
|
||||
|
@ -1368,7 +1368,7 @@ void save(MemStreamWriter& s)
|
|||
void restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("nlibcurl");
|
||||
s.readBE(g_nlibcurl.initialized);
|
||||
s.read(g_nlibcurl.initialized);
|
||||
s.readMPTR(g_nlibcurl.proxyConfig);
|
||||
s.readMPTR(g_nlibcurl.malloc);
|
||||
s.readMPTR(g_nlibcurl.free);
|
||||
|
|
|
@ -667,14 +667,14 @@ void nnActExport_AcquirePrincipalIdByAccountId(PPCInterpreter_t* hCPU)
|
|||
void nnAct_save(MemStreamWriter& s)
|
||||
{
|
||||
s.writeSection("nn_act");
|
||||
s.writeBE(nn::act::g_initializeCount);
|
||||
s.writeBE((uint32)g_isParentalControlCheckEnabled);
|
||||
s.write(nn::act::g_initializeCount);
|
||||
s.write((uint32)g_isParentalControlCheckEnabled);
|
||||
}
|
||||
void nnAct_restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("nn_act");
|
||||
s.readBE(nn::act::g_initializeCount);
|
||||
g_isParentalControlCheckEnabled = s.readBE<uint32>();
|
||||
s.read(nn::act::g_initializeCount);
|
||||
g_isParentalControlCheckEnabled = s.read<uint32>();
|
||||
}
|
||||
|
||||
// register account functions
|
||||
|
|
|
@ -152,10 +152,10 @@ namespace nn
|
|||
void save(MemStreamWriter& s)
|
||||
{
|
||||
s.writeSection("nn_aoc");
|
||||
s.writeBE<uint32>(sAocCache.size());
|
||||
s.write<uint32>(sAocCache.size());
|
||||
for (auto i : sAocCache)
|
||||
{
|
||||
s.writeBE(i.aocTitleId);
|
||||
s.write(i.aocTitleId);
|
||||
}
|
||||
s.writeBool(sAocCacheGenerated);
|
||||
}
|
||||
|
@ -163,12 +163,12 @@ namespace nn
|
|||
void restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("nn_aoc");
|
||||
uint32 sAocCacheSize = s.readBE<uint32>();
|
||||
uint32 sAocCacheSize = s.read<uint32>();
|
||||
sAocCache.clear();
|
||||
sAocCache.reserve(sAocCacheSize);
|
||||
for (sint32 i = 0; i < sAocCacheSize; i++)
|
||||
{
|
||||
sAocCache.emplace_back(s.readBE<uint64>());
|
||||
sAocCache.emplace_back(s.read<uint64>());
|
||||
}
|
||||
s.readBool(sAocCacheGenerated);
|
||||
}
|
||||
|
|
|
@ -1718,7 +1718,7 @@ void nnBoss_save(MemStreamWriter& s)
|
|||
{
|
||||
s.writeSection("nn_boss");
|
||||
s.writeMPTR(nn::boss::g_mutex);
|
||||
s.writeBE(nn::boss::g_initCounter);
|
||||
s.write(nn::boss::g_initCounter);
|
||||
s.writeBool(nn::boss::g_isInitialized);
|
||||
}
|
||||
|
||||
|
@ -1726,7 +1726,7 @@ void nnBoss_restore(MemStreamReader& s)
|
|||
{
|
||||
s.readSection("nn_boss");
|
||||
s.readMPTR(nn::boss::g_mutex);
|
||||
s.readBE(nn::boss::g_initCounter);
|
||||
s.read(nn::boss::g_initCounter);
|
||||
s.readBool(nn::boss::g_isInitialized);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,14 +78,14 @@ namespace nn
|
|||
{
|
||||
s.writeSection("nn_ndm");
|
||||
s.writeData(s_daemonStatus, sizeof(DAEMON_STATUS) * NUM_DAEMONS);
|
||||
s.writeBE(s_initializeRefCount);
|
||||
s.write(s_initializeRefCount);
|
||||
}
|
||||
|
||||
void restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("nn_ndm");
|
||||
s.readData(s_daemonStatus, sizeof(DAEMON_STATUS) * NUM_DAEMONS);
|
||||
s.readBE(s_initializeRefCount);
|
||||
s.read(s_initializeRefCount);
|
||||
}
|
||||
|
||||
void load()
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace nn
|
|||
s.writeMPTR(s_OlvReleaseBgThreadName);
|
||||
s.writeData(&g_ParamPack, sizeof(ParamPackStorage));
|
||||
s.writeData(&g_DiscoveryResults, sizeof(DiscoveryResultStorage));
|
||||
s.writeBE(g_ReportTypes);
|
||||
s.write(g_ReportTypes);
|
||||
s.writeBool(g_IsInitialized);
|
||||
s.writeBool(g_IsOnlineMode);
|
||||
s.writeBool(g_IsOfflineDBMode);
|
||||
|
@ -133,7 +133,7 @@ namespace nn
|
|||
s.readMPTR(s_OlvReleaseBgThreadName);
|
||||
s.readData(&g_ParamPack, sizeof(ParamPackStorage));
|
||||
s.readData(&g_DiscoveryResults, sizeof(DiscoveryResultStorage));
|
||||
s.readBE(g_ReportTypes);
|
||||
s.read(g_ReportTypes);
|
||||
s.readBool(g_IsInitialized);
|
||||
s.readBool(g_IsOnlineMode);
|
||||
s.readBool(g_IsOfflineDBMode);
|
||||
|
|
|
@ -19,13 +19,13 @@ namespace nn::temp
|
|||
void save(MemStreamWriter& s)
|
||||
{
|
||||
s.writeSection("nn_temp");
|
||||
s.writeBE(tempIdGenerator);
|
||||
s.write(tempIdGenerator);
|
||||
}
|
||||
|
||||
void restore(MemStreamReader& s)
|
||||
{
|
||||
s.readSection("nn_temp");
|
||||
s.readBE(tempIdGenerator);
|
||||
s.read(tempIdGenerator);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
|
|
|
@ -818,9 +818,9 @@ namespace nsyshid
|
|||
s.writeSection("nsyshid");
|
||||
s.writeData(firstDevice, sizeof(HIDDeviceInfo_t));
|
||||
s.writeData(firstHIDClient, sizeof(HIDClient_t));
|
||||
s.writeBE(_lastGeneratedHidHandle);
|
||||
s.write(_lastGeneratedHidHandle);
|
||||
s.writeMPTR(_devicePool);
|
||||
s.writeBE(_devicePoolMask.count());
|
||||
s.write(_devicePoolMask.count());
|
||||
}
|
||||
|
||||
void restore(MemStreamReader& s)
|
||||
|
@ -828,10 +828,10 @@ namespace nsyshid
|
|||
s.readSection("nsyshid");
|
||||
s.readData(firstDevice, sizeof(HIDDeviceInfo_t));
|
||||
s.readData(firstHIDClient, sizeof(HIDClient_t));
|
||||
s.readBE(_lastGeneratedHidHandle);
|
||||
s.read(_lastGeneratedHidHandle);
|
||||
s.readMPTR(_devicePool);
|
||||
_devicePoolMask.reset();
|
||||
for (size_t i = 0; i < s.readBE<size_t>(); i++)
|
||||
for (size_t i = 0; i < s.read<size_t>(); i++)
|
||||
_devicePoolMask.set(i);
|
||||
}
|
||||
|
||||
|
|
|
@ -2162,34 +2162,34 @@ namespace nsysnet
|
|||
}
|
||||
|
||||
template<>
|
||||
void MemStreamWriter::writeBE(const nsysnet::NSSLInternalState_t& v)
|
||||
void MemStreamWriter::write(const nsysnet::NSSLInternalState_t& v)
|
||||
{
|
||||
writeBool(v.destroyed);
|
||||
writeBE(v.sslVersion);
|
||||
writeBE(v.clientPKI);
|
||||
write(v.sslVersion);
|
||||
write(v.clientPKI);
|
||||
|
||||
writeBE<uint32>(v.serverPKIs.size());
|
||||
write<uint32>(v.serverPKIs.size());
|
||||
for (auto i : v.serverPKIs)
|
||||
writeBE<uint32>(i);
|
||||
write<uint32>(i);
|
||||
|
||||
writeBE<uint32>(v.serverCustomPKIs.size());
|
||||
write<uint32>(v.serverCustomPKIs.size());
|
||||
for (auto i : v.serverCustomPKIs)
|
||||
writePODVector(i);
|
||||
}
|
||||
|
||||
template<>
|
||||
void MemStreamReader::readBE(nsysnet::NSSLInternalState_t& v)
|
||||
void MemStreamReader::read(nsysnet::NSSLInternalState_t& v)
|
||||
{
|
||||
readBool(v.destroyed);
|
||||
readBE(v.sslVersion);
|
||||
readBE(v.clientPKI);
|
||||
read(v.sslVersion);
|
||||
read(v.clientPKI);
|
||||
|
||||
uint32 serverPKIsSize = readBE<uint32>();
|
||||
uint32 serverPKIsSize = read<uint32>();
|
||||
v.serverPKIs.clear();
|
||||
for (uint32 i = 0; i < serverPKIsSize; i++)
|
||||
v.serverPKIs.insert(readBE<uint32>());
|
||||
v.serverPKIs.insert(read<uint32>());
|
||||
|
||||
uint32 serverCustomPKIsSize = readBE<uint32>();
|
||||
uint32 serverCustomPKIsSize = read<uint32>();
|
||||
v.serverCustomPKIs.clear();
|
||||
v.serverCustomPKIs.resize(serverCustomPKIsSize);
|
||||
for (uint32 i = 0; i < serverCustomPKIsSize; i++)
|
||||
|
@ -2208,9 +2208,9 @@ void nsysnet_save(MemStreamWriter& s)
|
|||
s.writeMPTR(_staticHostentName);
|
||||
s.writeMPTR(_staticHostentPtrList);
|
||||
s.writeMPTR(_staticHostentEntries);
|
||||
s.writeBE<uint32>(nsysnet::g_nsslInternalStates.size());
|
||||
s.write<uint32>(nsysnet::g_nsslInternalStates.size());
|
||||
for (auto i : nsysnet::g_nsslInternalStates)
|
||||
s.writeBE(i);
|
||||
s.write(i);
|
||||
s.writeBool(sockLibReady);
|
||||
s.writeData(virtualSocketTable, sizeof(virtualSocket_t) * WU_SOCKET_LIMIT);
|
||||
}
|
||||
|
@ -2223,13 +2223,13 @@ void nsysnet_restore(MemStreamReader& s)
|
|||
s.readMPTR(_staticHostentName);
|
||||
s.readMPTR(_staticHostentPtrList);
|
||||
s.readMPTR(_staticHostentEntries);
|
||||
uint32 g_nsslInternalStatesSize = s.readBE<uint32>();
|
||||
uint32 g_nsslInternalStatesSize = s.read<uint32>();
|
||||
nsysnet::g_nsslInternalStates.clear();
|
||||
nsysnet::g_nsslInternalStates.resize(g_nsslInternalStatesSize);
|
||||
for (uint32 i = 0; i < g_nsslInternalStatesSize; i++)
|
||||
{
|
||||
nsysnet::NSSLInternalState_t t;
|
||||
s.readBE(t);
|
||||
s.read(t);
|
||||
nsysnet::g_nsslInternalStates.push_back(t);
|
||||
}
|
||||
s.readBool(sockLibReady);
|
||||
|
|
|
@ -754,9 +754,9 @@ namespace padscore
|
|||
s.writeBool(g_kpadIsInited);
|
||||
s.writeData(&g_padscore, sizeof(g_padscore_t));
|
||||
s.writeData(g_kpad_ringbuffer, sizeof(KPADUnifiedWpadStatus_t));
|
||||
s.writeBE(g_kpad_ringbuffer_length);
|
||||
s.write(g_kpad_ringbuffer_length);
|
||||
s.writeBool(g_wpad_callback_by_kpad);
|
||||
s.writeBE((uint32)g_wpad_state);
|
||||
s.write((uint32)g_wpad_state);
|
||||
}
|
||||
|
||||
void restore(MemStreamReader& s)
|
||||
|
@ -766,9 +766,9 @@ namespace padscore
|
|||
s.readBool(g_kpadIsInited);
|
||||
s.readData(&g_padscore, sizeof(g_padscore_t));
|
||||
s.readData(g_kpad_ringbuffer, sizeof(KPADUnifiedWpadStatus_t));
|
||||
s.readBE(g_kpad_ringbuffer_length);
|
||||
s.read(g_kpad_ringbuffer_length);
|
||||
s.readBool(g_wpad_callback_by_kpad);
|
||||
g_wpad_state = (WPADState_t)s.readBE<uint32>();
|
||||
g_wpad_state = (WPADState_t)s.read<uint32>();
|
||||
}
|
||||
|
||||
void load()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue