[fpc-pascal]Windows ShutDown Privilege

Florian Klaempfl Florian.Klaempfl at gmx.de
Sun Dec 8 11:22:42 CET 2002

MPDJ wrote:
> Thanks for the Shutdown routine. I'm starting to get really annoying
> with this now as I compiled the routine and ran it and exactly the
> same problem appeared with the same error message stating I don't have
> the correct privilege.
> I added a CheckPrivilege call before and after the
> AdjustTokenPrivileges and it appears the "SeShutdownPrivilege" has not
> been altered.
> Is there something strange about the Privilege settings with Windows
> that I'm missing somehow? I've searched Google and all the routines
> are very similar to each other yet despite tweaking the function the
> error remains. I'll have to try compiling the function in Delphi just
> to prove to myself I'm not going mad!

I'am not really familiar with the Win32 privilege system. But is the user
under which you ran the program allowed to shutdown the system? Did you
try to run the program with administrator privileges?

More information about the fpc-pascal mailing list