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

Win32::Graphics::Printing::MONITOR2 structure is supposed to hold callbacks, but it has generic isize fields instead. I think for the callbacks the fields should be Option<fn...>, like for the other similar APIs. #796

Closed
Tracked by #720
mikebattista opened this issue Feb 7, 2022 · 1 comment
Assignees

Comments

@mikebattista
Copy link
Contributor

No description provided.

@mikebattista
Copy link
Contributor Author

This is yet another case of #1006, #983, and #842.

    public partial struct MONITOR2
    {
        [NativeTypeName("DWORD")]
        public uint cbSize;

        [NativeTypeName("BOOL (*)(HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD) __attribute__((stdcall))")]
        public IntPtr pfnEnumPorts;

        [NativeTypeName("BOOL (*)(HANDLE, LPWSTR, PHANDLE) __attribute__((stdcall))")]
        public IntPtr pfnOpenPort;

        [NativeTypeName("BOOL (*)(HANDLE, HANDLE, LPWSTR, LPWSTR, PHANDLE, struct _MONITOR2 *) __attribute__((stdcall))")]
        public IntPtr pfnOpenPortEx;

        [NativeTypeName("BOOL (*)(HANDLE, LPWSTR, DWORD, DWORD, LPBYTE) __attribute__((stdcall))")]
        public IntPtr pfnStartDocPort;

        [NativeTypeName("BOOL (*)(HANDLE, LPBYTE, DWORD, LPDWORD) __attribute__((stdcall))")]
        public IntPtr pfnWritePort;

        [NativeTypeName("BOOL (*)(HANDLE, LPBYTE, DWORD, LPDWORD) __attribute__((stdcall))")]
        public IntPtr pfnReadPort;

        [NativeTypeName("BOOL (*)(HANDLE) __attribute__((stdcall))")]
        public IntPtr pfnEndDocPort;

        [NativeTypeName("BOOL (*)(HANDLE) __attribute__((stdcall))")]
        public IntPtr pfnClosePort;

        [NativeTypeName("BOOL (*)(HANDLE, LPWSTR, HWND, LPWSTR) __attribute__((stdcall))")]
        public IntPtr pfnAddPort;

        [NativeTypeName("BOOL (*)(HANDLE, LPWSTR, DWORD, LPBYTE, LPWSTR) __attribute__((stdcall))")]
        public IntPtr pfnAddPortEx;

        [NativeTypeName("BOOL (*)(HANDLE, LPWSTR, HWND, LPWSTR) __attribute__((stdcall))")]
        public IntPtr pfnConfigurePort;

        [NativeTypeName("BOOL (*)(HANDLE, LPWSTR, HWND, LPWSTR) __attribute__((stdcall))")]
        public IntPtr pfnDeletePort;

        [NativeTypeName("BOOL (*)(HANDLE, DWORD, LPWSTR, LPWSTR, DWORD, LPWSTR, DWORD, LPDWORD) __attribute__((stdcall))")]
        public IntPtr pfnGetPrinterDataFromPort;

        [NativeTypeName("BOOL (*)(HANDLE, LPCOMMTIMEOUTS, DWORD) __attribute__((stdcall))")]
        public IntPtr pfnSetPortTimeOuts;

        [NativeTypeName("BOOL (*)(HANDLE, LPCWSTR, ACCESS_MASK, PHANDLE) __attribute__((stdcall))")]
        public IntPtr pfnXcvOpenPort;

        [NativeTypeName("DWORD (*)(HANDLE, LPCWSTR, PBYTE, DWORD, PBYTE, DWORD, PDWORD) __attribute__((stdcall))")]
        public IntPtr pfnXcvDataPort;

        [NativeTypeName("BOOL (*)(HANDLE) __attribute__((stdcall))")]
        public IntPtr pfnXcvClosePort;

        [NativeTypeName("void (*)(HANDLE) __attribute__((stdcall))")]
        public IntPtr pfnShutdown;

        [NativeTypeName("DWORD (*)(HANDLE, DWORD, LPCWSTR, PBIDI_REQUEST_CONTAINER, PBIDI_RESPONSE_CONTAINER *) __attribute__((stdcall))")]
        public IntPtr pfnSendRecvBidiDataFromPort;

        [NativeTypeName("DWORD (*)(HANDLE, DWORD, PCWSTR *) __attribute__((stdcall))")]
        public IntPtr pfnNotifyUsedPorts;

        [NativeTypeName("DWORD (*)(HANDLE, DWORD, PCWSTR *) __attribute__((stdcall))")]
        public IntPtr pfnNotifyUnusedPorts;

        [NativeTypeName("DWORD (*)(HANDLE, DWORD, POWERBROADCAST_SETTING *) __attribute__((stdcall))")]
        public IntPtr pfnPowerEvent;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants