File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717#endif
1818
1919/* WDK hacks */
20+ #ifdef _M_ARM64
21+ #define IoAllocateAdapterChannel _IoAllocateAdapterChannel
22+ #define KeGetCurrentThread _KeGetCurrentThread
23+ #define RtlFillMemoryUlong _RtlFillMemoryUlong
24+ #endif
25+
2026#ifdef _M_AMD64
2127#define IoAllocateAdapterChannel _IoAllocateAdapterChannel
2228#define KeGetCurrentThread _KeGetCurrentThread
Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
427427 // return (struct _TEB *)KeGetPcr()->Used_Self;
428428 return (struct _TEB * )(ULONG_PTR )_MoveFromCoprocessor (CP15_TPIDRURW );
429429#elif defined (_M_ARM64 )
430- return (struct _TEB * )__getReg ( 18 );
430+ return (struct _TEB * )__readx18qword ( FIELD_OFFSET ( NT_TIB , Self ) );
431431#else
432432#error Unsupported architecture
433433#endif
Original file line number Diff line number Diff line change @@ -4612,12 +4612,15 @@ FORCEINLINE PVOID GetCurrentFiber(VOID)
46124612#elif defined (_M_ARM64 )
46134613FORCEINLINE struct _TEB * NtCurrentTeb (VOID )
46144614{
4615- return (struct _TEB * )__getReg ( 18 );
4615+ return (struct _TEB * )__readx18qword ( FIELD_OFFSET ( NT_TIB , Self ) );
46164616}
46174617FORCEINLINE PVOID GetCurrentFiber (VOID )
46184618{
4619- //UNIMPLEMENTED;
4620- return 0 ;
4619+ #ifdef NONAMELESSUNION
4620+ return (PVOID )__readgsqword (FIELD_OFFSET (NT_TIB , DUMMYUNIONNAME .FiberData ));
4621+ #else
4622+ return (PVOID )__readgsqword (FIELD_OFFSET (NT_TIB , FiberData ));
4623+ #endif
46214624}
46224625#elif defined(_M_PPC )
46234626FORCEINLINE unsigned long _read_teb_dword (const unsigned long Offset )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ PRTLP_UNHANDLED_EXCEPTION_FILTER RtlpUnhandledExceptionFilter;
2222
2323/* FUNCTIONS ***************************************************************/
2424
25- #if !defined(_M_IX86 ) && !defined(_M_AMD64 )
25+ #if !defined(_M_IX86 ) && !defined(_M_AMD64 ) && !defined( _M_ARM64 )
2626
2727/*
2828 * @implemented
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ RtlInterlockedPushListSList(
208208}
209209
210210
211- #if !defined(_M_IX86 ) && !defined(_M_AMD64 )
211+ #if !defined(_M_IX86 ) && !defined(_M_AMD64 ) && !defined( _M_ARM64 )
212212
213213_WARN ("C based S-List functions can bugcheck, if not handled properly in kernel" )
214214
You can’t perform that action at this time.
0 commit comments