Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Trouble shutting down after MALA exits on Windows XP x64  (Read 4105 times)

0 Members and 1 Guest are viewing this topic.

retrometro

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 487
  • Last login:May 24, 2024, 09:11:44 pm
    • Arcade, mame, retro... and the gp2x.
Trouble shutting down after MALA exits on Windows XP x64
« on: August 24, 2008, 12:07:07 pm »
I have MALA v1.05 and have set the action for exiting MALA to shutdown the system.  It worked fine on XP x86 and Vista x86. 

So I then told MALA to run a script on exit that just calls shutdown.exe (also tried psshutdown.exe) but no luck.  the batch file shuts the box down when ran from the command line but not when called from MALA.   :dunno

Can anyone else duplicate this on XP x64 (recently patched to the brim from MS).

thanks!


-------- gp2x and retro... play it forever! ------------------------
http://www.youtube.com/view_play_list?p=0EE573E86D5A86E0
--------------------------------------------------------------------

Twin-X

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 170
  • Last login:April 26, 2018, 05:59:44 pm
  • Yes this avatar was stolen too!!!
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #1 on: September 07, 2008, 05:20:33 pm »
I have the same issue.

I solved this by uninstalling the fatfingers plugin.
Ultimarc does not have a u360 x64 driver i guess (cannot find anything about it anyway)

retrometro

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 487
  • Last login:May 24, 2024, 09:11:44 pm
    • Arcade, mame, retro... and the gp2x.
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #2 on: September 07, 2008, 08:48:39 pm »
What's the fatfingers plug-in? 

Also, how come mala's not able to call a .cmd batch that runs shutdown.exe properly when it runs fine called from anywhere else?


-------- gp2x and retro... play it forever! ------------------------
http://www.youtube.com/view_play_list?p=0EE573E86D5A86E0
--------------------------------------------------------------------

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #3 on: September 08, 2008, 12:07:11 am »
What's the fatfingers plug-in? 

Also, how come mala's not able to call a .cmd batch that runs shutdown.exe properly when it runs fine called from anywhere else?




What method are you using to call this shutdown.exe?

On the MaLa exit tab there are two choices I can see:

1) Use alternative shutdown method (shutdown.exe)

2) Run application on exit (the specify shutdown.exe)


retrometro

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 487
  • Last login:May 24, 2024, 09:11:44 pm
    • Arcade, mame, retro... and the gp2x.
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #4 on: September 08, 2008, 08:00:35 pm »
What method are you using to call this shutdown.exe?

On the MaLa exit tab there are two choices I can see:

1) Use alternative shutdown method (shutdown.exe)
2) Run application on exit (the specify shutdown.exe)


I've tried both.  When I have #1 mala try to shutdown, it prompts me if i want to shutdown, and when I confirm, it just spits me back to windows.

When I have it run an app, I have it run a shutdown.cmd file which calls shutdown.exe with a force and shutdown with 1 seconds and the result is the same.

I've tried the 32bit and 64bit versions of shutdown.exe.  I've even tried power tool's psshutdown.exe but no go.  Strange as before on my winxp 32bit install, all went fine.  but now no go in xp 64bit.  The variation of scripts and shutdown commands all work when called directly from the shell or explorer.  but not from mala.


-------- gp2x and retro... play it forever! ------------------------
http://www.youtube.com/view_play_list?p=0EE573E86D5A86E0
--------------------------------------------------------------------

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #5 on: September 08, 2008, 08:47:19 pm »
Well I can't suggest you didn't try everything  ;)

Not sure what I can do as I don't have a 64 bit OS.  :dunno

I am just acquiring Vista 32 bit at this point to test MaLa on it soon.  :P



retrometro

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 487
  • Last login:May 24, 2024, 09:11:44 pm
    • Arcade, mame, retro... and the gp2x.
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #6 on: September 08, 2008, 10:32:54 pm »
I wasn't too surprised that however mala was shutting down didn't work.  I was however surprised that the same cmd that works outside of mala doesn't work within. 

How does mala launch external apps?

I suppose one alternative is to have a script to launches mala and then after mala exits, do a pause and then exit from there.


-------- gp2x and retro... play it forever! ------------------------
http://www.youtube.com/view_play_list?p=0EE573E86D5A86E0
--------------------------------------------------------------------

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #7 on: September 08, 2008, 11:13:16 pm »
I wasn't too surprised that however mala was shutting down didn't work.  I was however surprised that the same cmd that works outside of mala doesn't work within. 
How does mala launch external apps?

Scratch your head no longer (for one of the options anyway)

I just had a look at the function in MaLa, and it only seems to cater for 32 bit.


 
Code: [Select]
if Win32Platform = VER_PLATFORM_WIN32_NT then
   begin
     tpResult := OpenProcessToken(GetCurrentProcess(),
       TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,
       TTokenHd) ;
     if tpResult then
     begin
       tpResult := LookupPrivilegeValue(nil,
                                        SE_SHUTDOWN_NAME,
                                        TTokenPvg.Privileges[0].Luid) ;
       TTokenPvg.PrivilegeCount := 1;
       TTokenPvg.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
       cbtpPrevious := SizeOf(rTTokenPvg) ;
       pcbtpPreviousRequired := 0;
       if tpResult then
         Windows.AdjustTokenPrivileges(TTokenHd,
                                       False,
                                       TTokenPvg,
                                       cbtpPrevious,
                                       rTTokenPvg,
                                       pcbtpPreviousRequired) ;
     end;

So I guess it needs some 64 code. 

If anyone has any please pass it on otherwise I will search for it myself eventually  ;)
« Last Edit: September 09, 2008, 12:02:16 am by loadman »

retrometro

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 487
  • Last login:May 24, 2024, 09:11:44 pm
    • Arcade, mame, retro... and the gp2x.
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #8 on: September 09, 2008, 12:10:04 pm »
wow awesome.  thanks for looking.  i guess that explains the problem exactly.

So since a lot of the APIs have the same name whether it's 32bit or 64bit, what would happen if you just got rid of the "check for 32bit version" part out of the code?

[edit]

Wait... that explains why mala doesn't shut down the machine properly.  But why does it seem to break a script that calls shutdown?


-------- gp2x and retro... play it forever! ------------------------
http://www.youtube.com/view_play_list?p=0EE573E86D5A86E0
--------------------------------------------------------------------

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: Trouble shutting down after MALA exits on Windows XP x64
« Reply #9 on: September 09, 2008, 07:37:56 pm »

Wait... that explains why mala doesn't shut down the machine properly.  But why does it seem to break a script that calls shutdown?


Yes hence I said it solves 'for one of the options'

A Mystery  :dunno