45 for (
n = 1;
n <= FlsHighIndex; ++
n)
48 if (lpCallback && pFlsData->
Data[
n])
50 lpCallback(pFlsData->
Data[
n]);
68 DPRINT1(
"Converting Fiber to Thread\n");
72 if (!Teb->HasFiberData)
80 Teb->HasFiberData =
FALSE;
104 DPRINT1(
"Converting Thread to Fiber\n");
107 if (
dwFlags & ~FIBER_FLAG_FLOAT_SWITCH)
116 if (Teb->HasFiberData)
151 Teb->HasFiberData =
TRUE;
201 DPRINT(
"Creating Fiber\n");
204 if (
dwFlags & ~FIBER_FLAG_FLOAT_SWITCH)
212 ActivationContextStackPointer =
NULL;
213 Status = RtlAllocateActivationContextStack(&ActivationContextStackPointer);
228 RtlFreeActivationContextStack(ActivationContextStackPointer);
248 RtlFreeActivationContextStack(ActivationContextStackPointer);
299 if ((Teb->HasFiberData) &&
381 if (dwFlsIndex >
Peb->FlsHighIndex)
382 Peb->FlsHighIndex = dwFlsIndex;
429 if (pFlsData->
Data[dwFlsIndex])
433 lpCallback(pFlsData->
Data[dwFlsIndex]);
472 return pFlsData->
Data[dwFlsIndex];
508 pFlsData->
Data[dwFlsIndex] = lpFlsData;
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define RtlFindClearBitsAndSet
#define ERROR_NOT_ENOUGH_MEMORY
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define ERROR_NO_MORE_ITEMS
LPVOID WINAPI ConvertThreadToFiberEx(_In_opt_ LPVOID lpParameter, _In_ DWORD dwFlags)
BOOL WINAPI ConvertFiberToThread(VOID)
LPVOID WINAPI CreateFiberEx(_In_ SIZE_T dwStackCommitSize, _In_ SIZE_T dwStackReserveSize, _In_ DWORD dwFlags, _In_ LPFIBER_START_ROUTINE lpStartAddress, _In_opt_ LPVOID lpParameter)
VOID WINAPI DeleteFiber(_In_ LPVOID lpFiber)
BOOL WINAPI IsThreadAFiber(VOID)
VOID WINAPI BaseRundownFls(_In_ PVOID FlsData)
PVOID WINAPI FlsGetValue(DWORD dwFlsIndex)
BOOL WINAPI FlsSetValue(DWORD dwFlsIndex, PVOID lpFlsData)
LPVOID WINAPI ConvertThreadToFiber(_In_opt_ LPVOID lpParameter)
BOOL WINAPI FlsFree(DWORD dwFlsIndex)
DWORD WINAPI FlsAlloc(PFLS_CALLBACK_FUNCTION lpCallback)
LPVOID WINAPI CreateFiber(_In_ SIZE_T dwStackSize, _In_ LPFIBER_START_ROUTINE lpStartAddress, _In_opt_ LPVOID lpParameter)
VOID WINAPI ExitThread(IN DWORD uExitCode)
NTSTATUS WINAPI BaseCreateStack(_In_ HANDLE hProcess, _In_opt_ SIZE_T StackCommit, _In_opt_ SIZE_T StackReserve, _Out_ PINITIAL_TEB InitialTeb)
VOID WINAPI BaseInitializeContext(IN PCONTEXT Context, IN PVOID Parameter, IN PVOID StartAddress, IN PVOID StackAddress, IN ULONG ContextType)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
NTSYSAPI void WINAPI RtlReleasePebLock(void)
NTSYSAPI void WINAPI RtlAcquirePebLock(void)
#define RTL_FLS_MAXIMUM_AVAILABLE
#define EXCEPTION_CHAIN_END
#define NtCurrentProcess()
#define CONTEXT_FLOATING_POINT
NTSTATUS NTAPI NtFreeVirtualMemory(IN HANDLE ProcessHandle, IN PVOID *UBaseAddress, IN PSIZE_T URegionSize, IN ULONG FreeType)
DWORD BaseSetLastNTError(IN NTSTATUS Status)
base of all file and directory entries
ULONG GuaranteedStackBytes
struct _ACTIVATION_CONTEXT_STACK * ActivationContextStackPointer
struct _EXCEPTION_REGISTRATION_RECORD * ExceptionList
struct _LIST_ENTRY * Flink
struct _EXCEPTION_REGISTRATION_RECORD * ExceptionList
PVOID Data[RTL_FLS_MAXIMUM_AVAILABLE]
PVOID ActivationContextStackPointer
ULONG GuaranteedStackBytes
#define FIELD_OFFSET(t, f)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
#define FLS_OUT_OF_INDEXES
VOID(WINAPI * PFLS_CALLBACK_FUNCTION)(PVOID)
PFIBER_START_ROUTINE LPFIBER_START_ROUTINE
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define ERROR_ALREADY_THREAD
#define ERROR_ALREADY_FIBER
#define FLS_MAXIMUM_AVAILABLE