mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Merge PR #1195: Define our types to the standard ones from <stdint.h>, remove unnecessary duplicate ones
This commit is contained in:
commit
6a7883b5fe
@ -2693,7 +2693,7 @@ BLOCK *NewBlock(void *data, UINT size, int compress)
|
||||
if (compress == 0)
|
||||
{
|
||||
// Uncompressed
|
||||
b->Compressed = FALSE;
|
||||
b->Compressed = false;
|
||||
b->Buf = data;
|
||||
b->Size = size;
|
||||
b->SizeofData = size;
|
||||
@ -2703,7 +2703,7 @@ BLOCK *NewBlock(void *data, UINT size, int compress)
|
||||
UINT max_size;
|
||||
|
||||
// Compressed
|
||||
b->Compressed = TRUE;
|
||||
b->Compressed = true;
|
||||
max_size = CalcCompress(size);
|
||||
b->Buf = MallocFast(max_size);
|
||||
b->Size = Compress(b->Buf, max_size, data, size);
|
||||
@ -2717,7 +2717,7 @@ BLOCK *NewBlock(void *data, UINT size, int compress)
|
||||
// Expand
|
||||
UINT max_size;
|
||||
|
||||
b->Compressed = FALSE;
|
||||
b->Compressed = false;
|
||||
max_size = MAX_PACKET_SIZE;
|
||||
b->Buf = MallocFast(max_size);
|
||||
b->Size = Uncompress(b->Buf, max_size, data, size);
|
||||
|
@ -2520,7 +2520,7 @@ void IPCIPv6SendUnicast(IPC *ipc, void *data, UINT size, IP *next_ip)
|
||||
}
|
||||
else
|
||||
{
|
||||
CHAR tmp[MAX_SIZE];
|
||||
char tmp[MAX_SIZE];
|
||||
IPToStr6(tmp, MAX_SIZE, &srcIp);
|
||||
Debug("We couldn't find a router for the source address of %s! Trying as local.\n", tmp);
|
||||
isLocal = true;
|
||||
@ -2569,7 +2569,7 @@ void IPCIPv6SendUnicast(IPC *ipc, void *data, UINT size, IP *next_ip)
|
||||
UCHAR destMacAddress[6];
|
||||
IPV6_ADDR solicitAddress;
|
||||
|
||||
CHAR tmp[MAX_SIZE];
|
||||
char tmp[MAX_SIZE];
|
||||
UCHAR *copy;
|
||||
BLOCK *blk;
|
||||
|
||||
@ -2605,7 +2605,7 @@ void IPCIPv6SendUnicast(IPC *ipc, void *data, UINT size, IP *next_ip)
|
||||
}
|
||||
else
|
||||
{
|
||||
CHAR tmp[MAX_SIZE];
|
||||
char tmp[MAX_SIZE];
|
||||
IPToStr6(tmp, MAX_SIZE, next_ip);
|
||||
Debug("We couldn't deduce the MAC address for unicast address %s, packet dropped.\n", tmp);
|
||||
/// TODO: think about sending to the all routers broadcast MAC as a last resort
|
||||
|
@ -1780,7 +1780,7 @@ void ProcL2TPPacketRecv(L2TP_SERVER *l2tp, UDPPACKET *p)
|
||||
Insert(t->RecvQueue, q);
|
||||
|
||||
// Read to the end of completed part from the head of the queue
|
||||
while (TRUE)
|
||||
while (true)
|
||||
{
|
||||
L2TP_QUEUE *q;
|
||||
if (LIST_NUM(t->RecvQueue) == 0)
|
||||
|
@ -3491,7 +3491,7 @@ PPP_LCP *BuildEAPTlsPacketEx(UCHAR code, UCHAR id, UCHAR type, UINT datasize, UC
|
||||
UINT tls_datasize = datasize + sizeof(UCHAR);
|
||||
if (flags & PPP_EAP_TLS_FLAG_TLS_LENGTH)
|
||||
{
|
||||
tls_datasize += sizeof(UINT32);
|
||||
tls_datasize += sizeof(UINT);
|
||||
}
|
||||
lcp_packet = BuildEAPPacketEx(code, id, type, tls_datasize);
|
||||
eap_packet = lcp_packet->Data;
|
||||
|
@ -202,7 +202,7 @@ struct PPP_EAP
|
||||
UCHAR TlsDataWithoutLength[0];
|
||||
struct
|
||||
{
|
||||
UINT32 TlsLength;
|
||||
UINT TlsLength;
|
||||
UCHAR Data[0];
|
||||
} TlsDataWithLength;
|
||||
};
|
||||
|
@ -1972,10 +1972,10 @@ RECV_RETRY:
|
||||
if (recv_size == 0)
|
||||
{
|
||||
Debug("Radius recv_size 0\n");
|
||||
finish[pos] = TRUE;
|
||||
for(i = 0; i < LIST_NUM(ip_list); i++)
|
||||
finish[pos] = true;
|
||||
for (i = 0; i < LIST_NUM(ip_list); ++i)
|
||||
{
|
||||
if(finish[i] == FALSE)
|
||||
if (finish[i] == false)
|
||||
{
|
||||
// Switch the host to refer
|
||||
pos++;
|
||||
|
@ -19,15 +19,19 @@
|
||||
|
||||
// Make available the types for Windows even if windows.h is not included
|
||||
#ifndef _WINDEF_
|
||||
|
||||
typedef void *HWND;
|
||||
typedef void *HFONT;
|
||||
typedef void *HICON;
|
||||
typedef void *HMENU;
|
||||
typedef UINT_PTR WPARAM;
|
||||
typedef LONG_PTR LPARAM;
|
||||
typedef void *HINSTANCE;
|
||||
|
||||
#ifdef CPU_64
|
||||
typedef unsigned __int64 *WPARAM;
|
||||
typedef __int64 *LPARAM;
|
||||
#else
|
||||
typedef unsigned int *WPARAM;
|
||||
typedef long *LPARAM;
|
||||
#endif // CPU_64
|
||||
#endif // _WINDEF_
|
||||
|
||||
|
||||
|
@ -220,7 +220,7 @@ UINT64 TickGetRealtimeTickValue64()
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = (UINT64)((UINT64)((UINT32)tv.tv_sec)) * 1000ULL + (UINT64)tv.tv_usec / 1000ULL;
|
||||
ret = (UINT64)((UINT64)((UINT)tv.tv_sec)) * 1000ULL + (UINT64)tv.tv_usec / 1000ULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -1903,7 +1903,7 @@ void UINT64ToSystem(SYSTEMTIME *st, UINT64 sec64)
|
||||
sec = (UINT)tmp64;
|
||||
time = (time_64t)sec;
|
||||
TimeToSystem(st, time);
|
||||
st->wMilliseconds = (WORD)millisec;
|
||||
st->wMilliseconds = (USHORT)millisec;
|
||||
}
|
||||
|
||||
// Convert the SYSTEMTIME to UINT64
|
||||
|
@ -8,6 +8,8 @@
|
||||
#ifndef MAYATYPE_H
|
||||
#define MAYATYPE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// Check whether the windows.h header is included
|
||||
#ifndef WINDOWS_H
|
||||
#ifdef _WINDOWS_
|
||||
@ -15,7 +17,6 @@
|
||||
#endif // _WINDOWS_
|
||||
#endif // WINDOWS_H
|
||||
|
||||
|
||||
#if !defined(ENCRYPT_C)
|
||||
// Structure which is used by OpenSSL
|
||||
typedef struct x509_st X509;
|
||||
@ -171,52 +172,28 @@ typedef int PID;
|
||||
typedef unsigned long PID;
|
||||
#endif // WINDOWS_H
|
||||
|
||||
// bool type
|
||||
#ifndef WINDOWS_H
|
||||
typedef unsigned int BOOL;
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#endif // WINDOWS_H
|
||||
|
||||
// bool type
|
||||
// TODO: include <stdbool.h> instead of manually defining type
|
||||
#ifndef WIN32COM_CPP
|
||||
typedef unsigned int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif // WIN32COM_CPP
|
||||
|
||||
// 32bit integer type
|
||||
#ifndef WINDOWS_H
|
||||
typedef unsigned int UINT;
|
||||
typedef unsigned int UINT32;
|
||||
typedef unsigned int DWORD;
|
||||
typedef signed int INT;
|
||||
typedef signed int INT32;
|
||||
typedef int64_t time_64t;
|
||||
|
||||
typedef int UINT_PTR;
|
||||
typedef long LONG_PTR;
|
||||
#ifndef _BASETSD_H_
|
||||
typedef int32_t INT;
|
||||
typedef int64_t INT64;
|
||||
|
||||
typedef uint32_t UINT;
|
||||
typedef uint64_t UINT64;
|
||||
#endif
|
||||
|
||||
// 16bit integer type
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned short USHORT;
|
||||
typedef signed short SHORT;
|
||||
|
||||
// 8bit integer type
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned char UCHAR;
|
||||
|
||||
#ifndef WIN32COM_CPP
|
||||
typedef signed char CHAR;
|
||||
#endif // WIN32COM_CPP
|
||||
|
||||
|
||||
// 64-bit integer type
|
||||
typedef unsigned long long UINT64;
|
||||
typedef signed long long INT64;
|
||||
|
||||
typedef signed long long time_64t;
|
||||
#ifndef BASETYPES
|
||||
typedef uint8_t BYTE;
|
||||
typedef uint8_t UCHAR;
|
||||
typedef uint16_t USHORT;
|
||||
#endif
|
||||
|
||||
#ifdef OS_UNIX
|
||||
// Avoiding compile error
|
||||
@ -226,7 +203,11 @@ typedef signed long long time_64t;
|
||||
typedef int SOCKET;
|
||||
#else // OS_UNIX
|
||||
#ifndef _WINSOCK2API_
|
||||
typedef UINT_PTR SOCKET;
|
||||
#ifdef CPU_64
|
||||
typedef unsigned __int64 SOCKET;
|
||||
#else
|
||||
typedef unsigned int SOCKET;
|
||||
#endif // CPU_64
|
||||
#endif // _WINSOCK2API_
|
||||
#endif // OS_UNIX
|
||||
|
||||
@ -302,14 +283,14 @@ typedef struct OS_INFO
|
||||
#ifndef WINDOWS_H
|
||||
typedef struct SYSTEMTIME
|
||||
{
|
||||
WORD wYear;
|
||||
WORD wMonth;
|
||||
WORD wDayOfWeek;
|
||||
WORD wDay;
|
||||
WORD wHour;
|
||||
WORD wMinute;
|
||||
WORD wSecond;
|
||||
WORD wMilliseconds;
|
||||
USHORT wYear;
|
||||
USHORT wMonth;
|
||||
USHORT wDayOfWeek;
|
||||
USHORT wDay;
|
||||
USHORT wHour;
|
||||
USHORT wMinute;
|
||||
USHORT wSecond;
|
||||
USHORT wMilliseconds;
|
||||
} SYSTEMTIME;
|
||||
#endif // WINDOWS_H
|
||||
|
||||
|
@ -23,7 +23,7 @@ bool g_debug; // Debug mode
|
||||
UINT64 kernel_status[NUM_KERNEL_STATUS]; // Kernel state
|
||||
UINT64 kernel_status_max[NUM_KERNEL_STATUS]; // Kernel state (maximum value)
|
||||
LOCK *kernel_status_lock[NUM_KERNEL_STATUS]; // Kernel state lock
|
||||
BOOL kernel_status_inited = false; // Kernel state initialization flag
|
||||
bool kernel_status_inited = false; // Kernel state initialization flag
|
||||
bool g_little_endian = true;
|
||||
char *cmdline = NULL; // Command line
|
||||
wchar_t *uni_cmdline = NULL; // Unicode command line
|
||||
|
@ -302,7 +302,7 @@ extern bool g_foreground;
|
||||
extern UINT64 kernel_status[NUM_KERNEL_STATUS];
|
||||
extern UINT64 kernel_status_max[NUM_KERNEL_STATUS];
|
||||
extern LOCK *kernel_status_lock[NUM_KERNEL_STATUS];
|
||||
extern BOOL kernel_status_inited;
|
||||
extern bool kernel_status_inited;
|
||||
|
||||
// Kernel state operation macro
|
||||
#define KS_LOCK(id) LockKernelStatus(id)
|
||||
|
@ -3438,7 +3438,7 @@ int B64_Encode(char *set, char *source, int len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
while (TRUE)
|
||||
while (true)
|
||||
{
|
||||
if (i >= len)
|
||||
{
|
||||
@ -3491,7 +3491,7 @@ int B64_Decode(char *set, char *source, int len)
|
||||
src = source;
|
||||
i = 0;
|
||||
j = 0;
|
||||
while (TRUE)
|
||||
while (true)
|
||||
{
|
||||
f1 = f2 = f3 = f4 = 0;
|
||||
if (i >= len)
|
||||
|
@ -4427,7 +4427,7 @@ bool MsServiceStopProc()
|
||||
}
|
||||
|
||||
// Service handler
|
||||
void CALLBACK MsServiceHandler(DWORD opcode)
|
||||
void CALLBACK MsServiceHandler(UINT opcode)
|
||||
{
|
||||
switch (opcode)
|
||||
{
|
||||
@ -4451,7 +4451,7 @@ void CALLBACK MsServiceHandler(DWORD opcode)
|
||||
}
|
||||
|
||||
// Dispatch function of the service
|
||||
void CALLBACK MsServiceDispatcher(DWORD argc, LPTSTR *argv)
|
||||
void CALLBACK MsServiceDispatcher(UINT argc, LPTSTR *argv)
|
||||
{
|
||||
// Creating a stopping event
|
||||
service_stop_event = CreateEventA(NULL, true, false, NULL);
|
||||
@ -10513,7 +10513,7 @@ bool MsIsAeroEnabled()
|
||||
}
|
||||
|
||||
// Generate an access mask to force accessing to the 32 bit registry key for 64 bit application
|
||||
DWORD MsRegAccessMaskFor64BitEx(bool force32bit, bool force64bit)
|
||||
UINT MsRegAccessMaskFor64BitEx(bool force32bit, bool force64bit)
|
||||
{
|
||||
if (MsIs64BitWindows() == false)
|
||||
{
|
||||
|
@ -158,29 +158,29 @@ typedef struct NETWORK_WIN32_FUNCTIONS
|
||||
{
|
||||
HINSTANCE hIpHlpApi32;
|
||||
HINSTANCE hIcmp;
|
||||
DWORD (WINAPI *DeleteIpForwardEntry)(PMIB_IPFORWARDROW);
|
||||
DWORD (WINAPI *CreateIpForwardEntry)(PMIB_IPFORWARDROW);
|
||||
DWORD (WINAPI *GetIpForwardTable)(PMIB_IPFORWARDTABLE, PULONG, BOOL);
|
||||
DWORD (WINAPI *GetNetworkParams)(PFIXED_INFO, PULONG);
|
||||
UINT (WINAPI *DeleteIpForwardEntry)(PMIB_IPFORWARDROW);
|
||||
UINT (WINAPI *CreateIpForwardEntry)(PMIB_IPFORWARDROW);
|
||||
UINT (WINAPI *GetIpForwardTable)(PMIB_IPFORWARDTABLE, PULONG, BOOL);
|
||||
UINT (WINAPI *GetNetworkParams)(PFIXED_INFO, PULONG);
|
||||
ULONG (WINAPI *GetAdaptersAddresses)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);
|
||||
DWORD (WINAPI *GetIfTable)(PMIB_IFTABLE, PULONG, BOOL);
|
||||
DWORD (WINAPI *GetIfTable2)(void **);
|
||||
UINT (WINAPI *GetIfTable)(PMIB_IFTABLE, PULONG, BOOL);
|
||||
UINT (WINAPI *GetIfTable2)(void **);
|
||||
void (WINAPI *FreeMibTable)(PVOID);
|
||||
DWORD (WINAPI *IpRenewAddress)(PIP_ADAPTER_INDEX_MAP);
|
||||
DWORD (WINAPI *IpReleaseAddress)(PIP_ADAPTER_INDEX_MAP);
|
||||
DWORD (WINAPI *GetInterfaceInfo)(PIP_INTERFACE_INFO, PULONG);
|
||||
DWORD (WINAPI *GetAdaptersInfo)(PIP_ADAPTER_INFO, PULONG);
|
||||
DWORD (WINAPI *GetExtendedTcpTable)(PVOID, PDWORD, BOOL, ULONG, _TCP_TABLE_CLASS, ULONG);
|
||||
DWORD (WINAPI *AllocateAndGetTcpExTableFromStack)(PVOID *, BOOL, HANDLE, DWORD, DWORD);
|
||||
DWORD (WINAPI *GetTcpTable)(PMIB_TCPTABLE, PDWORD, BOOL);
|
||||
DWORD (WINAPI *NotifyRouteChange)(PHANDLE, LPOVERLAPPED);
|
||||
UINT (WINAPI *IpRenewAddress)(PIP_ADAPTER_INDEX_MAP);
|
||||
UINT (WINAPI *IpReleaseAddress)(PIP_ADAPTER_INDEX_MAP);
|
||||
UINT (WINAPI *GetInterfaceInfo)(PIP_INTERFACE_INFO, PULONG);
|
||||
UINT (WINAPI *GetAdaptersInfo)(PIP_ADAPTER_INFO, PULONG);
|
||||
UINT (WINAPI *GetExtendedTcpTable)(PVOID, PUINT, BOOL, ULONG, _TCP_TABLE_CLASS, ULONG);
|
||||
UINT (WINAPI *AllocateAndGetTcpExTableFromStack)(PVOID *, BOOL, HANDLE, UINT, UINT);
|
||||
UINT (WINAPI *GetTcpTable)(PMIB_TCPTABLE, PUINT, BOOL);
|
||||
UINT (WINAPI *NotifyRouteChange)(PHANDLE, LPOVERLAPPED);
|
||||
BOOL (WINAPI *CancelIPChangeNotify)(LPOVERLAPPED);
|
||||
DWORD (WINAPI *NhpAllocateAndGetInterfaceInfoFromStack)(IP_INTERFACE_NAME_INFO **,
|
||||
PDWORD, BOOL, HANDLE, DWORD);
|
||||
UINT (WINAPI *NhpAllocateAndGetInterfaceInfoFromStack)(IP_INTERFACE_NAME_INFO **,
|
||||
PUINT, BOOL, HANDLE, UINT);
|
||||
HANDLE (WINAPI *IcmpCreateFile)();
|
||||
BOOL (WINAPI *IcmpCloseHandle)(HANDLE);
|
||||
DWORD (WINAPI *IcmpSendEcho)(HANDLE, IPAddr, LPVOID, WORD, PIP_OPTION_INFORMATION,
|
||||
LPVOID, DWORD, DWORD);
|
||||
UINT (WINAPI *IcmpSendEcho)(HANDLE, IPAddr, LPVOID, WORD, PIP_OPTION_INFORMATION,
|
||||
LPVOID, UINT, UINT);
|
||||
} NETWORK_WIN32_FUNCTIONS;
|
||||
#endif
|
||||
|
||||
@ -222,7 +222,7 @@ typedef struct _MS_WCM_PROFILE_INFO {
|
||||
} MS_WCM_PROFILE_INFO, *MS_PWCM_PROFILE_INFO;
|
||||
|
||||
typedef struct _MS_WCM_PROFILE_INFO_LIST {
|
||||
DWORD dwNumberOfItems;
|
||||
UINT dwNumberOfItems;
|
||||
|
||||
MS_WCM_PROFILE_INFO ProfileInfo[1];
|
||||
|
||||
@ -310,68 +310,68 @@ typedef struct NT_API
|
||||
HINSTANCE hDbgHelp;
|
||||
HINSTANCE hWcmapi;
|
||||
HINSTANCE hDwmapi;
|
||||
BOOL (WINAPI *OpenProcessToken)(HANDLE, DWORD, PHANDLE);
|
||||
BOOL (WINAPI *OpenProcessToken)(HANDLE, UINT, PHANDLE);
|
||||
BOOL (WINAPI *LookupPrivilegeValue)(char *, char *, PLUID);
|
||||
BOOL (WINAPI *AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD);
|
||||
BOOL (WINAPI *InitiateSystemShutdown)(LPTSTR, LPTSTR, DWORD, BOOL, BOOL);
|
||||
BOOL (WINAPI *LogonUserW)(wchar_t *, wchar_t *, wchar_t *, DWORD, DWORD, HANDLE *);
|
||||
BOOL (WINAPI *LogonUserA)(char *, char *, char *, DWORD, DWORD, HANDLE *);
|
||||
BOOL (WINAPI *AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, UINT, PTOKEN_PRIVILEGES, PUINT);
|
||||
BOOL (WINAPI *InitiateSystemShutdown)(LPTSTR, LPTSTR, UINT, BOOL, BOOL);
|
||||
BOOL (WINAPI *LogonUserW)(wchar_t *, wchar_t *, wchar_t *, UINT, UINT, HANDLE *);
|
||||
BOOL (WINAPI *LogonUserA)(char *, char *, char *, UINT, UINT, HANDLE *);
|
||||
BOOL (WINAPI *UpdateDriverForPlugAndPlayDevicesW)(HWND hWnd, wchar_t *hardware_id, wchar_t *inf_path, UINT flag, BOOL *need_reboot);
|
||||
UINT (WINAPI *CM_Get_DevNode_Status_Ex)(UINT *, UINT *, DWORD, UINT, HANDLE);
|
||||
UINT (WINAPI *CM_Get_Device_ID_ExA)(DWORD, char *, UINT, UINT, HANDLE);
|
||||
UINT (WINAPI *WTSQuerySessionInformation)(HANDLE, DWORD, WTS_INFO_CLASS, wchar_t *, DWORD *);
|
||||
UINT (WINAPI *CM_Get_DevNode_Status_Ex)(UINT *, UINT *, UINT, UINT, HANDLE);
|
||||
UINT (WINAPI *CM_Get_Device_ID_ExA)(UINT, char *, UINT, UINT, HANDLE);
|
||||
UINT (WINAPI *WTSQuerySessionInformation)(HANDLE, UINT, WTS_INFO_CLASS, wchar_t *, UINT *);
|
||||
void (WINAPI *WTSFreeMemory)(void *);
|
||||
BOOL (WINAPI *WTSDisconnectSession)(HANDLE, DWORD, BOOL);
|
||||
BOOL (WINAPI *WTSEnumerateSessions)(HANDLE, DWORD, DWORD, PWTS_SESSION_INFO *, DWORD *);
|
||||
BOOL (WINAPI *WTSRegisterSessionNotification)(HWND, DWORD);
|
||||
BOOL (WINAPI *WTSDisconnectSession)(HANDLE, UINT, BOOL);
|
||||
BOOL (WINAPI *WTSEnumerateSessions)(HANDLE, UINT, UINT, PWTS_SESSION_INFO *, UINT *);
|
||||
BOOL (WINAPI *WTSRegisterSessionNotification)(HWND, UINT);
|
||||
BOOL (WINAPI *WTSUnRegisterSessionNotification)(HWND);
|
||||
SC_HANDLE (WINAPI *OpenSCManager)(LPCTSTR, LPCTSTR, DWORD);
|
||||
SC_HANDLE (WINAPI *CreateServiceA)(SC_HANDLE, LPCTSTR, LPCTSTR, DWORD, DWORD, DWORD, DWORD, LPCTSTR, LPCTSTR, LPDWORD, LPCTSTR, LPCTSTR, LPCTSTR);
|
||||
SC_HANDLE (WINAPI *CreateServiceW)(SC_HANDLE, LPCWSTR, LPCWSTR, DWORD, DWORD, DWORD, DWORD, LPCWSTR, LPCWSTR, LPDWORD, LPCWSTR, LPCWSTR, LPCWSTR);
|
||||
BOOL (WINAPI *ChangeServiceConfig2)(SC_HANDLE, DWORD, LPVOID);
|
||||
SC_HANDLE (WINAPI *OpenSCManager)(LPCTSTR, LPCTSTR, UINT);
|
||||
SC_HANDLE (WINAPI *CreateServiceA)(SC_HANDLE, LPCTSTR, LPCTSTR, UINT, UINT, UINT, UINT, LPCTSTR, LPCTSTR, LPUINT, LPCTSTR, LPCTSTR, LPCTSTR);
|
||||
SC_HANDLE (WINAPI *CreateServiceW)(SC_HANDLE, LPCWSTR, LPCWSTR, UINT, UINT, UINT, UINT, LPCWSTR, LPCWSTR, LPUINT, LPCWSTR, LPCWSTR, LPCWSTR);
|
||||
BOOL (WINAPI *ChangeServiceConfig2)(SC_HANDLE, UINT, LPVOID);
|
||||
BOOL (WINAPI *CloseServiceHandle)(SC_HANDLE);
|
||||
SC_HANDLE (WINAPI *OpenService)(SC_HANDLE, LPCTSTR, DWORD);
|
||||
SC_HANDLE (WINAPI *OpenService)(SC_HANDLE, LPCTSTR, UINT);
|
||||
BOOL (WINAPI *QueryServiceStatus)(SC_HANDLE, LPSERVICE_STATUS);
|
||||
BOOL (WINAPI *StartService)(SC_HANDLE, DWORD, LPCTSTR);
|
||||
BOOL (WINAPI *ControlService)(SC_HANDLE, DWORD, LPSERVICE_STATUS);
|
||||
BOOL (WINAPI *StartService)(SC_HANDLE, UINT, LPCTSTR);
|
||||
BOOL (WINAPI *ControlService)(SC_HANDLE, UINT, LPSERVICE_STATUS);
|
||||
BOOL (WINAPI *SetServiceStatus)(SERVICE_STATUS_HANDLE, LPSERVICE_STATUS);
|
||||
SERVICE_STATUS_HANDLE (WINAPI *RegisterServiceCtrlHandler)(LPCTSTR, LPHANDLER_FUNCTION);
|
||||
BOOL (WINAPI *StartServiceCtrlDispatcher)(CONST LPSERVICE_TABLE_ENTRY);
|
||||
BOOL (WINAPI *DeleteService)(SC_HANDLE);
|
||||
BOOL (WINAPI *EnumProcesses)(DWORD *, DWORD, DWORD *);
|
||||
BOOL (WINAPI *EnumProcessModules)(HANDLE, HMODULE *, DWORD, DWORD *);
|
||||
DWORD (WINAPI *GetModuleFileNameExA)(HANDLE, HMODULE, LPSTR, DWORD);
|
||||
DWORD (WINAPI *GetModuleFileNameExW)(HANDLE, HMODULE, LPWSTR, DWORD);
|
||||
DWORD (WINAPI *GetProcessImageFileNameA)(HANDLE, LPSTR, DWORD);
|
||||
DWORD (WINAPI *GetProcessImageFileNameW)(HANDLE, LPWSTR, DWORD);
|
||||
BOOL (WINAPI *QueryFullProcessImageNameA)(HANDLE, DWORD, LPSTR, PDWORD);
|
||||
BOOL (WINAPI *QueryFullProcessImageNameW)(HANDLE, DWORD, LPWSTR, PDWORD);
|
||||
LONG (WINAPI *RegDeleteKeyExA)(HKEY, LPCTSTR, REGSAM, DWORD);
|
||||
BOOL (WINAPI *EnumProcesses)(UINT *, UINT, UINT *);
|
||||
BOOL (WINAPI *EnumProcessModules)(HANDLE, HMODULE *, UINT, UINT *);
|
||||
UINT (WINAPI *GetModuleFileNameExA)(HANDLE, HMODULE, LPSTR, UINT);
|
||||
UINT (WINAPI *GetModuleFileNameExW)(HANDLE, HMODULE, LPWSTR, UINT);
|
||||
UINT (WINAPI *GetProcessImageFileNameA)(HANDLE, LPSTR, UINT);
|
||||
UINT (WINAPI *GetProcessImageFileNameW)(HANDLE, LPWSTR, UINT);
|
||||
BOOL (WINAPI *QueryFullProcessImageNameA)(HANDLE, UINT, LPSTR, PUINT);
|
||||
BOOL (WINAPI *QueryFullProcessImageNameW)(HANDLE, UINT, LPWSTR, PUINT);
|
||||
LONG (WINAPI *RegDeleteKeyExA)(HKEY, LPCTSTR, REGSAM, UINT);
|
||||
BOOL (WINAPI *IsWow64Process)(HANDLE, BOOL *);
|
||||
void (WINAPI *GetNativeSystemInfo)(SYSTEM_INFO *);
|
||||
BOOL (WINAPI *DuplicateTokenEx)(HANDLE, DWORD, SECURITY_ATTRIBUTES *, SECURITY_IMPERSONATION_LEVEL, TOKEN_TYPE, HANDLE *);
|
||||
BOOL (WINAPI *DuplicateTokenEx)(HANDLE, UINT, SECURITY_ATTRIBUTES *, SECURITY_IMPERSONATION_LEVEL, TOKEN_TYPE, HANDLE *);
|
||||
BOOL (WINAPI *ConvertStringSidToSidA)(LPCSTR, PSID *);
|
||||
BOOL (WINAPI *SetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, void *, DWORD);
|
||||
BOOL (WINAPI *GetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, void *, DWORD, PDWORD);
|
||||
BOOL (WINAPI *CreateProcessAsUserA)(HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, void *, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION);
|
||||
BOOL (WINAPI *CreateProcessAsUserW)(HANDLE, LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, void *, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
|
||||
BOOL (WINAPI *LookupAccountSidA)(LPCSTR,PSID,LPSTR,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE);
|
||||
BOOL (WINAPI *LookupAccountNameA)(LPCSTR,LPCSTR,PSID,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE);
|
||||
BOOL (WINAPI *SetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, void *, UINT);
|
||||
BOOL (WINAPI *GetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, void *, UINT, PUINT);
|
||||
BOOL (WINAPI *CreateProcessAsUserA)(HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, UINT, void *, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION);
|
||||
BOOL (WINAPI *CreateProcessAsUserW)(HANDLE, LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, UINT, void *, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
|
||||
BOOL (WINAPI *LookupAccountSidA)(LPCSTR,PSID,LPSTR,LPUINT,LPSTR,LPUINT,PSID_NAME_USE);
|
||||
BOOL (WINAPI *LookupAccountNameA)(LPCSTR,LPCSTR,PSID,LPUINT,LPSTR,LPUINT,PSID_NAME_USE);
|
||||
BOOL (WINAPI *GetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG);
|
||||
BOOL (WINAPI *GetUserNameExW)(EXTENDED_NAME_FORMAT, LPWSTR, PULONG);
|
||||
BOOL (WINAPI *SwitchDesktop)(HDESK);
|
||||
HDESK (WINAPI *OpenDesktopA)(LPTSTR, DWORD, BOOL, ACCESS_MASK);
|
||||
HDESK (WINAPI *OpenDesktopA)(LPTSTR, UINT, BOOL, ACCESS_MASK);
|
||||
BOOL (WINAPI *CloseDesktop)(HDESK);
|
||||
BOOL (WINAPI *SetProcessShutdownParameters)(DWORD, DWORD);
|
||||
BOOL (WINAPI *SetProcessShutdownParameters)(UINT, UINT);
|
||||
HANDLE (WINAPI *RegisterEventSourceW)(LPCWSTR, LPCWSTR);
|
||||
BOOL (WINAPI *ReportEventW)(HANDLE, WORD, WORD, DWORD, PSID, WORD, DWORD, LPCWSTR *, LPVOID);
|
||||
BOOL (WINAPI *ReportEventW)(HANDLE, WORD, WORD, UINT, PSID, WORD, UINT, LPCWSTR *, LPVOID);
|
||||
BOOL (WINAPI *DeregisterEventSource)(HANDLE);
|
||||
BOOL (WINAPI *Wow64DisableWow64FsRedirection)(void **);
|
||||
BOOLEAN (WINAPI *Wow64EnableWow64FsRedirection)(BOOLEAN);
|
||||
BOOL (WINAPI *Wow64RevertWow64FsRedirection)(void *);
|
||||
BOOL (WINAPI *GetFileInformationByHandle)(HANDLE, LPBY_HANDLE_FILE_INFORMATION);
|
||||
HANDLE (WINAPI *GetProcessHeap)();
|
||||
BOOL (WINAPI *MiniDumpWriteDump)(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE,
|
||||
BOOL (WINAPI *MiniDumpWriteDump)(HANDLE, UINT, HANDLE, MINIDUMP_TYPE,
|
||||
PMINIDUMP_EXCEPTION_INFORMATION, PMINIDUMP_USER_STREAM_INFORMATION,
|
||||
PMINIDUMP_CALLBACK_INFORMATION);
|
||||
BOOL (WINAPI *AllocateLocallyUniqueId)(PLUID);
|
||||
@ -382,14 +382,14 @@ typedef struct NT_API
|
||||
PQUOTA_LIMITS, PNTSTATUS);
|
||||
NTSTATUS (NTAPI *LsaDeregisterLogonProcess)(HANDLE);
|
||||
NTSTATUS (NTAPI *LsaFreeReturnBuffer)(PVOID);
|
||||
DWORD (WINAPI *WcmQueryProperty)(const GUID *, LPCWSTR, MS_WCM_PROPERTY, PVOID, PDWORD, PBYTE *);
|
||||
DWORD (WINAPI *WcmSetProperty)(const GUID *, LPCWSTR, MS_WCM_PROPERTY, PVOID, DWORD, const BYTE *);
|
||||
UINT (WINAPI *WcmQueryProperty)(const GUID *, LPCWSTR, MS_WCM_PROPERTY, PVOID, PUINT, PBYTE *);
|
||||
UINT (WINAPI *WcmSetProperty)(const GUID *, LPCWSTR, MS_WCM_PROPERTY, PVOID, UINT, const BYTE *);
|
||||
void (WINAPI *WcmFreeMemory)(PVOID);
|
||||
DWORD (WINAPI *WcmGetProfileList)(PVOID, MS_WCM_PROFILE_INFO_LIST **ppProfileList);
|
||||
DWORD (WINAPI *SetNamedSecurityInfoW)(LPWSTR, UINT, SECURITY_INFORMATION, PSID, PSID, PACL, PACL);
|
||||
BOOL (WINAPI *AddAccessAllowedAceEx)(PACL, DWORD, DWORD, DWORD, PSID);
|
||||
UINT (WINAPI *WcmGetProfileList)(PVOID, MS_WCM_PROFILE_INFO_LIST **ppProfileList);
|
||||
UINT (WINAPI *SetNamedSecurityInfoW)(LPWSTR, UINT, SECURITY_INFORMATION, PSID, PSID, PACL, PACL);
|
||||
BOOL (WINAPI *AddAccessAllowedAceEx)(PACL, UINT, UINT, UINT, PSID);
|
||||
HRESULT (WINAPI *DwmIsCompositionEnabled)(BOOL *);
|
||||
BOOL (WINAPI *GetComputerNameExW)(COMPUTER_NAME_FORMAT, LPWSTR, LPDWORD);
|
||||
BOOL (WINAPI *GetComputerNameExW)(COMPUTER_NAME_FORMAT, LPWSTR, LPUINT);
|
||||
LONG (WINAPI *RegLoadKeyW)(HKEY, LPCWSTR, LPCWSTR);
|
||||
LONG (WINAPI *RegUnLoadKeyW)(HKEY, LPCWSTR);
|
||||
} NT_API;
|
||||
@ -413,7 +413,7 @@ typedef struct MS_USERMODE_SVC_PULSE_THREAD_PARAM
|
||||
// Structure to suppress the warning message
|
||||
typedef struct NO_WARNING
|
||||
{
|
||||
DWORD ThreadId;
|
||||
UINT ThreadId;
|
||||
THREAD *NoWarningThread;
|
||||
EVENT *HaltEvent;
|
||||
volatile bool Halt;
|
||||
@ -541,7 +541,7 @@ void MsFree();
|
||||
char *MsCutExeNameFromCommandLine(char *str);
|
||||
wchar_t *MsCutExeNameFromUniCommandLine(wchar_t *str);
|
||||
|
||||
DWORD MsRegAccessMaskFor64BitEx(bool force32bit, bool force64bit);
|
||||
UINT MsRegAccessMaskFor64BitEx(bool force32bit, bool force64bit);
|
||||
|
||||
bool MsRegIsKey(UINT root, char *name);
|
||||
bool MsRegIsKeyEx(UINT root, char *name, bool force32bit);
|
||||
@ -946,8 +946,8 @@ bool MsStartDevice(HDEVINFO info, SP_DEVINFO_DATA *dev_info_data);
|
||||
bool MsStopDevice(HDEVINFO info, SP_DEVINFO_DATA *dev_info_data);
|
||||
bool MsDeleteDevice(HDEVINFO info, SP_DEVINFO_DATA *dev_info_data);
|
||||
bool MsIsDeviceRunning(HDEVINFO info, SP_DEVINFO_DATA *dev_info_data);
|
||||
void CALLBACK MsServiceDispatcher(DWORD argc, LPTSTR *argv);
|
||||
void CALLBACK MsServiceHandler(DWORD opcode);
|
||||
void CALLBACK MsServiceDispatcher(UINT argc, LPTSTR *argv);
|
||||
void CALLBACK MsServiceHandler(UINT opcode);
|
||||
bool MsServiceStopProc();
|
||||
void MsServiceStoperMainThread(THREAD *t, void *p);
|
||||
void MsServiceStarterMainThread(THREAD *t, void *p);
|
||||
|
@ -14948,7 +14948,7 @@ void QuerySocketInformation(SOCK *sock)
|
||||
struct sockaddr_in6 sockaddr6;
|
||||
struct in6_addr *addr6;
|
||||
int size;
|
||||
DWORD dw;
|
||||
UINT dw;
|
||||
UINT opt_value = 0;
|
||||
|
||||
if (sock->Type == SOCK_TCP)
|
||||
@ -15038,7 +15038,7 @@ void QuerySocketInformation(SOCK *sock)
|
||||
}
|
||||
|
||||
// Support of the TTL value
|
||||
size = sizeof(DWORD);
|
||||
size = sizeof(UINT);
|
||||
if (opt_value == 0 ||
|
||||
getsockopt(sock->socket, (sock->IPv6 ? IPPROTO_IPV6 : IPPROTO_IP), opt_value, (char *)&dw, &size) != 0)
|
||||
{
|
||||
@ -15056,7 +15056,7 @@ void QuerySocketInformation(SOCK *sock)
|
||||
// Setting the TTL value
|
||||
bool SetTtl(SOCK *sock, UINT ttl)
|
||||
{
|
||||
DWORD dw;
|
||||
UINT dw;
|
||||
int size;
|
||||
UINT opt_value = 0;
|
||||
// Validate arguments
|
||||
@ -15076,7 +15076,7 @@ bool SetTtl(SOCK *sock, UINT ttl)
|
||||
}
|
||||
|
||||
dw = ttl;
|
||||
size = sizeof(DWORD);
|
||||
size = sizeof(UINT);
|
||||
|
||||
if (sock->IPv6)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
struct LOCK
|
||||
{
|
||||
void *pData;
|
||||
BOOL Ready;
|
||||
bool Ready;
|
||||
#ifdef OS_UNIX
|
||||
UINT thread_id;
|
||||
UINT locked_count;
|
||||
|
@ -2478,7 +2478,6 @@ void TrimRight(char *str)
|
||||
{
|
||||
char *buf, *tmp;
|
||||
UINT len, i, wp, wp2;
|
||||
BOOL flag;
|
||||
// Validate arguments
|
||||
if (str == NULL)
|
||||
{
|
||||
@ -2496,10 +2495,9 @@ void TrimRight(char *str)
|
||||
|
||||
buf = Malloc(len + 1);
|
||||
tmp = Malloc(len + 1);
|
||||
flag = FALSE;
|
||||
wp = 0;
|
||||
wp2 = 0;
|
||||
for (i = 0;i < len;i++)
|
||||
for (i = 0; i < len; ++i)
|
||||
{
|
||||
if (str[i] != ' ' && str[i] != '\t')
|
||||
{
|
||||
@ -2524,7 +2522,7 @@ void TrimLeft(char *str)
|
||||
{
|
||||
char *buf;
|
||||
UINT len, i, wp;
|
||||
BOOL flag;
|
||||
bool flag;
|
||||
// Validate arguments
|
||||
if (str == NULL)
|
||||
{
|
||||
@ -2541,13 +2539,13 @@ void TrimLeft(char *str)
|
||||
}
|
||||
|
||||
buf = Malloc(len + 1);
|
||||
flag = FALSE;
|
||||
flag = false;
|
||||
wp = 0;
|
||||
for (i = 0;i < len;i++)
|
||||
{
|
||||
if (str[i] != ' ' && str[i] != '\t')
|
||||
{
|
||||
flag = TRUE;
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
|
@ -1938,7 +1938,7 @@ void UnixGetSystemTime(SYSTEMTIME *system_time)
|
||||
|
||||
if (sizeof(time_t) == 4)
|
||||
{
|
||||
now2 = (time_64t)((UINT64)((UINT32)now));
|
||||
now2 = (time_64t)((UINT64)((UINT)now));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1976,7 +1976,7 @@ UINT64 UnixGetTick64()
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
#endif
|
||||
|
||||
ret = ((UINT64)((UINT32)t.tv_sec)) * 1000LL + (UINT64)t.tv_nsec / 1000000LL;
|
||||
ret = ((UINT64)((UINT)t.tv_sec)) * 1000LL + (UINT64)t.tv_nsec / 1000000LL;
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user