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

Few little errors #1961

Closed
adeyblue opened this issue Aug 9, 2024 · 4 comments · Fixed by #1976
Closed

Few little errors #1961

adeyblue opened this issue Aug 9, 2024 · 4 comments · Fixed by #1976

Comments

@adeyblue
Copy link

adeyblue commented Aug 9, 2024

1 - windows.win32.networkmanagement.rras
PMPRADMINCONNECTIONHANGUPNOTIFICATION3
Last parameter is missing a pointer, see https://learn.microsoft.com/en-us/windows/win32/api/mprapi/nf-mprapi-mpradminconnectionhangupnotification3
The SDK is also missing the pointer in mprapi.h,. That struct is relatively big so I doubt it's meant to be passed by value, especically as it's a pointer in all the other function pointers that use RAS_CONNECTION_3 and has members tagged as OUT in mprapi.

2 - Links for all the AVI- prefixed types in Windows.Win32.Media.DirectShow are 404
For instance:
AVIStreamHeader
https://learn.microsoft.com/windows/win32/api/avifmt/ns-avifmt-avistreamheader
This is now here - https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/avifmt/ns-avifmt-avistreamheader
AVISUPERINDEX
https://learn.microsoft.com/windows/win32/api/aviriff/ns-aviriff-avisuperindex
This is now here - https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/aviriff/ns-aviriff-avisuperindex
AVISTREAMHEADER
https://learn.microsoft.com/windows/win32/api/aviriff/ns-aviriff-avistreamheader
Now here - https://learn.microsoft.com/en-us/previous-versions/windows/desktop/api/aviriff/ns-aviriff-avistreamheader

Basically they've all moved into previous-versions purgatory

3- These shouldn't have the StructSizeField attribute, cbSize here is the size of the data pointed to, not the size of the struct
windows.win32.com.structuredstorage - BLOB
windows.win32.storage.structuredstorage - BSTRBLOB

4 - Help links for windows.win32.graphics.gdiplus BitMap and Image are pointing to completely wrong things
Bitmap is here
https://learn.microsoft.com/en-us/windows/win32/api/gdiplusheaders/nl-gdiplusheaders-bitmap
instead of
https://learn.microsoft.com/windows/win32/tablet/bitmap-element

Image is here
https://learn.microsoft.com/en-us/windows/win32/api/gdiplusheaders/nl-gdiplusheaders-image
instead of
https://learn.microsoft.com/windows/win32/windowsribbon/windowsribbon-element-image

5 - windows.win32.networking.winhttp
URL_COMPONENTS has an Ansi attribute, but the strings are wide, and it only exists in wide format

6 - windows.win32.graphics.gdi
Some structs in here are missing packing attributes. Snippets from wingdi.h
TextMetricA/W - 4 byte

#ifndef _TEXTMETRIC_DEFINED
#define _TEXTMETRIC_DEFINED
#include <pshpack4.h>

#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)

typedef struct tagTEXTMETRICA
{
    LONG        tmHeight;
    LONG        tmAscent;
    LONG        tmDescent;

RGBTriple - 1 byte

#include <pshpack1.h>

#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)

typedef struct tagRGBTRIPLE {
        BYTE    rgbtBlue;
        BYTE    rgbtGreen;
        BYTE    rgbtRed;
} RGBTRIPLE, *PRGBTRIPLE, NEAR *NPRGBTRIPLE, FAR *LPRGBTRIPLE;

NewTextMetricA/W - 4 bytes

#include <pshpack4.h>

#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

typedef struct tagNEWTEXTMETRICA
{
    LONG        tmHeight;
    LONG        tmAscent;
    LONG        tmDescent;
@riverar
Copy link
Collaborator

riverar commented Aug 28, 2024

Moving forward, please file one issue per request. Thanks!

@riverar
Copy link
Collaborator

riverar commented Aug 29, 2024

5 - windows.win32.networking.winhttp
URL_COMPONENTS has an Ansi attribute, but the strings are wide, and it only exists in wide format

There are A and W versions of this type, so skipping this one.

https://github.com/microsoft/win32metadata/blob/main/generation/WinSDK/RecompiledIdlHeaders/um/WinInet.h#L558-L591

@riverar
Copy link
Collaborator

riverar commented Aug 29, 2024

6 - windows.win32.graphics.gdi
Some structs in here are missing packing attributes. Snippets from wingdi.h
TextMetricA/W - 4 byte
...

Those structs are already aligned well for x86, x64, and arm64. If you suspect packing/alignment issues on other structures, please run them through MSVC cl /d1reportSingleClassLayout to double check.

@mikebattista
Copy link
Collaborator

Closing per #1979 (comment).

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

Successfully merging a pull request may close this issue.

3 participants