api: use standard C void

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2020-10-17 15:12:20 +02:00 committed by Jason A. Donenfeld
parent 449876fdfd
commit 0fdd9fbb85
7 changed files with 13 additions and 12 deletions

View File

@ -815,7 +815,7 @@ static WINTUN_STATUS
InstallCertificate(_In_z_ const WCHAR *SignedResource)
{
LOG(WINTUN_LOG_INFO, L"Trusting code signing certificate");
const VOID *LockedResource;
const void *LockedResource;
DWORD SizeResource;
DWORD Result = ResourceGetAddress(SignedResource, &LockedResource, &SizeResource);
if (Result != ERROR_SUCCESS)

View File

@ -26,7 +26,8 @@ DriverIsOurDrvInfoDetail(_In_ const SP_DRVINFO_DETAIL_DATA_W *DrvInfoDetailData)
#if defined(HAVE_EV) || defined(HAVE_WHQL)
WINTUN_STATUS DriverRemoveAllOurs(VOID)
WINTUN_STATUS
DriverRemoveAllOurs(void)
{
HDEVINFO DevInfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_NET, NULL, NULL, 0);
if (!DevInfo)

View File

@ -35,4 +35,4 @@ DriverIsOurDrvInfoDetail(_In_ const SP_DRVINFO_DETAIL_DATA_W *DrvInfoDetailData)
*
* @return ERROR_SUCCESS on success or the adapter was not found; Win32 error code otherwise.
*/
WINTUN_STATUS DriverRemoveAllOurs(VOID);
WINTUN_STATUS DriverRemoveAllOurs(void);

View File

@ -15,7 +15,7 @@ NopLogger(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *LogLine)
WINTUN_LOGGER_FUNC Logger = NopLogger;
VOID CALLBACK
void CALLBACK
WintunSetLogger(_In_ WINTUN_LOGGER_FUNC NewLogger)
{
Logger = NewLogger;
@ -30,7 +30,7 @@ LoggerError(_In_z_ const WCHAR *Prefix, _In_ DWORD Error)
NULL,
HRESULT_FROM_SETUPAPI(Error),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(VOID *)&SystemMessage,
(void *)&SystemMessage,
0,
NULL);
FormatMessageW(
@ -39,7 +39,7 @@ LoggerError(_In_z_ const WCHAR *Prefix, _In_ DWORD Error)
SystemMessage ? L"%1: %3(Code 0x%2!08X!)" : L"%1: Code 0x%2!08X!",
0,
0,
(VOID *)&FormattedMessage,
(void *)&FormattedMessage,
0,
(va_list *)(DWORD_PTR[]){ (DWORD_PTR)Prefix, (DWORD_PTR)Error, (DWORD_PTR)SystemMessage });
if (FormattedMessage)

View File

@ -6,7 +6,7 @@
#include "pch.h"
WINTUN_STATUS
ResourceGetAddress(_In_z_ const WCHAR *ResourceName, _Out_ const VOID **Address, _Out_ DWORD *Size)
ResourceGetAddress(_In_z_ const WCHAR *ResourceName, _Out_ const void **Address, _Out_ DWORD *Size)
{
HRSRC FoundResource = FindResourceW(ResourceModule, ResourceName, RT_RCDATA);
if (!FoundResource)
@ -29,7 +29,7 @@ ResourceGetAddress(_In_z_ const WCHAR *ResourceName, _Out_ const VOID **Address,
WINTUN_STATUS
ResourceCopyToFile(_In_z_ const WCHAR *DestinationPath, _In_z_ const WCHAR *ResourceName)
{
const VOID *LockedResource;
const void *LockedResource;
DWORD SizeResource;
DWORD Result = ResourceGetAddress(ResourceName, &LockedResource, &SizeResource);
if (Result != ERROR_SUCCESS)

View File

@ -20,7 +20,7 @@
* @return ERROR_SUCCESS on success; Win32 error code otherwise.
*/
WINTUN_STATUS
ResourceGetAddress(_In_z_ const WCHAR *ResourceName, _Out_ const VOID **Address, _Out_ DWORD *Size);
ResourceGetAddress(_In_z_ const WCHAR *ResourceName, _Out_ const void **Address, _Out_ DWORD *Size);
/**
* Copies resource to a file.

View File

@ -29,7 +29,7 @@ ConsoleLogger(_In_ WINTUN_LOGGER_LEVEL Level, _In_ const WCHAR *LogLine)
return TRUE;
}
static BOOL ElevateToSystem(VOID)
static BOOL ElevateToSystem(void)
{
HANDLE CurrentProcessToken, ThreadToken, ProcessSnapshot, WinlogonProcess, WinlogonToken, DuplicatedToken;
PROCESSENTRY32W ProcessEntry = { .dwSize = sizeof(PROCESSENTRY32W) };
@ -126,14 +126,14 @@ cleanup:
static int Argc;
static WCHAR **Argv;
static void Init(VOID)
static void Init(void)
{
WintunSetLogger(ConsoleLogger);
Argv = CommandLineToArgvW(GetCommandLineW(), &Argc);
ElevateToSystem();
}
static void Done(VOID)
static void Done(void)
{
RevertToSelf();
LocalFree(Argv);