Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Remove use of C-style alias declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackerpilot authored and Hackerpilot committed Aug 20, 2014
1 parent fdec422 commit 1465e03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/core/sys/windows/dll.d
Expand Up @@ -72,8 +72,8 @@ private:
int tlsindex;
}

alias extern(Windows)
void* fnRtlAllocateHeap(void* HeapHandle, uint Flags, size_t Size) nothrow;
alias fnRtlAllocateHeap = extern(Windows)
void* function(void* HeapHandle, uint Flags, size_t Size) nothrow;

// find a code sequence and return the address after the sequence
static void* findCodeSequence( void* adr, int len, ref ubyte[] pattern ) nothrow
Expand Down Expand Up @@ -160,7 +160,7 @@ private:
if( !pLdrpNumberOfTlsEntries || !pNtdllBaseTag || !pLdrpTlsList )
return null;

fnRtlAllocateHeap* fnAlloc = cast(fnRtlAllocateHeap*) GetProcAddress( hnd, "RtlAllocateHeap" );
fnRtlAllocateHeap fnAlloc = cast(fnRtlAllocateHeap) GetProcAddress( hnd, "RtlAllocateHeap" );
if( !fnAlloc )
return null;

Expand Down Expand Up @@ -197,7 +197,7 @@ private:
HANDLE hnd = GetModuleHandleA( "NTDLL" );
assert( hnd, "cannot get module handle for ntdll" );

fnRtlAllocateHeap* fnAlloc = cast(fnRtlAllocateHeap*) GetProcAddress( hnd, "RtlAllocateHeap" );
fnRtlAllocateHeap fnAlloc = cast(fnRtlAllocateHeap) GetProcAddress( hnd, "RtlAllocateHeap" );
if( !fnAlloc || !pNtdllBaseTag )
return false;

Expand Down
12 changes: 6 additions & 6 deletions src/core/sys/windows/threadaux.d
Expand Up @@ -107,8 +107,8 @@ private:
int reserved;
}

alias extern(Windows)
HRESULT fnNtQuerySystemInformation( uint SystemInformationClass, void* info, uint infoLength, uint* ReturnLength ) nothrow;
alias fnNtQuerySystemInformation = extern(Windows)
HRESULT function( uint SystemInformationClass, void* info, uint infoLength, uint* ReturnLength ) nothrow;

enum ThreadBasicInformation = 0;

Expand All @@ -123,8 +123,8 @@ private:
int BasePriority;
}

alias extern(Windows)
int fnNtQueryInformationThread( HANDLE ThreadHandle, uint ThreadInformationClass, void* buf, uint size, uint* ReturnLength ) nothrow;
alias fnNtQueryInformationThread = extern(Windows)
int function( HANDLE ThreadHandle, uint ThreadInformationClass, void* buf, uint size, uint* ReturnLength ) nothrow;

enum SYNCHRONIZE = 0x00100000;
enum THREAD_GET_CONTEXT = 8;
Expand All @@ -137,7 +137,7 @@ private:
{
HANDLE nthnd = GetModuleHandleA( "NTDLL" );
assert( nthnd, "cannot get module handle for ntdll" );
fnNtQueryInformationThread* fn = cast(fnNtQueryInformationThread*) GetProcAddress( nthnd, "NtQueryInformationThread" );
fnNtQueryInformationThread fn = cast(fnNtQueryInformationThread) GetProcAddress( nthnd, "NtQueryInformationThread" );
assert( fn, "cannot find NtQueryInformationThread in ntdll" );

THREAD_BASIC_INFORMATION tbi;
Expand Down Expand Up @@ -212,7 +212,7 @@ private:
static bool enumProcessThreads( uint procid, bool function( uint id, void* context ) dg, void* context )
{
HANDLE hnd = GetModuleHandleA( "NTDLL" );
fnNtQuerySystemInformation* fn = cast(fnNtQuerySystemInformation*) GetProcAddress( hnd, "NtQuerySystemInformation" );
fnNtQuerySystemInformation fn = cast(fnNtQuerySystemInformation) GetProcAddress( hnd, "NtQuerySystemInformation" );
if( !fn )
return false;

Expand Down

0 comments on commit 1465e03

Please sign in to comment.