2015-02-17 13:30:22 +00:00
|
|
|
/*
|
2016-05-17 18:24:46 +00:00
|
|
|
* Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
|
2015-02-17 13:30:22 +00:00
|
|
|
*
|
2016-05-17 18:24:46 +00:00
|
|
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
2015-02-17 13:30:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the same detection used in cryptlib to set up the thread local
|
|
|
|
* storage that we depend on, so just copy that
|
|
|
|
*/
|
2016-02-04 16:41:25 +00:00
|
|
|
#if defined(_WIN32) && !defined(OPENSSL_NO_ASYNC)
|
2015-11-22 01:14:43 +00:00
|
|
|
#include <openssl/async.h>
|
2015-02-17 13:30:22 +00:00
|
|
|
# define ASYNC_WIN
|
|
|
|
# define ASYNC_ARCH
|
|
|
|
|
|
|
|
# include <windows.h>
|
2015-09-16 22:43:45 +00:00
|
|
|
# include "internal/cryptlib.h"
|
2015-02-17 13:30:22 +00:00
|
|
|
|
|
|
|
typedef struct async_fibre_st {
|
|
|
|
LPVOID fibre;
|
2015-11-19 21:44:13 +00:00
|
|
|
int converted;
|
2015-10-06 10:25:16 +00:00
|
|
|
} async_fibre;
|
2015-02-17 13:30:22 +00:00
|
|
|
|
2015-10-06 10:25:16 +00:00
|
|
|
# define async_fibre_swapcontext(o,n,r) \
|
2015-02-17 13:30:22 +00:00
|
|
|
(SwitchToFiber((n)->fibre), 1)
|
2015-10-06 10:25:16 +00:00
|
|
|
# define async_fibre_makecontext(c) \
|
|
|
|
((c)->fibre = CreateFiber(0, async_start_func_win, 0))
|
|
|
|
# define async_fibre_free(f) (DeleteFiber((f)->fibre))
|
2015-02-17 13:30:22 +00:00
|
|
|
|
2015-10-06 10:25:16 +00:00
|
|
|
int async_fibre_init_dispatcher(async_fibre *fibre);
|
|
|
|
VOID CALLBACK async_start_func_win(PVOID unused);
|
2015-02-17 13:30:22 +00:00
|
|
|
|
|
|
|
#endif
|