Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Vista UAC: The Definitive Guide

, 21 Mar 2008
Learn how UAC operates behind the scenes. Use the Elevate package to start multiple elevated processes but only display one UAC elevation dialog from a non-elevated process.
elevate_binariesanddocs.zip
Elevate.dll
Elevate.exe
elevate_demo.zip
Elevate.dll
Elevate.exe
TestChild.exe
TestParent.exe
elevate_src.zip
#ifndef Elevated__export_types_H
#define Elevated__export_types_H

typedef HANDLE (WINAPI *DLL_Link_CreateType)();
typedef HANDLE (WINAPI *DLL_Link_CreateAsUserType)(HANDLE hToken);
typedef HANDLE (WINAPI *DLL_Link_CreateWithLogonType)(LPCWSTR, LPCWSTR, LPCWSTR, DWORD);
typedef HANDLE (WINAPI *DLL_Link_CreateWithTokenType)(HANDLE hToken, DWORD dwLogonFlags);
typedef BOOL (WINAPI *DLL_Link_DestroyType)(HANDLE hLink);
typedef BOOL (WINAPI *DLL_Link_CreateProcessAType)(HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION);
typedef BOOL (WINAPI *DLL_Link_CreateProcessWType)(HANDLE, LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
typedef BOOL (WINAPI *DLL_Link_ShellExecuteExAType)(HANDLE hLink, LPSHELLEXECUTEINFOA lpExecInfo);
typedef BOOL (WINAPI *DLL_Link_ShellExecuteExWType)(HANDLE hLink, LPSHELLEXECUTEINFOW lpExecInfo);
typedef HINSTANCE (WINAPI *DLL_Link_ShellExecuteAType)(HANDLE, HWND, LPSTR, LPCSTR, LPCSTR, LPCSTR, INT);
typedef HINSTANCE (WINAPI *DLL_Link_ShellExecuteWType)(HANDLE, HWND, LPWSTR, LPCWSTR, LPCWSTR, LPCWSTR, INT);
typedef DWORD (WINAPI *DLL_Link_LoadLibraryAType)(HANDLE, LPCSTR);
typedef DWORD (WINAPI *DLL_Link_LoadLibraryWType)(HANDLE, LPCWSTR);
typedef DWORD (WINAPI *DLL_Link_SendDataType)(HANDLE, DWORD, LPCVOID, DWORD, DWORD);
typedef BOOL (WINAPI *DLL_Link_GetDataType)(HANDLE, LPVOID);
typedef BOOL (WINAPI *DLL_Link_SendFinalizeType)(HANDLE);

typedef BOOL (WINAPI *DLL_CreateProcessElevatedAType)(LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION);
typedef BOOL (WINAPI *DLL_CreateProcessElevatedWType)(LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
typedef BOOL (WINAPI *DLL_CreateProcessAsUserElevatedAType)(HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION);
typedef BOOL (WINAPI *DLL_CreateProcessAsUserElevatedWType)(HANDLE, LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
typedef BOOL (WINAPI *DLL_CreateProcessWithLogonElevatedWType)(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPCWSTR, LPWSTR, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
typedef BOOL (WINAPI *DLL_CreateProcessWithTokenElevatedWType)(HANDLE, DWORD, LPCWSTR, LPWSTR, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
typedef LONG (WINAPI *DLL_SH_RegCreateKeyExElevatedAType)(HKEY, LPCSTR, DWORD, LPSTR, DWORD, REGSAM, LPSECURITY_ATTRIBUTES, PHKEY, LPDWORD);
typedef LONG (WINAPI *DLL_SH_RegCreateKeyExElevatedWType)(HKEY, LPCWSTR, DWORD, LPWSTR, DWORD, REGSAM, LPSECURITY_ATTRIBUTES, PHKEY, LPDWORD);
typedef LONG (WINAPI *DLL_SH_RegOpenKeyExElevatedAType)(HKEY, LPCSTR, DWORD, REGSAM, PHKEY);
typedef LONG (WINAPI *DLL_SH_RegOpenKeyExElevatedWType)(HKEY, LPCWSTR, DWORD, REGSAM, PHKEY);
typedef LONG (WINAPI *DLL_SH_RegCloseKeyElevatedType)(HKEY hKey);
typedef HINSTANCE (WINAPI *DLL_ShellExecuteElevatedAType)(HWND, LPSTR, LPCSTR, LPCSTR, LPCSTR, INT);
typedef HINSTANCE (WINAPI *DLL_ShellExecuteElevatedWType)(HWND, LPWSTR, LPCWSTR, LPCWSTR, LPCWSTR, INT);
typedef BOOL (WINAPI *DLL_ShellExecuteExElevatedAType)(LPSHELLEXECUTEINFOA);
typedef BOOL (WINAPI *DLL_ShellExecuteExElevatedWType)(LPSHELLEXECUTEINFOW);

typedef BOOL (WINAPI *DLL_IsUserAnAdminType)();

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Thomas Hruska
Web Developer
United States United States
Been writing software for a really long time - something like 18 years. Started on the TI/99-4A, moved to the Tandy 1000, and somehow managed to skip all the lousy hardware/software jumps (286, 386, first Pentiums, Win95, etc.)
 
I now run a small software business called CubicleSoft with a few products you might be interested in. VerifyMyPC and MyUpdate Toolkit are the most popular. I'm also the author of a book called "Safe C++ Design Principles".

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 22 Mar 2008
Article Copyright 2007 by Thomas Hruska
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid