[fpc-pascal]Windows ShutDown Privilege

MPDJ mpdj at btinternet.com
Mon Dec 9 12:23:52 CET 2002


micu> NP. If it does work in Delphi, it could be a quirk of FPC. Or even, shock
micu> horror, a bug ;-P Then again, it could just be user permissions. I've no easy 
micu> way of testing. I could send you my exe if that helps.. that way you'd know if 
micu> my version fails without having to dig out Delphi.

First problem I've had with FPC and Windows API. I'm sure it's me and
I'll kick myself when I finally spot it ;-)

If you could send me the EXE file, I'd be very grateful. I had to uninstall
Delphi as I was getting tight for spare drive space and never got
around to reinstalling it as I'm using FPC now. If it proves too much
of a problem, don't worry, I'll compile it here and let you know how
it goes.


Andy


Monday, December 9, 2002, 10:12:28 AM, you wrote:

>> I'm using Windows 2000 SP3 and I compiled under both Delphi and fpc.
>> The function is due to be used under Windows 95/98 and Win2000 so I'd
>> like to get the privileges sorted so I can shut either OS down.

micu> The code I sent was compiled under Delphi 5 with all updates (the service pack 
micu> plus the ADO and stuff like that, not that I expect the ADO to make much 
micu> difference.)

micu> The code has been run on both NT4 with SP6a (IIRC) or SP5, and a hokey Win2k 
micu> which probably has no SP's at all, or at most SP1 (the site I'm on only just 
micu> uses Win2k!! Some users are stull on NT4.)

micu> I have local admin rights on my machine... I've never tried it on a machine 
micu> that has no admin rights, but as you mention, I thought that wouldn't make a 
micu> difference.
 
>> I've tried under administrator but this has made no difference. I was
>> under the impression that application privileges are independent of
>> the user logged in at the time?

micu> Ditto (as stated above.)

>> I'll dig out an old copy of Delphi and compile it just to be sure
>> there has been no change in the API functions, though I did
>> double-check online with MSDN and all looked OK.

micu> Delphi 5 would be a good one to try. I can send you the project if you would 
micu> find that easier, but it should build as is. There were no extra files other 
micu> than the body of source I posted.
 
>> Again, many thanks for all the suggestions and help so far.

micu> NP. If it does work in Delphi, it could be a quirk of FPC. Or even, shock 
micu> horror, a bug ;-P Then again, it could just be user permissions. I've no easy 
micu> way of testing. I could send you my exe if that helps.. that way you'd know if 
micu> my version fails without having to dig out Delphi.

micu> Matt

micu> ---------------------------------------------
micu> This message was sent using Mistral WebMail.
micu> http://www.mistral.co.uk/



micu> _______________________________________________
micu> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
micu> http://lists.freepascal.org/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list