- This topic has 142 replies, 8 voices, and was last updated 10 years ago by Admin.
-
AuthorPosts
-
July 22, 2013 at 4:09 pm #186047ChikeMember
The S just make them “short” that is a 2 bytes signed integer, when converted to 4byte Integer the sign is kept and the original hex value is lost
Mp S should have been there in the first place, if at all the all should have UI or UL.
I think the hex constants default to integer, if they are greater than integer valu you will get an error.
Most if not all flags in windows are DWORD, that’s an unsigned 64bit integer, that’s how they should be declared and passed to the function to avoid any complications.EDIT: another rule to follow” if it aint broke, don’t fix it! Particulary when you are a n00b and what may seem logical to you is a big no no.
July 22, 2013 at 4:25 pm #186046cyberpunkMember@Chike wrote:
EDIT: another rule to follow” if it aint broke, don’t fix it! Particulary when you are a n00b and what may seem logical to you is a big no no.
Can I get that engraved on my laptop? I had to add the CONST for it, I HAD no choice but to guess, but yes I have been known to tinker in order to see what it breaks so I understand what is happening. it has gotten me further than I expected, and that only fuels the fire to learn more lol
July 22, 2013 at 4:30 pm #186045ChikeMemberThere no const for it in the code you began with?
July 22, 2013 at 4:36 pm #186044cyberpunkMemberno MEM_DECOMMIT Const at all, it had an error until I added the Const
but I learned a great deal about how to troubleshoot thanks to you doing this the “right way” rather than the “easy way” and I am encouraged that my instincts seem fairly good and I think I might have the head for this coding thing
July 22, 2013 at 4:46 pm #186043ChikeMemberYou don’t neee no MEM_DECOMMIT, and MEM_DECOMMIT won’t cause this kind of error becase its a positive short integer value.
You only need MEM_RELEASE and add “or MEM_RESERVE” to the allocation just to be on the safe side.
There was no MEM_DECOMMIT it the original code you posted, DID you add the S to MEM_RELEASE or was it there before?July 22, 2013 at 4:50 pm #186042cyberpunkMemberThere was only a MEM_RELEASE , MEM_COMMIT, and MEM_RESERVE Const(s) declared and yes they all had the S but I thought your hint was to use MEM_DECOMMIT which is what fixed the issue. and I had to add that Const
July 22, 2013 at 4:57 pm #186041ChikeMemberNo what fix the issue is removing the S from release.
Sorry dude you only get A-.July 22, 2013 at 4:59 pm #186040cyberpunkMemberbut I did not Remove the S from MEM_RELEASE
that was not one of my tweaks, when I asked about the S at the end of those Const it was because that was the first time I had seen them, the first thing I did was change MEM_RELEASE to MEM_DECOMMIT in the sub and it errored saying it was not accesible. I guessed at the Const. but think i guessed right. I figured it was a declaration at that point. I googled examples of how to declare a const for MEM_DECOMMIT and the one I found did not have the S on it but since I saw my code had an S on the MEM_COMMIT I went with the S
July 22, 2013 at 5:02 pm #186039cyberpunkMemberC’Mon, I deserve an A+ don’t I? lol
but could NOT have done it at all without your help Chike…seriously man I appreciate it and learned a lot
July 22, 2013 at 5:10 pm #186038ChikeMemberYou are talking about MEM_DECOMMIT that is not in the code you have posted, and removing the S from it/
What code you talking about?July 22, 2013 at 5:15 pm #186037cyberpunkMember@Chike wrote:
You are talking about MEM_DECOMMIT that is not in the code you have posted, and removing the S from it/
What code you talking about?That is correct, the MEM_DECOMMIT was what I used instead of MEM_RELEASE for the dwFreeType in the VirtualFreeEx statement. when I made that change the IDE gave an error that it was not accessible. I assumed that meant it was not declared and scrolled up and saw the othe MEM_* Const and noticed it needed to be added. Googled for examples, tweaked the example, and voila. issue gone now
July 22, 2013 at 5:32 pm #186036ChikeMemberAre you sure the “issue” is gone?
I propose to you the following code to debug:
result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_DECOMMIT)
result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
Report back with your findings and conclusion.
More rules to follow:
Don’t change 2 things at a time as you won’t be able to tell which one made the difference.
A correct return code does not mean the issue is solved.July 22, 2013 at 5:50 pm #186035cyberpunkMember@Chike wrote:
Are you sure the “issue” is gone?
Pretty sure, time will definitely tell, but I based it on far more than just getting my 1 lol, I had a pretty good baseline from the previous week of how Paltalk looks when my Timer was not running and when it was. It was fairly easy to tell since when my Timer ran The Memory Set Delta was a steady 16 with occasional 20 and 24 and rare memory releases from other processes, 0’s were more rare than memory releases. But when my Timer was off there was more 0’s than anything and that is just how it is looking now. but you are right, Time will have to tell if the issue is resolved.
@Chike wrote:
I propose to you the following code to debug:
result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_DECOMMIT)
result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
Report back with your findings and conclusion.
I have another copy on another machine I am bringing up to date with this new findings and will add this code there and gladly report back. I want to let this thing run for now to see if it crashes Paltalk. but it really seems to be resolved since it is hardly even noticable in Task Manager.
@Chike wrote:
More rules to follow:
Don’t change 2 things at a time as you won’t be able to tell which one made the difference.
A correct return code does not mean the issue is solved.I really only made the one change which needed another change inorder to work 😆
But absolutely an excellent Rule of ThumbJuly 22, 2013 at 5:58 pm #186034ChikeMember@ManicMike wrote:
@Chike wrote:
Are you sure the “issue” is gone?
Pretty sure, time will definately tell
Hrere you trying to puspond instead of accelerating.
You want t know right away, not wait a hald day or more.@ManicMike wrote:
I really only made the one change which needed another change inorder to work 😆
But absolutely an excellent Rule of ThumbWhat two changes exactly? You talking in riddles.
July 22, 2013 at 6:17 pm #186033DepartureMember@Chike wrote:
The S just make them “short” that is a 2 bytes signed integer, when converted to 4byte Integer the sign is kept and the original hex value is lost
Mp S should have been there in the first place, if at all the all should have UI or UL.
I think the hex constants default to integer, if they are greater than integer valu you will get an error.
Most if not all flags in windows are DWORD, that’s an unsigned 64bit integer, that’s how they should be declared and passed to the function to avoid any complications.EDIT: another rule to follow” if it aint broke, don’t fix it! Particulary when you are a n00b and what may seem logical to you is a big no no.
Never seen an S like that before, I even went back on page 4 to see the declarations of consts, btw a short integer is just a word and a integer is a dword which is 32bit not 64bit… a 64bit integer is actually int64 or dword64 which I have no idea why they named such a stupid name instead of QWord or something similar.
I would never have picked up looking at how you have declared the consts, this is just another reason why I dislike .net and the stupid declarations, Delphi has all these types of things already defined, Its only the undocumented API’s which you can define manually..
-
AuthorPosts
Related
- You must be logged in to reply to this topic.