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

DsmMemAlloc passed in parameters in reversed order in Windows #35

Open
ericshung opened this issue Jun 28, 2019 · 0 comments
Open

DsmMemAlloc passed in parameters in reversed order in Windows #35

ericshung opened this issue Jun 28, 2019 · 0 comments

Comments

@ericshung
Copy link

public IntPtr DsmMemAlloc(uint a_u32Size)
{
	IntPtr intptr;

	// Use the DSM...
	...

	// Do it ourselves, Windows...
	if (ms_platform == Platform.WINDOWS)
	{
		intptr = (IntPtr)NativeMethods.GlobalAlloc((uint)a_u32Size, (UIntPtr)0x0042 /* GHND */);

The first parameter should be the flag, as defined below

[DllImport("kernel32.dll")]
internal static extern IntPtr GlobalAlloc(uint uFlags, UIntPtr dwBytes);
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

1 participant