00049 {
00050 PTOKEN_STATISTICS pStats;
00051 ULONG BytesRequired;
00052
NTSTATUS Status;
00053
00054
00055
00056
00057
Status =
NtQueryInformationToken(
00058 Token,
00059 TokenStatistics,
00060 NULL,
00061 0,
00062 &BytesRequired
00063 );
00064
00065
if (
Status != STATUS_BUFFER_TOO_SMALL) {
00066
return Status;
00067 }
00068
00069
00070
00071
00072
00073 pStats = (PTOKEN_STATISTICS)LocalAlloc(LPTR, BytesRequired);
00074
if (pStats ==
NULL) {
00075
return Status;
00076 }
00077
00078
00079
00080
00081
00082
Status =
NtQueryInformationToken(
00083 Token,
00084 TokenStatistics,
00085 pStats,
00086 BytesRequired,
00087 &BytesRequired
00088 );
00089
00090
if (
NT_SUCCESS(Status)) {
00091
if (pluidCaller !=
NULL)
00092 *pluidCaller = pStats->AuthenticationId;
00093
00094
00095
00096
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 }