Files
aaruremote/win32/win32.c

47 lines
1.3 KiB
C
Raw Normal View History

2019-10-27 00:02:22 +01:00
/*
2020-03-01 05:44:49 +00:00
* This file is part of the Aaru Remote Server.
2020-01-03 17:42:13 +00:00
* Copyright (c) 2019-2020 Natalia Portillo.
2019-10-27 00:02:22 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2020-10-24 14:37:22 +01:00
#include <windows.h>
#include "win32.h"
2020-03-01 05:46:10 +00:00
#include "../aaruremote.h"
2019-10-27 00:02:22 +01:00
void Initialize()
{
// Do nothing
}
2020-03-01 05:52:58 +00:00
void PlatformLoop(AaruPacketHello* pkt_server_hello) { WorkingLoop(pkt_server_hello); }
2019-10-27 00:02:22 +01:00
uint8_t AmIRoot()
{
2019-10-27 00:14:48 +01:00
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup);
if(b)
{
if(!CheckTokenMembership(NULL, AdministratorsGroup, &b)) { b = FALSE; }
FreeSid(AdministratorsGroup);
}
return b;
2019-10-27 00:02:22 +01:00
}