-
May 27th, 2012, 01:23 PM
#1
[RESOLVED] Code Works in XP Not Vista
I have a program that runs (under Windows 95 compatibility) in both XP and Vista. However, the following code (while it works in XP) crashes the program in Vista...
mov eax, dword_10010000
push 0
push 0FFFFFFFFh
push 0
mov ecx, [eax+80h]
push 1
push 10h
push 1
push ecx
push 0
push 0C0000000h
mov ecx, esi
call dword ptr [edi+0F4h]
The error message says the type of error is 0xC0000005 which I've found is an access violation. Any thoughts how to remedy this code so it also works in Vista?
-
May 27th, 2012, 02:51 PM
#2
Re: Code Works in XP Not Vista
What does it do? If it needs to be run under Windows 95 compatibility it's a good chance that Vista doesn't allow it even in compatibility mode.
-
May 27th, 2012, 05:17 PM
#3
Re: Code Works in XP Not Vista
It plays an audio clip. Aside from this piece of code, the program doesn't really encounter any issues playing audio clips on Vista.
Last edited by Mr. Smith; July 3rd, 2012 at 09:07 AM.
Reason: Removed info not relevant to issue.
-
May 28th, 2012, 10:58 AM
#4
Re: Code Works in XP Not Vista
What you posted is just a fragment. If you provide more code and OS details maybe someone can figure this out. I haven't seen any posts from Eri523 lately but this migth make him curious...
-
May 30th, 2012, 08:09 AM
#5
Re: Code Works in XP Not Vista
Originally Posted by S_M_A
I haven't seen any posts from Eri523 lately [...].
I've been quite busy recently with one of my larger projects, so unfortunately I neglected CG a bit. Every now and then, however, I stop by, looking for something interesting.
[...] but this migth make him curious...
In deed, it does. (1) I don't see anything about any audio stuff in the snippet. When doing multimedia stuff, I'd probably use some API, unless perhaps it's really hardware-level driver-like stuff (which happens rather rarely). (2) Indirect calls or jumps without any context explaining their purpose always raise my suspicion. Might be some stuff to be injected into something...
Bottom line Without any additional context from the OP, we're definitely stuck.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
June 3rd, 2012, 05:49 PM
#6
Re: Code Works in XP Not Vista
[Removed info not relevant to issue.]
Last edited by Mr. Smith; July 3rd, 2012 at 09:09 AM.
Reason: Removed info not relevant to issue.
-
June 9th, 2012, 07:14 AM
#7
Re: Code Works in XP Not Vista
It's still quite unclear what even is intended to be going on here. The calls may be API calls, and the way the stack is handled indicates that they seem to use __stdcall or Pascal calling convention, but that's not really much information. Overall, that looks like disassembly rather than assembly language anyway: The few labels used to access data (unknown to us) are named sometging like dword_10010000, which are cryptic names a developer with a sane mind is unlikely to use. Even a compiler generating assembly language output would most probably use more descriptive symbols.
So all I can give you is quite general debugging advice: Try to remove either snippet (the "works" and "doesn't work" snippet) from the code and see if they both work on their own. If "doesn't work" still doesn't work in that scenario, it in fact seems to be the culprit (for whatever reason). If they both do work on their own, try to reverse their sequence in the original code. Then, if the new first one works and the new second one does not, the reason may be that they're just called in too rapid succession.
BTW, many API calls return error/success codes that may indicate reasons for failure, but I don't see any trace of return value checking here at all.
Finally, if something suddenly stops working when taken from XP to Vista, it's quite often a permission issue, since Vista handles security much more strict.
Last edited by Eri523; June 9th, 2012 at 07:18 AM.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
July 3rd, 2012, 09:05 AM
#8
Re: Code Works in XP Not Vista
I figured out the issue. Manually moving the "mov eax, dword_10010000" (even by 1 byte) was causing the issue in Vista. I resolved this by making a subroutine around "mov eax, dword_10010000" and calling the subroutine.
Thanks for the general debugging advice. It helped find the issue. And, if there's a more elegant solution, feel free to share.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|