Skip to content

Update main.cpp #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Brooksey24
Copy link

First thanks for the tutorials so far! Brand new here so just finding any reason to get into code. Both bytes_read and bytes_written seem to be unnecessary variables as the documentation specifies NULL is usable in this instance. Figured it might help reduce complexity to newcomers like myself.

First thanks for the tutorials so far! Brand new here so just finding any reason to get into code. Both bytes_read and bytes_written seem to be unnecessary variables as the documentation specifies NULL is usable in this instance. Figured it might help reduce complexity to newcomers like myself.
@attilathedud
Copy link
Contributor

Thanks for the suggestion and glad you are enjoying the tutorials! I vaguely remember at one point in the past (Windows 7-era) that ReadProcessMemory & WriteProcessMemory would fail in certain situations if not provided with a lpNumberOfBytesRead parameter. However, when looking at the MSDN documentation, this is apparently not the case.

Let me investigate this a bit. If it turns out the parameter is unneeded in all cases, I'll drop it and update all the code.

@attilathedud attilathedud self-assigned this Sep 9, 2021
@Brooksey24
Copy link
Author

Thought there would be a good reason. Cheers for giving an explanation! I'll try give you more feedback for further tutorials (after studying a bit more C++ XD)

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 this pull request may close these issues.

2 participants