Fix pc/pm
Signed-off-by: szdytom <szdytom@qq.com>
This commit is contained in:
parent
45b67a2274
commit
fef044743b
@ -2,6 +2,17 @@
|
|||||||
|
|
||||||
ProcedureManager::ProcedureManager() {}
|
ProcedureManager::ProcedureManager() {}
|
||||||
|
|
||||||
|
struct ProcedureCallHeader {
|
||||||
|
uint64_t rd;
|
||||||
|
int32_t method;
|
||||||
|
uint32_t len;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ProcedureReturnHeader {
|
||||||
|
uint64_t rd;
|
||||||
|
uint32_t len;
|
||||||
|
};
|
||||||
|
|
||||||
void ProcedureManager::handleCall(FILE *in, FILE *out) const {
|
void ProcedureManager::handleCall(FILE *in, FILE *out) const {
|
||||||
ProcedureCallHeader header;
|
ProcedureCallHeader header;
|
||||||
auto ptr = reinterpret_cast<byte*>(&header);
|
auto ptr = reinterpret_cast<byte*>(&header);
|
||||||
@ -18,6 +29,10 @@ void ProcedureManager::handleCall(FILE *in, FILE *out) const {
|
|||||||
delete[] buf;
|
delete[] buf;
|
||||||
if (procedures.count(header.method)) {
|
if (procedures.count(header.method)) {
|
||||||
auto res = procedures.at(header.method)(bb);
|
auto res = procedures.at(header.method)(bb);
|
||||||
|
ProcedureReturnHeader rh;
|
||||||
|
rh.rd = header.rd;
|
||||||
|
rh.len = header.len;
|
||||||
|
fwrite(&rh, 1, sizeof(rh), out);
|
||||||
res.writeTo(out);
|
res.writeTo(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,12 +31,6 @@ struct FuncArgTraits<ReturnType(ClassType::*)(Args...) const> {
|
|||||||
using type = std::tuple<Args...>;
|
using type = std::tuple<Args...>;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ProcedureCallHeader {
|
|
||||||
uint64_t rd;
|
|
||||||
int32_t method;
|
|
||||||
uint32_t len;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProcedureManager {
|
class ProcedureManager {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user