Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various Winsock constants missing #844

Closed
kennykerr opened this issue Mar 21, 2022 · 5 comments
Closed

Various Winsock constants missing #844

kennykerr opened this issue Mar 21, 2022 · 5 comments
Assignees
Labels
missing api Some documented API is missing from the metadata

Comments

@kennykerr
Copy link
Contributor

Constants like SIO_UDP_CONNRESET, SIO_BSP_HANDLE, SIO_BASE_HANDLE etc. are missing.

They appear to come from mswsock.h.

tokio-rs/mio#1556 (comment)

@mikebattista mikebattista self-assigned this Mar 21, 2022
@mikebattista mikebattista added the missing api Some documented API is missing from the metadata label Mar 21, 2022
@riverar
Copy link
Collaborator

riverar commented Mar 21, 2022

@mikebattista

Here's a starting point for ya

public const uint SIO_ACQUIRE_PORT_RESERVATION = 2550136932;
public const uint SIO_ADDRESS_LIST_CHANGE = 671088663;
public const uint SIO_ADDRESS_LIST_QUERY = 1207959574;
public const uint SIO_APPLY_TRANSPORT_SETTING = 2550136851;
public const uint SIO_ASSOCIATE_HANDLE = 2281701377;
public const uint SIO_ASSOCIATE_PORT_RESERVATION = 2550136934;
public const uint SIO_BASE_HANDLE = 1207959586;
public const uint SIO_BSP_HANDLE = 1207959579;
public const uint SIO_BSP_HANDLE_SELECT = 1207959580;
public const uint SIO_BSP_HANDLE_POLL = 1207959581;
public const uint SIO_CHK_QOS = 3690987521;
public const uint SIO_CPU_AFFINITY = 2550136853;
public const uint SIO_ENABLE_CIRCULAR_QUEUEING = 671088642;
public const uint SIO_FIND_ROUTE = 1207959555;
public const uint SIO_FLUSH = 671088644;

Stopped here https://docs.microsoft.com/en-us/windows/win32/winsock/winsock-ioctls#sio_flush-opcode-setting-v-t1 going down the page one at a time and constexp evaluating each. Ideally we'd grab the expressions and evaluate them but doesn't appear we have that capability yet.

@kennykerr
Copy link
Contributor Author

kennykerr commented Mar 21, 2022

FYI IO control codes are unsigned. For example: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsaioctl

@riverar
Copy link
Collaborator

riverar commented Mar 21, 2022

@kennykerr Thanks, fixed.

@mikebattista
Copy link
Collaborator

Need to automate the below pattern in the constant scraper and then recognize constants defined with these macros.

/*
 * WinSock 2 extension -- manifest constants for WSAIoctl()
 */
#define IOC_UNIX                      0x00000000
#define IOC_WS2                       0x08000000
#define IOC_PROTOCOL                  0x10000000
#define IOC_VENDOR                    0x18000000

#if (_WIN32_WINNT >= 0x0600)
/*
 * WSK-specific IO control codes are Winsock2 codes with the highest-order
 * 3 bits of the Vendor/AddressFamily-specific field set to 1.
 */
#define IOC_WSK                       (IOC_WS2|0x07000000)
#endif //(_WIN32_WINNT >= 0x0600)

#define _WSAIO(x,y)                   (IOC_VOID|(x)|(y))
#define _WSAIOR(x,y)                  (IOC_OUT|(x)|(y))
#define _WSAIOW(x,y)                  (IOC_IN|(x)|(y))
#define _WSAIORW(x,y)                 (IOC_INOUT|(x)|(y))

@mikebattista
Copy link
Collaborator

Will fix #671 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing api Some documented API is missing from the metadata
Projects
None yet
Development

No branches or pull requests

3 participants