#pragma once

#include <windows.h>
#include <wincred.h>

// Advapi32
DECLSPEC_IMPORT WINADVAPI LONG WINAPI Advapi32$RegOpenKeyExA(HKEY, LPCSTR, DWORD, REGSAM, PHKEY);
DECLSPEC_IMPORT WINADVAPI LONG WINAPI Advapi32$RegQueryValueExA(HKEY, LPCSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD);
DECLSPEC_IMPORT WINADVAPI LONG WINAPI Advapi32$RegEnumKeyExA(HKEY, DWORD, LPSTR, LPDWORD, LPDWORD, LPSTR, LPDWORD, LPFILETIME);
DECLSPEC_IMPORT WINADVAPI LONG WINAPI Advapi32$RegGetValueA(HKEY, LPCSTR, LPCSTR, DWORD, LPDWORD, PVOID, LPDWORD);
DECLSPEC_IMPORT WINADVAPI LONG WINAPI Advapi32$RegCloseKey(HKEY);
DECLSPEC_IMPORT LONG WINAPI  WINAPI Advapi32$LookupPrivilegeNameA(LPCSTR,PLUID,LPSTR,LPDWORD);
DECLSPEC_IMPORT WINADVAPI WINBOOL WINAPI Advapi32$OpenProcessToken (HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle);
DECLSPEC_IMPORT LONG WINAPI WINAPI Advapi32$GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,LPVOID,DWORD,PDWORD);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$CredEnumerateW(LPCWSTR, DWORD, DWORD*, PCREDENTIALW**);
DECLSPEC_IMPORT WINBASEAPI VOID WINAPI Advapi32$CredFree(PVOID);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$GetFileSecurityA(LPCSTR lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$DuplicateToken(HANDLE ExistingTokenHandle, SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, PHANDLE DuplicateTokenHandle);
DECLSPEC_IMPORT WINBASEAPI VOID WINAPI Advapi32$MapGenericMask(PDWORD AccessMask, PGENERIC_MAPPING GenericMapping);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$AccessCheck(PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken, DWORD DesiredAccess, PGENERIC_MAPPING GenericMapping, PPRIVILEGE_SET PrivilegeSet, LPDWORD PrivilegeSetLength, LPDWORD GrantedAccess, LPBOOL AccessStatus);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$CryptAcquireContextA(HCRYPTPROV *phProv, LPCSTR szContainer, LPCSTR szProvider, DWORD dwProvType, DWORD dwFlags);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$CryptCreateHash(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey, DWORD dwFlags, HCRYPTHASH *phHash);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$CryptHashData(HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$CryptDestroyHash(HCRYPTHASH hHash);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Advapi32$CryptGetHashParam(HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags);

// MSVCRT
DECLSPEC_IMPORT WINBASEAPI const char* WINAPI MSVCRT$strstr(const char*, const char*);
DECLSPEC_IMPORT WINBASEAPI char *  MSVCRT$strtok(char *str, const char *delim);
DECLSPEC_IMPORT WINBASEAPI void *  MSVCRT$malloc(size_t size);
DECLSPEC_IMPORT WINBASEAPI void MSVCRT$free(void *_Memory);
DECLSPEC_IMPORT WINBASEAPI int MSVCRT$_stricmp(const char *_Str1,const char *_Str2);
DECLSPEC_IMPORT WINBASEAPI int MSVCRT$strncmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
DECLSPEC_IMPORT WINBASEAPI int MSVCRT$_strnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
DECLSPEC_IMPORT WINBASEAPI char MSVCRT$strncpy(char *_Str1, const char *_Str2, size_t count);

// Kernel32
DECLSPEC_IMPORT LONG WINAPI  WINAPI Kernel32$CloseHandle(HANDLE);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Kernel32$HeapFree(HANDLE, DWORD, PVOID);
DECLSPEC_IMPORT WINBASEAPI PVOID WINAPI Kernel32$HeapAlloc(HANDLE, DWORD, DWORD);
DECLSPEC_IMPORT WINBASEAPI HANDLE WINAPI Kernel32$GetProcessHeap(VOID);
DECLSPEC_IMPORT WINBASEAPI DWORD WINAPI Kernel32$GetFileAttributesA(LPCSTR lpFileName);
DECLSPEC_IMPORT WINBASEAPI DWORD WINAPI Kernel32$GetLastError(VOID);
DECLSPEC_IMPORT WINBASEAPI DWORD WINAPI Kernel32$GetEnvironmentVariableA(LPCSTR lpName, LPSTR lpBuffer, DWORD nSize);
DECLSPEC_IMPORT WINBASEAPI HANDLE WINAPI Kernel32$CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI Kernel32$ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
DECLSPEC_IMPORT WINBASEAPI UINT WINAPI Kernel32$GetWindowsDirectoryA(LPSTR lpBuffer, UINT uSize);
#define Kernel32$GetCurrentProcess()(HANDLE)(-1)

// User32
DECLSPEC_IMPORT WINBASEAPI int WINAPI User32$wsprintfA(LPSTR unnamedParam1, LPCSTR unnamedParam2, ...);

// Shlwapi
DECLSPEC_IMPORT WINBASEAPI PCSTR WINAPI Shlwapi$StrStrIA(PCSTR pszFirst, PCSTR pszSrch);