From: Timo Kreuzer Date: Tue, 28 Apr 2015 21:27:16 +0000 (+0000) Subject: [KERNEL32/NDK] X-Git-Tag: backups/colins-printing-for-freedom@73041~145 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=58de1d8ba92afe103f79258577c8566e127e167e [KERNEL32/NDK] Move definition of FIBER to NDK svn path=/trunk/; revision=67472 --- diff --git a/reactos/dll/win32/kernel32/client/fiber.c b/reactos/dll/win32/kernel32/client/fiber.c index 22ece1be4e6..f3fb5707566 100644 --- a/reactos/dll/win32/kernel32/client/fiber.c +++ b/reactos/dll/win32/kernel32/client/fiber.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS System Libraries * FILE: lib/kernel32/thread/fiber.c * PURPOSE: Fiber Implementation - * PROGRAMMERS: + * PROGRAMMERS: * Alex Ionescu (alex@relsoft.net) * KJK::Hyperion */ @@ -12,19 +12,16 @@ #define NDEBUG #include -typedef struct _FIBER /* Field offsets: */ -{ /* 32 bit 64 bit */ - /* this must be the first field */ - PVOID Parameter; /* 0x00 0x00 */ - PEXCEPTION_REGISTRATION_RECORD ExceptionList; /* 0x04 0x08 */ - PVOID StackBase; /* 0x08 0x10 */ - PVOID StackLimit; /* 0x0C 0x18 */ - PVOID DeallocationStack; /* 0x10 0x20 */ - CONTEXT Context; /* 0x14 0x28 */ - ULONG GuaranteedStackBytes; /* 0x2E0 */ - PVOID FlsData; /* 0x2E4 */ - PACTIVATION_CONTEXT_STACK ActivationContextStack; /* 0x2E8 */ -} FIBER, *PFIBER; +#ifdef _M_IX86 +C_ASSERT(FIELD_OFFSET(FIBER, ExceptionList) == 0x04); +C_ASSERT(FIELD_OFFSET(FIBER, StackBase) == 0x08); +C_ASSERT(FIELD_OFFSET(FIBER, StackLimit) == 0x0C); +C_ASSERT(FIELD_OFFSET(FIBER, DeallocationStack) == 0x10); +C_ASSERT(FIELD_OFFSET(FIBER, Context) == 0x14); +C_ASSERT(FIELD_OFFSET(FIBER, GuaranteedStackBytes) == 0x2E0); +C_ASSERT(FIELD_OFFSET(FIBER, FlsData) == 0x2E4); +C_ASSERT(FIELD_OFFSET(FIBER, ActivationContextStack) == 0x2E8); +#endif // _M_IX86 /* PRIVATE FUNCTIONS **********************************************************/ @@ -76,7 +73,7 @@ ConvertFiberToThread(VOID) */ LPVOID WINAPI -ConvertThreadToFiberEx(LPVOID lpParameter, +ConvertThreadToFiberEx(LPVOID lpParameter, DWORD dwFlags) { PTEB Teb; diff --git a/reactos/include/asm/genincdata.c b/reactos/include/asm/genincdata.c index fad0e01b923..12f48b8c2ea 100644 --- a/reactos/include/asm/genincdata.c +++ b/reactos/include/asm/genincdata.c @@ -27,21 +27,6 @@ enum }; #endif -// FIXME: where to put this? -typedef struct _FIBER /* Field offsets: */ -{ /* 32 bit 64 bit */ - /* this must be the first field */ - PVOID Parameter; /* 0x00 0x00 */ - PEXCEPTION_REGISTRATION_RECORD ExceptionList; /* 0x04 0x08 */ - PVOID StackBase; /* 0x08 0x10 */ - PVOID StackLimit; /* 0x0C 0x18 */ - PVOID DeallocationStack; /* 0x10 0x20 */ - CONTEXT Context; /* 0x14 0x28 */ - ULONG GuaranteedStackBytes; /* 0x2E0 */ - PVOID FlsData; /* 0x2E4 */ - PVOID /* PACTIVATION_CONTEXT_STACK */ ActivationContextStack; /* 0x2E8 */ -} FIBER, *PFIBER; - typedef struct { char Type; @@ -75,10 +60,8 @@ __attribute__ ((section(".asmdef"))) ASMGENDATA Table[] = { -#if defined (_M_IX86) || defined (_M_AMD64) /* PORTABLE CONSTANTS ********************************************************/ #include "ksx.template.h" -#endif /* ARCHITECTURE SPECIFIC CONTSTANTS ******************************************/ #ifdef _M_IX86 diff --git a/reactos/include/ndk/ketypes.h b/reactos/include/ndk/ketypes.h index 707bf51910a..78f5058264e 100644 --- a/reactos/include/ndk/ketypes.h +++ b/reactos/include/ndk/ketypes.h @@ -168,6 +168,20 @@ Author: #define KI_EXCEPTION_INTERNAL 0x10000000 #define KI_EXCEPTION_ACCESS_VIOLATION (KI_EXCEPTION_INTERNAL | 0x04) +typedef struct _FIBER /* Field offsets: */ +{ /* 32 bit 64 bit */ + /* this must be the first field */ + PVOID Parameter; /* 0x00 0x00 */ + struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList; /* 0x04 0x08 */ + PVOID StackBase; /* 0x08 0x10 */ + PVOID StackLimit; /* 0x0C 0x18 */ + PVOID DeallocationStack; /* 0x10 0x20 */ + CONTEXT Context; /* 0x14 0x28 */ + ULONG GuaranteedStackBytes; /* 0x2E0 */ + PVOID FlsData; /* 0x2E4 */ + struct _ACTIVATION_CONTEXT_STACK *ActivationContextStack;/* 0x2E8 */ +} FIBER, *PFIBER; + #ifndef NTOS_MODE_USER // // Number of dispatch codes supported by KINTERRUPT