ADMIN MODE CHECK

Hi All,

My aim is to install an application which has a “Windows Service” and “Dpinst.exe”, where both needs an admin privilege. So at start of my application I need to check whether the system is in admin mode or not, and if it is not in admin mode, I want my application to display a message to the user to “LOGIN AS ADMINISTRATOR”.

How to check a system is in ADMINISTRATOR MODE or NOT?? Usig WINAPI.

OS details : WINDOWS XP, VISTA and WINDOWS 7

Language to be used : C

Thanks.

I believe that ordinary ACL APIs will give you this information. Look at
the structure for tokens.
joe

Hi All,

My aim is to install an application which has a “Windows Service” and
“Dpinst.exe”, where both needs an admin privilege. So at start of my
application I need to check whether the system is in admin mode or not,
and if it is not in admin mode, I want my application to display a message
to the user to “LOGIN AS ADMINISTRATOR”.

How to check a system is in ADMINISTRATOR MODE or NOT?? Usig WINAPI.

OS details : WINDOWS XP, VISTA and WINDOWS 7

Language to be used : C

Thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hello,
This code sample may help.
http://code.msdn.microsoft.com/CSUACSelfElevation-644673d3

Thanks,
–RC

On Mon, May 14, 2012 at 8:16 AM, wrote:
> Hi All,
>
> My aim is to install an application which has a “Windows Service” and “Dpinst.exe”, where both needs an admin privilege. So at start of my application I need to check whether the system is in admin mode or not, and if it is not in admin mode, I want my application to display a message to the user to “LOGIN AS ADMINISTRATOR”.
>
>
> How to check a system is in ADMINISTRATOR MODE or NOT?? Usig WINAPI.
>
> OS details : WINDOWS XP, VISTA and WINDOWS 7
>
> Language to be used : C
>
> Thanks.
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

For Vista+, UAC manifest is enough.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hi All,
>
> My aim is to install an application which has a “Windows Service” and “Dpinst.exe”, where both needs an admin privilege. So at start of my application I need to check whether the system is in admin mode or not, and if it is not in admin mode, I want my application to display a message to the user to “LOGIN AS ADMINISTRATOR”.
>
>
> How to check a system is in ADMINISTRATOR MODE or NOT?? Usig WINAPI.
>
> OS details : WINDOWS XP, VISTA and WINDOWS 7
>
> Language to be used : C
>
> Thanks.
>
>
>
>

Agreed. If you manifest your installer, you will get the elevation UI if needed and be guaranteed the right context when running. A pure login as admin doesn’t work b/c even admins need to elevate.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Monday, May 14, 2012 11:42 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] ADMIN MODE CHECK

For Vista+, UAC manifest is enough.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hi All,
>
> My aim is to install an application which has a “Windows Service” and “Dpinst.exe”, where both needs an admin privilege. So at start of my application I need to check whether the system is in admin mode or not, and if it is not in admin mode, I want my application to display a message to the user to “LOGIN AS ADMINISTRATOR”.
>
>
> How to check a system is in ADMINISTRATOR MODE or NOT?? Usig WINAPI.
>
> OS details : WINDOWS XP, VISTA and WINDOWS 7
>
> Language to be used : C
>
> Thanks.
>
>
>
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer