diff --git a/bee/net/bpoll_win.cpp b/bee/net/bpoll_win.cpp index 6095b47b..28cdc5ed 100644 --- a/bee/net/bpoll_win.cpp +++ b/bee/net/bpoll_win.cpp @@ -7,19 +7,19 @@ namespace bee::net { bpoll_handle bpoll_create() noexcept { afd::afd_context ctx; if (!afd::afd_create(ctx)) { - return retired_fd; + return invalid_bpoll_handle; } afd::poller* ep = new (std::nothrow) afd::poller(std::move(ctx)); if (ep == NULL) { afd::afd_destroy(ctx); SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return retired_fd; + return invalid_bpoll_handle; } return (fd_t)ep; } bool bpoll_close(bpoll_handle handle) noexcept { - if (handle == retired_fd) { + if (handle == invalid_bpoll_handle) { SetLastError(ERROR_INVALID_HANDLE); return false; } @@ -29,7 +29,7 @@ namespace bee::net { } bool bpoll_ctl_add(bpoll_handle handle, fd_t socket, const bpoll_event_t& event) noexcept { - if (handle == retired_fd) { + if (handle == invalid_bpoll_handle) { SetLastError(ERROR_INVALID_HANDLE); return false; } @@ -47,7 +47,7 @@ namespace bee::net { } bool bpoll_ctl_mod(bpoll_handle handle, fd_t socket, const bpoll_event_t& event) noexcept { - if (handle == retired_fd) { + if (handle == invalid_bpoll_handle) { SetLastError(ERROR_INVALID_HANDLE); return false; } @@ -65,7 +65,7 @@ namespace bee::net { } bool bpoll_ctl_del(bpoll_handle handle, fd_t socket) noexcept { - if (handle == retired_fd) { + if (handle == invalid_bpoll_handle) { SetLastError(ERROR_INVALID_HANDLE); return false; } @@ -83,7 +83,7 @@ namespace bee::net { } int bpoll_wait(bpoll_handle handle, const span& events, int timeout) noexcept { - if (handle == retired_fd) { + if (handle == invalid_bpoll_handle) { SetLastError(ERROR_INVALID_HANDLE); return -1; } diff --git a/bee/win/afd/afd.cpp b/bee/win/afd/afd.cpp index 3481d190..61f48e39 100644 --- a/bee/win/afd/afd.cpp +++ b/bee/win/afd/afd.cpp @@ -50,8 +50,8 @@ namespace bee::net::afd { #define RTL_CONSTANT_OBJECT_ATTRIBUTES(ObjectName, Attributes) \ { sizeof(OBJECT_ATTRIBUTES), NULL, ObjectName, Attributes, NULL, NULL } - static UNICODE_STRING afd__device_name = RTL_CONSTANT_STRING(L"\\Device\\Afd\\Wepoll"); - static OBJECT_ATTRIBUTES afd__device_attributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(&afd__device_name, 0); + static UNICODE_STRING afd_device_name = RTL_CONSTANT_STRING(L"\\Device\\Afd\\bee\\epoll"); + static OBJECT_ATTRIBUTES afd_device_attributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(&afd_device_name, 0); static uint32_t bpoll_events_to_afd_events(bpoll_event bpoll_events) noexcept { uint32_t afd_events = AFD_POLL_LOCAL_CLOSE; @@ -101,7 +101,7 @@ namespace bee::net::afd { return false; } IO_STATUS_BLOCK iosb; - NTSTATUS status = NtCreateFile(&ctx.afd_handle, SYNCHRONIZE, &afd__device_attributes, &iosb, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, kFILE_OPEN, 0, NULL, 0); + NTSTATUS status = NtCreateFile(&ctx.afd_handle, SYNCHRONIZE, &afd_device_attributes, &iosb, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, kFILE_OPEN, 0, NULL, 0); if (status != NTSTATUS_SUCCESS) { CloseHandle(ctx.iocp_handle); SetLastError(RtlNtStatusToDosError(status));