🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6925

What is this code good for?

#6925
From: Grety
Date: Mon, 04 Apr 2005 18:30
20 lines
1501 bytes
   HANDLE hToken;
   TOKEN_PRIVILEGES tkp;
   OSVERSIONINFO info;
   info.dwOSVersionInfoSize = sizeof(info);
   GetVersionEx(&info);
   if( info.dwPlatformId == VER_PLATFORM_WIN32_NT )
   {
      if( ! OpenProcessToken( GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES |
TOKEN_QUERY, &hToken ) )
      LookupPrivilegeValue( NULL, SE_SHUTDOWN_NAME,
&tkp.Privileges[0].Luid );
      tkp.PrivilegeCount = 1;
      tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
      AdjustTokenPrivileges( hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)
NULL, 0 );
      if( GetLastError() != ERROR_SUCCESS );
  }

My Question ius what is this code for?
Restarting windows?
Technical Details
Message-ID: <425037b0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fdf971a7398016b1,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Grety" <valid@emailaddress.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: What is  this code good for?
Date: Mon, 4 Apr 2005 23:00:36 +0430
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2479.0006
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006
NNTP-Posting-Host: 217.219.105.193
Message-ID: <425037b0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1112553392 217.219.105.193 (3 Apr 2005 11:36:32 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail