size_t max_size;
};
-void ASYNC_start_func(void);
+void async_start_func(void);
-int ASYNC_FIBRE_init_dispatcher(ASYNC_FIBRE *fibre)
+int async_fibre_init_dispatcher(async_fibre *fibre)
{
LPVOID dispatcher;
dispatcher =
(LPVOID) CRYPTO_get_thread_local(CRYPTO_THREAD_LOCAL_ASYNC_DISPATCH);
- if (!dispatcher) {
+ if (dispatcher == NULL) {
fibre->fibre = ConvertThreadToFiber(NULL);
CRYPTO_set_thread_local(CRYPTO_THREAD_LOCAL_ASYNC_DISPATCH,
(void *)fibre->fibre);
return 1;
}
-VOID CALLBACK ASYNC_start_func_win(PVOID unused)
+VOID CALLBACK async_start_func_win(PVOID unused)
{
- ASYNC_start_func();
+ async_start_func();
}
-int async_pipe(int *pipefds)
+int async_pipe(OSSL_ASYNC_FD *pipefds)
{
- if (_pipe(pipefds, 256, _O_BINARY) == 0)
- return 1;
+ if (CreatePipe(&pipefds[0], &pipefds[1], NULL, 256) == 0)
+ return 0;
- return 0;
+ return 1;
}
-int async_write1(int fd, const void *buf)
+int async_write1(OSSL_ASYNC_FD fd, const void *buf)
{
- if (_write(fd, buf, 1) > 0)
+ DWORD numwritten = 0;
+
+ if (WriteFile(fd, buf, 1, &numwritten, NULL) && numwritten == 1)
return 1;
return 0;
}
-int async_read1(int fd, void *buf)
+int async_read1(OSSL_ASYNC_FD fd, void *buf)
{
- if (_read(fd, buf, 1) > 0)
+ DWORD numread = 0;
+
+ if (ReadFile(fd, buf, 1, &numread, NULL) && numread == 1)
return 1;
return 0;
{
struct winpool *pool;
pool = OPENSSL_malloc(sizeof *pool);
- if (!pool)
+ if (pool == NULL)
return 0;
pool->pool = poolin;