Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

exports.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

BOOL _UserSoundSentry (UINT uVideoMode)
NTSTATUS _UserTestTokenForInteractive (HANDLE Token, PLUID pluidCaller)


Function Documentation

BOOL _UserSoundSentry UINT  uVideoMode  ) 
 

Definition at line 24 of file exports.c.

References NT_SUCCESS, and NtUserSoundSentry().

00026 { 00027 UNREFERENCED_PARAMETER(uVideoMode); 00028 00029 return NT_SUCCESS(NtUserSoundSentry()); 00030 }

NTSTATUS _UserTestTokenForInteractive HANDLE  Token,
PLUID  pluidCaller
 

Definition at line 45 of file exports.c.

References NT_SUCCESS, NtQueryInformationToken(), NTSTATUS(), NtUserTestForInteractiveUser(), NULL, Status, and Token.

00049 { 00050 PTOKEN_STATISTICS pStats; 00051 ULONG BytesRequired; 00052 NTSTATUS Status; 00053 00054 /* 00055 * Get the session id of the caller. 00056 */ 00057 Status = NtQueryInformationToken( 00058 Token, // Handle 00059 TokenStatistics, // TokenInformationClass 00060 NULL, // TokenInformation 00061 0, // TokenInformationLength 00062 &BytesRequired // ReturnLength 00063 ); 00064 00065 if (Status != STATUS_BUFFER_TOO_SMALL) { 00066 return Status; 00067 } 00068 00069 // 00070 // Allocate space for the user info 00071 // 00072 00073 pStats = (PTOKEN_STATISTICS)LocalAlloc(LPTR, BytesRequired); 00074 if (pStats == NULL) { 00075 return Status; 00076 } 00077 00078 // 00079 // Read in the user info 00080 // 00081 00082 Status = NtQueryInformationToken( 00083 Token, // Handle 00084 TokenStatistics, // TokenInformationClass 00085 pStats, // TokenInformation 00086 BytesRequired, // TokenInformationLength 00087 &BytesRequired // ReturnLength 00088 ); 00089 00090 if (NT_SUCCESS(Status)) { 00091 if (pluidCaller != NULL) 00092 *pluidCaller = pStats->AuthenticationId; 00093 00094 /* 00095 * A valid session id has been returned. Compare it 00096 * with the id of the logged on user. 00097 */ 00098 Status = NtUserTestForInteractiveUser(&pStats->AuthenticationId); 00099 #ifdef LATER 00100 if (pStats->AuthenticationId.QuadPart == pwinsta->luidUser.QuadPart) 00101 Status = STATUS_SUCCESS; 00102 else 00103 Status = STATUS_ACCESS_DENIED; 00104 #endif 00105 } 00106 00107 LocalFree(pStats); 00108 00109 return Status; 00110 }


Generated on Sat May 15 19:43:36 2004 for test by doxygen 1.3.7