My app broken in Win 8.1

Just starting out? Need help? Post your questions and find answers here.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

My app broken in Win 8.1

Post by PB »

[Edit] I'm running 8.1 in VirtualBox, which may be the cause
of these problems. So if someone has 8.1 on a real PC, can
you please test? Thanks! :)

So I downloaded the Win 8.1 free trial to test my app,
and discovered two functions in my app are broken. :(

(1) SetCursorPos_() doesn't work - [Edit] does in a real PC.

(2) I can't seem to open a process handle to the Windows
Task Manager in 8.1, but I can for all other processes. So
maybe it's a security thing? Anyway, this is what I'm using
to test... anyone know if I can make it better? I've tried
elevating the privilege level of my app (not running it as
an admin, though) but it still fails.

Code: Select all

Procedure OpenIt(pid)
  p=OpenProcess_(#PROCESS_ALL_ACCESS,#True,pid)
  If p ; Returns 0 on Win 8.1 limited, but non-zero on Win 7 limited!
    Debug "ok"
    CloseHandle_(p)
  EndIf
EndProcedure

OpenIt(564) ; Put PID of TaskMgr.exe here.
BTW, if you want to try Windows 8.1 for free for 90 days:

http://technet.microsoft.com/en-us/eval ... 99156.aspx

And yes, I think it's dog ugly and sucks to use. Zorin's way better! :twisted:
Last edited by PB on Thu Feb 20, 2014 7:07 am, edited 4 times in total.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: My app broken in Win 8.1

Post by rsts »

Doesn't work under real 8.1 either.
Even as admin fails with
ERROR_ACCESS_DENIED
5 (0x5)
Access is denied.
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: My app broken in Win 8.1

Post by Kuron »

Anyone know what to do?
Mark it not compatible with Windows 8.1? *ducks*

In all seriousness, there are some quirky compatibility issues in 8.X that have been popping up.
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: My app broken in Win 8.1

Post by luis »

PB wrote: (1) SetCursorPos_() doesn't work to set the mouse
position, and neither does using SendInput_() as
SetCursorPos_() works on a real Win 8.1.
Considering how extensively that API is used would have been suicide.

Works in the VM too.
In the VM, try to disable mouse integration (Host + I) and try again.
PB wrote: (2) I can't seem to open a process handle to the Windows
Task Manager in 8.1, but I can for all other processes.
Try "Request Administrator mode..." in "compiler options". You'll get the prompt from the OS to authorize it and then it works.
"Have you tried turning it off and on again ?"
A little PureBasic review
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: My app broken in Win 8.1

Post by rsts »

Actually, it doesn't run under 8.0 either
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: My app broken in Win 8.1

Post by luis »

@rsts

Do you have UAC disabled ? If you do self-elevation works in that case too.

At least here, I've just tried on a real Win 8.1
"Have you tried turning it off and on again ?"
A little PureBasic review
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: My app broken in Win 8.1

Post by rsts »

@luis
Windows 8.0 and 8.1 real systems no changes to UAC and no self elevation, just run as PB coded, but I'm running as admin.
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: My app broken in Win 8.1

Post by luis »

So you should to try the flag mentioned above, or probably better do a self elevation.
Admin is not really a permanent, full fledged "ADMIN" on Win Vista and later.
It does really get two different access token at login, and normally uses the "standard user" one.
"Have you tried turning it off and on again ?"
A little PureBasic review
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: My app broken in Win 8.1

Post by rsts »

Yes luis, it runs with requested elevation under 8 and 8.1 but does not require elevation under 7.

cheers
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: My app broken in Win 8.1

Post by PB »

> Mark it not compatible with Windows 8.1?

I haven't discounted that option, actually. I was going to
market my app as for Win XP to 7 only, with Win 8 support
coming soon. Seen plenty of other apps marketed like that.

> Try "Request Administrator mode..." in "compiler options"

I will try later, but my app is run by limited users only.
And running my snippet above as a limited account on
Win 7 works perfectly with TaskMgr.exe, so I don't know
why Win 8.1 is now stopping it. Snippet in post edited to
reflect this for clarification.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: My app broken in Win 8.1

Post by luis »

And what about setcursorpos, the VM and the mouse integration tip stuff ?
Tried that ? Does it work ?
"Have you tried turning it off and on again ?"
A little PureBasic review
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: My app broken in Win 8.1

Post by PB »

Okay, finally installed Win 8.1 on my actual PC instead of in a VM.

Happy to report that SetCursorPos_() works fine on a real PC. :)

Sad to report that the following snippet still FAILS when run as a
limited user. :( Win 7 can do it as limited, so a bit disappointing.
Works fine if run as admin, but my app is not for admin accounts.

Code: Select all

Procedure OpenIt(pid)
  p=OpenProcess_(#PROCESS_ALL_ACCESS,#True,pid)
  Debug p ; 0 on Win 8.1 limited, but non-zero on Win 7 limited.
  If p
    CloseHandle_(p)
  EndIf
EndProcedure

OpenIt(564) ; Put PID of TaskMgr.exe here.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: My app broken in Win 8.1

Post by luis »

PB wrote: Sad to report that the following snippet still FAILS when run as a
limited user. :( Win 7 can do it as limited, so a bit disappointing.
Works fine if run as admin, but my app is not for admin accounts.
Task manager is run elevated on win 8.1 if you log in as "admin" (sort of). If your user is a standard user his taskmgr.exe should run as non elevated.
I've just tried the code above on 8.1 as a standard user and it worked.
Are you sure you didn't try as "admin" without elevating your process to admin rights ?
"Have you tried turning it off and on again ?"
A little PureBasic review
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: My app broken in Win 8.1

Post by PB »

> I've just tried the code above on 8.1 as a standard user and it worked.

That's great news! :)

> Are you sure you didn't try as "admin" without elevating your process to admin rights ?

It's weird... my user level says Administrator in the Control Panel, but
I still get the UAC prompt for stuff, so Win 8.1 seems confused. :lol:
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: My app broken in Win 8.1

Post by luis »

PB wrote: It's weird... my user level says Administrator in the Control Panel, but
I still get the UAC prompt for stuff, so Win 8.1 seems confused. :lol:
It's normal -> http://www.purebasic.fr/english/viewtop ... 91#p438391
"Have you tried turning it off and on again ?"
A little PureBasic review
Post Reply