cleanup: namespace Montauk (capital M) => montauk::abi
This commit is contained in:
+18
-18
@@ -808,7 +808,7 @@ namespace Ipc {
|
||||
|
||||
int StreamReadHandle(int handle, uint8_t* out, int maxLen) {
|
||||
if (out == nullptr) return -1;
|
||||
if (maxLen > 0 && !Montauk::UserMemory::Range((uint64_t)out, (uint64_t)maxLen, true)) return -1;
|
||||
if (maxLen > 0 && !montauk::abi::UserMemory::Range((uint64_t)out, (uint64_t)maxLen, true)) return -1;
|
||||
|
||||
HandleType type = HandleType::None;
|
||||
Object* object = nullptr;
|
||||
@@ -820,7 +820,7 @@ namespace Ipc {
|
||||
|
||||
int StreamWriteHandle(int handle, const uint8_t* data, int len) {
|
||||
if (data == nullptr) return -1;
|
||||
if (len > 0 && !Montauk::UserMemory::Range((uint64_t)data, (uint64_t)len, false)) return -1;
|
||||
if (len > 0 && !montauk::abi::UserMemory::Range((uint64_t)data, (uint64_t)len, false)) return -1;
|
||||
|
||||
HandleType type = HandleType::None;
|
||||
Object* object = nullptr;
|
||||
@@ -963,9 +963,9 @@ namespace Ipc {
|
||||
|
||||
int MailboxSendCoalescedMouse(Mailbox* mailbox, uint32_t msgType, const void* data, uint16_t len) {
|
||||
if (mailbox == nullptr || data == nullptr) return -1;
|
||||
if (len != sizeof(Montauk::WinEvent)) return MailboxSend(mailbox, msgType, data, len);
|
||||
if (len != sizeof(montauk::abi::WinEvent)) return MailboxSend(mailbox, msgType, data, len);
|
||||
|
||||
const Montauk::WinEvent* incoming = (const Montauk::WinEvent*)data;
|
||||
const montauk::abi::WinEvent* incoming = (const montauk::abi::WinEvent*)data;
|
||||
if (incoming->type != 1 || incoming->mouse.scroll != 0)
|
||||
return MailboxSend(mailbox, msgType, data, len);
|
||||
|
||||
@@ -983,7 +983,7 @@ namespace Ipc {
|
||||
uint32_t idx = (mailbox->head + MaxMailboxMessages - 1) % MaxMailboxMessages;
|
||||
MailboxMessage& latest = mailbox->messages[idx];
|
||||
if (latest.type == msgType && latest.size == len && !latest.hasAttachment) {
|
||||
const Montauk::WinEvent* queued = (const Montauk::WinEvent*)latest.data;
|
||||
const montauk::abi::WinEvent* queued = (const montauk::abi::WinEvent*)latest.data;
|
||||
bool queuedTransition = queued->type != 1 ||
|
||||
queued->mouse.scroll != 0 ||
|
||||
queued->mouse.buttons != queued->mouse.prev_buttons;
|
||||
@@ -1060,7 +1060,7 @@ namespace Ipc {
|
||||
}
|
||||
|
||||
int MailboxSendHandle(int handle, uint32_t msgType, const void* data, uint16_t len, int attachHandle) {
|
||||
if (len > 0 && (data == nullptr || !Montauk::UserMemory::Range((uint64_t)data, len, false))) return -1;
|
||||
if (len > 0 && (data == nullptr || !montauk::abi::UserMemory::Range((uint64_t)data, len, false))) return -1;
|
||||
|
||||
HandleType type = HandleType::None;
|
||||
Object* object = nullptr;
|
||||
@@ -1072,12 +1072,12 @@ namespace Ipc {
|
||||
}
|
||||
|
||||
int MailboxRecvHandle(int handle, uint32_t* msgType, void* data, uint16_t* inOutLen, int* outAttachHandle) {
|
||||
if (inOutLen == nullptr || !Montauk::UserMemory::Writable<uint16_t>((uint64_t)inOutLen)) return -1;
|
||||
if (inOutLen == nullptr || !montauk::abi::UserMemory::Writable<uint16_t>((uint64_t)inOutLen)) return -1;
|
||||
|
||||
uint16_t requestedLen = *inOutLen;
|
||||
if (msgType != nullptr && !Montauk::UserMemory::Writable<uint32_t>((uint64_t)msgType)) return -1;
|
||||
if (requestedLen > 0 && (data == nullptr || !Montauk::UserMemory::Range((uint64_t)data, requestedLen, true))) return -1;
|
||||
if (outAttachHandle != nullptr && !Montauk::UserMemory::Writable<int>((uint64_t)outAttachHandle)) return -1;
|
||||
if (msgType != nullptr && !montauk::abi::UserMemory::Writable<uint32_t>((uint64_t)msgType)) return -1;
|
||||
if (requestedLen > 0 && (data == nullptr || !montauk::abi::UserMemory::Range((uint64_t)data, requestedLen, true))) return -1;
|
||||
if (outAttachHandle != nullptr && !montauk::abi::UserMemory::Writable<int>((uint64_t)outAttachHandle)) return -1;
|
||||
|
||||
HandleType type = HandleType::None;
|
||||
Object* object = nullptr;
|
||||
@@ -1139,7 +1139,7 @@ namespace Ipc {
|
||||
|
||||
int FileReadHandle(int handle, uint8_t* buffer, uint64_t offset, uint64_t size) {
|
||||
if (buffer == nullptr) return -1;
|
||||
if (size > 0 && !Montauk::UserMemory::Range((uint64_t)buffer, size, true)) return -1;
|
||||
if (size > 0 && !montauk::abi::UserMemory::Range((uint64_t)buffer, size, true)) return -1;
|
||||
|
||||
HandleType type = HandleType::None;
|
||||
Object* object = nullptr;
|
||||
@@ -1151,7 +1151,7 @@ namespace Ipc {
|
||||
|
||||
int FileWriteHandle(int handle, const uint8_t* buffer, uint64_t offset, uint64_t size) {
|
||||
if (buffer == nullptr) return -1;
|
||||
if (size > 0 && !Montauk::UserMemory::Range((uint64_t)buffer, size, false)) return -1;
|
||||
if (size > 0 && !montauk::abi::UserMemory::Range((uint64_t)buffer, size, false)) return -1;
|
||||
|
||||
HandleType type = HandleType::None;
|
||||
Object* object = nullptr;
|
||||
@@ -1371,7 +1371,7 @@ namespace Ipc {
|
||||
|
||||
int SocketSendHandle(int handle, const uint8_t* data, uint32_t len) {
|
||||
if (data == nullptr) return -1;
|
||||
if (len > 0 && !Montauk::UserMemory::Range((uint64_t)data, len, false)) return -1;
|
||||
if (len > 0 && !montauk::abi::UserMemory::Range((uint64_t)data, len, false)) return -1;
|
||||
|
||||
Socket* socket = nullptr;
|
||||
uint32_t rights = 0;
|
||||
@@ -1387,7 +1387,7 @@ namespace Ipc {
|
||||
|
||||
int SocketRecvHandle(int handle, uint8_t* buffer, uint32_t maxLen) {
|
||||
if (buffer == nullptr) return -1;
|
||||
if (maxLen > 0 && !Montauk::UserMemory::Range((uint64_t)buffer, maxLen, true)) return -1;
|
||||
if (maxLen > 0 && !montauk::abi::UserMemory::Range((uint64_t)buffer, maxLen, true)) return -1;
|
||||
|
||||
Socket* socket = nullptr;
|
||||
uint32_t rights = 0;
|
||||
@@ -1406,7 +1406,7 @@ namespace Ipc {
|
||||
|
||||
int SocketSendToHandle(int handle, const uint8_t* data, uint32_t len, uint32_t destIp, uint16_t destPort) {
|
||||
if (data == nullptr) return -1;
|
||||
if (len > 0 && !Montauk::UserMemory::Range((uint64_t)data, len, false)) return -1;
|
||||
if (len > 0 && !montauk::abi::UserMemory::Range((uint64_t)data, len, false)) return -1;
|
||||
|
||||
Socket* socket = nullptr;
|
||||
uint32_t rights = 0;
|
||||
@@ -1437,9 +1437,9 @@ namespace Ipc {
|
||||
|
||||
int SocketRecvFromHandle(int handle, uint8_t* buffer, uint32_t maxLen, uint32_t* srcIp, uint16_t* srcPort) {
|
||||
if (buffer == nullptr) return -1;
|
||||
if (maxLen > 0 && !Montauk::UserMemory::Range((uint64_t)buffer, maxLen, true)) return -1;
|
||||
if (srcIp != nullptr && !Montauk::UserMemory::Writable<uint32_t>((uint64_t)srcIp)) return -1;
|
||||
if (srcPort != nullptr && !Montauk::UserMemory::Writable<uint16_t>((uint64_t)srcPort)) return -1;
|
||||
if (maxLen > 0 && !montauk::abi::UserMemory::Range((uint64_t)buffer, maxLen, true)) return -1;
|
||||
if (srcIp != nullptr && !montauk::abi::UserMemory::Writable<uint32_t>((uint64_t)srcIp)) return -1;
|
||||
if (srcPort != nullptr && !montauk::abi::UserMemory::Writable<uint16_t>((uint64_t)srcPort)) return -1;
|
||||
|
||||
Socket* socket = nullptr;
|
||||
uint32_t rights = 0;
|
||||
|
||||
Reference in New Issue
Block a user