We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Testing the ReadHGlobalIntoStream method I found my result had corrupted files if their size was over 4096 bytes.
I believe adding this line corrected the issue:
source = new IntPtr(source.ToInt64() + bytesToCopy);
So that the loop looks like:
int bytesToCopy; for (int offset = 0; offset < length; offset += buffer.Length) { //Copy buffer length or remaining length, whichever is smaller bytesToCopy = Math.Min(buffer.Length, length - offset); Marshal.Copy(source, buffer, 0, bytesToCopy); stream.Write(buffer, 0, bytesToCopy); source = new IntPtr(source.ToInt64() + bytesToCopy); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Testing the ReadHGlobalIntoStream method I found my result had corrupted files if their size was over 4096 bytes.
I believe adding this line corrected the issue:
source = new IntPtr(source.ToInt64() + bytesToCopy);
So that the loop looks like:
The text was updated successfully, but these errors were encountered: