Meta: Add files to repository
This commit is contained in:
parent
6d27d43268
commit
52cb92f587
120 changed files with 71820 additions and 0 deletions
25
System/Api/Dns.HC
Normal file
25
System/Api/Dns.HC
Normal file
|
@ -0,0 +1,25 @@
|
|||
#define DNS_REQUEST_PTR 0x300010
|
||||
|
||||
MemSet(DNS_REQUEST_PTR, NULL, sizeof(U64));
|
||||
|
||||
class DnsRequest {
|
||||
U64 host;
|
||||
U64 pointer_to_u32;
|
||||
};
|
||||
|
||||
U32 @dns_query(U8* host)
|
||||
{
|
||||
U32 res = 0;
|
||||
if (!host)
|
||||
return U32_MAX;
|
||||
DnsRequest* request = CAlloc(sizeof(DnsRequest), Fs->code_heap);
|
||||
request->host = StrNew(host, adam_task);
|
||||
request->pointer_to_u32 = &res;
|
||||
U64* request_ptr = DNS_REQUEST_PTR;
|
||||
while (*request_ptr)
|
||||
Sleep(1);
|
||||
LXchgU32(request_ptr, request);
|
||||
while (!res)
|
||||
Sleep(1);
|
||||
return res;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue