Go to the source code of this file.
◆ BOOL()
◆ DWORD()
◆ FiberLocalStorageProc()
Definition at line 64 of file fiber.c.
65{
67 "FlsData expected not to be changed, value is %p, expected %p\n",
70}
static void * fls_value_to_set
Referenced by START_TEST().
◆ FiberMainProc()
◆ init_funcs()
Definition at line 44 of file fiber.c.
45{
47
48#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f);
61#undef X
62}
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)
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)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
void WINAPI SwitchToFiber(_In_ PVOID)
Referenced by START_TEST().
◆ LPVOID()
◆ PVOID()
◆ START_TEST()
Definition at line 396 of file fiber.c.
397{
399
400 if (!pCreateFiber)
401 {
402 win_skip(
"Fibers not supported by win95\n" );
403 return;
404 }
405
410}
static void test_FiberLocalStorageWithFibers(PFLS_CALLBACK_FUNCTION cbfunc)
static VOID init_funcs(void)
static void test_FiberHandling(void)
static void test_FiberLocalStorageCallback(PFLS_CALLBACK_FUNCTION cbfunc)
static void test_FiberLocalStorage(void)
static VOID WINAPI FiberLocalStorageProc(PVOID lpFlsData)
◆ test_ConvertFiberToThread()
static void test_ConvertFiberToThread |
( |
void |
| ) |
|
|
static |
◆ test_ConvertThreadToFiber()
static void test_ConvertThreadToFiber |
( |
void |
| ) |
|
|
static |
◆ test_ConvertThreadToFiberEx()
static void test_ConvertThreadToFiberEx |
( |
void |
| ) |
|
|
static |
Definition at line 111 of file fiber.c.
112{
113 if (pConvertThreadToFiberEx)
114 {
117 }
118 else
119 {
120 win_skip(
"ConvertThreadToFiberEx not present\n" );
121 }
122}
Referenced by test_FiberHandling().
◆ test_FiberHandling()
Definition at line 137 of file fiber.c.
138{
143
146 if (pConvertThreadToFiberEx)
148 else
150
153
154 pSwitchToFiber(
fibers[1]);
157
158 if (pCreateFiberEx)
159 {
162
163 pSwitchToFiber(
fibers[1]);
166 }
167 else win_skip(
"CreateFiberEx not present\n" );
168
169 if (pIsThreadAFiber)
ok(pIsThreadAFiber(),
"IsThreadAFiber reported FALSE\n");
171 if (pIsThreadAFiber)
ok(!pIsThreadAFiber(),
"IsThreadAFiber reported TRUE\n");
172}
static void test_ConvertThreadToFiberEx(void)
static void test_ConvertFiberToThread(void)
static void test_ConvertThreadToFiber(void)
static VOID WINAPI FiberMainProc(LPVOID lpFiberParameter)
Referenced by START_TEST().
◆ test_FiberLocalStorage()
static void test_FiberLocalStorage |
( |
void |
| ) |
|
|
static |
Definition at line 174 of file fiber.c.
175{
179
180 if (!pFlsAlloc || !pFlsSetValue || !pFlsGetValue || !pFlsFree)
181 {
182 win_skip(
"Fiber Local Storage not supported\n" );
183 return;
184 }
185
186
187
188
189
191 ret = pFlsFree( 127 );
192 ok( !
ret,
"freeing fls index 127 (unallocated) succeeded\n" );
194 "freeing fls index 127 (unallocated) wrong error %u\n",
GetLastError() );
195
196 val = pFlsGetValue( 127 );
198 "getting fls index 127 (unallocated) failed with error %u\n",
GetLastError() );
199
200 ret = pFlsSetValue( 127, (
void*) 0x217 );
201 ok(
ret,
"setting fls index 127 (unallocated) failed with error %u\n",
GetLastError() );
202
204 val = pFlsGetValue( 127 );
205 ok(
val == (
void*) 0x217,
"fls index 127 (unallocated) wrong value %p\n",
val );
207 "getting fls index 127 (unallocated) failed with error %u\n",
GetLastError() );
208
209
210
211
213 ret = pFlsFree( 128 );
214 ok( !
ret,
"freeing fls index 128 (out of bounds) succeeded\n" );
216 "freeing fls index 128 (out of bounds) wrong error %u\n",
GetLastError() );
217
219 ret = pFlsSetValue( 128, (
void*) 0x217 );
220 ok( !
ret,
"setting fls index 128 (out of bounds) succeeded\n" );
222 "setting fls index 128 (out of bounds) wrong error %u\n",
GetLastError() );
223
225 val = pFlsGetValue( 128 );
227 "getting fls index 128 (out of bounds) wrong error %u\n",
GetLastError() );
228
229
231 val = pFlsGetValue( 0 );
232 ok( !
val,
"fls index 0 set to %p\n",
val );
235 ret = pFlsSetValue( 0, (
void *)0xdeadbeef );
236 ok( !
ret,
"setting fls index 0 succeeded\n" );
239 val = pFlsGetValue( 0 );
240 ok( !
val,
"fls index 0 wrong value %p\n",
val );
242
243
246 ok(
fls != 0,
"fls index 0 allocated\n" );
247 val = pFlsGetValue(
fls );
248 ok( !
val,
"fls index %u wrong value %p\n",
fls,
val );
249 ret = pFlsSetValue(
fls, (
void *)0xdeadbeef );
250 ok(
ret,
"setting fls index %u failed\n",
fls );
252 val = pFlsGetValue(
fls );
253 ok(
val == (
void *)0xdeadbeef,
"fls index %u wrong value %p\n",
fls,
val );
257
258
260 val = pFlsGetValue(
fls );
264
265
266 ret = pFlsSetValue(
fls, (
void *)0xdeadbabe );
267 ok(
ret,
"setting fls index %u failed\n",
fls );
268 val = pFlsGetValue(
fls );
269 ok(
val == (
void *)0xdeadbabe,
"fls index %u wrong value %p\n",
fls,
val );
270
271
272 fls_2 = pFlsAlloc(
NULL );
274
275 ok( fls_2 ==
fls,
"different FLS index allocated, was %u, now %u\n",
fls, fls_2 );
276
278 val = pFlsGetValue( fls_2 );
281 "getting fls index %u failed with error %u\n", fls_2,
GetLastError() );
282 pFlsFree( fls_2 );
283}
#define ERROR_INVALID_PARAMETER
Referenced by START_TEST().
◆ test_FiberLocalStorageCallback()
Definition at line 285 of file fiber.c.
286{
290
291 if (!pFlsAlloc || !pFlsSetValue || !pFlsGetValue || !pFlsFree)
292 {
293 win_skip(
"Fiber Local Storage not supported\n" );
294 return;
295 }
296
297
299 fls = pFlsAlloc( cbfunc );
301
302 val = (
void*) 0x1587;
306
307 val2 = pFlsGetValue(
fls );
308 ok(
val == val2,
"FlsGetValue returned %p, expected %p\n", val2,
val);
309
313
314
316 fls = pFlsAlloc( cbfunc );
318
321
325}
Referenced by START_TEST().
◆ test_FiberLocalStorageWithFibers()
Definition at line 327 of file fiber.c.
328{
329 void* val1 = (void*) 0x314;
330 void* val2 = (void*) 0x152;
332
333 if (!pFlsAlloc || !pFlsFree || !pFlsSetValue || !pFlsGetValue)
334 {
335 win_skip(
"Fiber Local Storage not supported\n" );
336 return;
337 }
338
341
343
352
356 pSwitchToFiber(
fibers[1]);
359
363 pSwitchToFiber(
fibers[2]);
366
369 ok(
ret,
"FlsSetValue failed\n");
371
378
385
392
394}
Referenced by START_TEST().
◆ void()
◆ cbCount
◆ DWORD
◆ fiberCount
◆ fibers
◆ fls_index_to_set
◆ fls_value_to_set
◆ LPFIBER_START_ROUTINE
◆ LPVOID
◆ PVOID
◆ SIZE_T
◆ testparam