-
Notifications
You must be signed in to change notification settings - Fork 116
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
Double pointers to strings have no NativeTypeInfo #241
Comments
It might be better if we added a first-class WCHAR type rather than relying on ushort plus an attribute. That would seem to be a lot simpler given how ubiquitous such pointer types are. Just a thought. |
I've been thinking the same thing. The problem is not all WCHAR* are null terminated, although most are. And some are double null terminated. We have the same problem with single byte strings too. I could follow our handle pattern for these and use attributes if they're not normal null-terminated strings. |
I suspect we can have our cake and eat it. I'm also wondering (but haven't checked) how we delineate between UTF-8 and ANSI strings, which might both be represented as |
We should not create typedef structs where equivalent ECMA types already exist. We should just use |
Attributes to identify additional traits such as null-termination are fine, but we don't need a custom struct instead of |
There's a big difference between a Also, WinRT metadata already reserves ECMA |
I'm suggesting we change strings to look like this: [NativeTypedef]
public struct PWSTR
{
public char* Value;
}
[NativeTypedef]
public struct PSTR
{
public byte* Value;
} And then use attributes for things like const or non-null terminated. |
Fixed in latest release. |
ShGetKnownFolderPath
returns aPointer<Pointer<Utf16>>
in my existing (non-metadata based) projection, but the Win32 metadata shows it as returning aPointer<Pointer<Uint16>>
because there's noNativeTypeInfo
attribute forppszPath
.ILSpy:
The text was updated successfully, but these errors were encountered: