mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-19 07:11:05 +00:00
Update control connection for GFE 2.0.1+. Remove config and handshake code that isn't used on GFE 2.0.1+
This commit is contained in:
@@ -8,6 +8,15 @@ void BbInitializeWrappedBuffer(PBYTE_BUFFER buff, char* data, int offset, int le
|
||||
buff->byteOrder = byteOrder;
|
||||
}
|
||||
|
||||
static long long byteSwapLongLong(PBYTE_BUFFER buff, long long l) {
|
||||
if (buff->byteOrder == BYTE_ORDER_BIG) {
|
||||
return HTONLL(l);
|
||||
}
|
||||
else {
|
||||
return l;
|
||||
}
|
||||
}
|
||||
|
||||
static int byteSwapInt(PBYTE_BUFFER buff, int i) {
|
||||
if (buff->byteOrder == BYTE_ORDER_BIG) {
|
||||
return htonl(i);
|
||||
@@ -63,6 +72,19 @@ int BbGetInt(PBYTE_BUFFER buff, int *i) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int BbGetLong(PBYTE_BUFFER buff, long long *l) {
|
||||
if (buff->position + sizeof(*l) > buff->length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(l, &buff->buffer[buff->position], sizeof(*l));
|
||||
buff->position += sizeof(*l);
|
||||
|
||||
*l = byteSwapInt(buff, *l);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int BbPutInt(PBYTE_BUFFER buff, int i) {
|
||||
if (buff->position + sizeof(i) > buff->length) {
|
||||
return 0;
|
||||
@@ -76,6 +98,19 @@ int BbPutInt(PBYTE_BUFFER buff, int i) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int BbPutLong(PBYTE_BUFFER buff, long long l) {
|
||||
if (buff->position + sizeof(l) > buff->length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
l = byteSwapInt(buff, l);
|
||||
|
||||
memcpy(&buff->buffer[buff->position], &l, sizeof(l));
|
||||
buff->position += sizeof(l);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int BbPutShort(PBYTE_BUFFER buff, short s) {
|
||||
if (buff->position + sizeof(s) > buff->length) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user