Click here to Skip to main content
15,890,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to copy a locked file... ? Pin
David Crow10-May-04 5:40
David Crow10-May-04 5:40 
AnswerRe: How to copy a locked file... ? Pin
peterchen10-May-04 5:55
peterchen10-May-04 5:55 
Generalloan calculator Pin
felix joe10-May-04 4:56
felix joe10-May-04 4:56 
GeneralRe: loan calculator Pin
David Crow10-May-04 5:39
David Crow10-May-04 5:39 
GeneralBank And Stock Interface Pin
harios10-May-04 4:47
harios10-May-04 4:47 
GeneralLibpath Pin
Kevin Gutteridge10-May-04 4:47
Kevin Gutteridge10-May-04 4:47 
GeneralRe: Libpath Pin
Andrew Walker10-May-04 15:40
Andrew Walker10-May-04 15:40 
GeneralC++ and ISAPI FILTER Pin
SuzannaS10-May-04 3:41
SuzannaS10-May-04 3:41 
I'm developping an ISAPI FILTER and I would like to know why this code for the event OnAuthComplete is not working; I have already declared the method and caught the notification (SF_NOTIFY_AUTH_COMPLETE: dwRet = OnAuthComplete(pfc, (PHTTP_FILTER_AUTH_COMPLETE_INFO))pvNotification); :


static DWORD OnAuthComplete(PHTTP_FILTER_CONTEXT pfc, PHTTP_FILTER_AUTH_COMPLETE_INFO pAuthCompInfo)
{
HANDLE TokenHandle = (HANDLE)1;
DWORD dwLen = 0;
PTOKEN_USER pTokenUser = NULL;
DWORD dwErr;
char name[MAX_NAME], domain[MAX_NAME];

// Get user token.
if ( pAuthCompInfo->GetUserToken(pfc,&TokenHandle) )
{
// Get token information size.
if ( !GetTokenInformation
(TokenHandle,TokenUser,NULL,dwLen,&dwLen) )
{
dwErr = GetLastError();
if ( ERROR_INSUFFICIENT_BUFFER == dwErr )
{
// Alocate buffer for token information.
pTokenUser = (PTOKEN_USER)GlobalAlloc(GPTR,dwLen);
dwErr = S_OK;
}
}

// Now get the actual token information.
if ( dwErr != S_OK ||
!GetTokenInformation(TokenHandle, TokenUser,pTokenUser,dwLen,&dwLen) )
{
// Error …
}
else // We have the token information in hand.
{
// Extract from the token information - the SID.
SID *pSid = (SID *)pTokenUser->User.Sid;
DWORD dwNLen = MAX_NAME, dwDLen = MAX_NAME;
SID_NAME_USE eUse;

// Get the user name and the domain from the SID.
if (!LookupAccountSid(NULL,pSid,name,&dwNLen,domain,&dwDLen,&eUse) )
{
// Error …
}
else
{
// name buffer contains user name.
// domain buffer contains user domain.
}
}
}


if (*name != NULL)
return WriteIntoFile(pfc, "OnAuthComplete: User name:" + *name);
else
return WriteIntoFile(pfc, "Evento OnAuthComplete: ");
}

WriteIntoFile is a method that write into a file and I have already tested it and it works well.
GeneralCokkies Pin
black97610-May-04 3:12
black97610-May-04 3:12 
GeneralRe: Cookies Pin
David Crow10-May-04 3:40
David Crow10-May-04 3:40 
GeneralRe: Cookies Pin
black97610-May-04 4:23
black97610-May-04 4:23 
GeneralRe: Cookies Pin
David Crow10-May-04 4:52
David Crow10-May-04 4:52 
GeneralRe: Cookies Pin
black97610-May-04 5:26
black97610-May-04 5:26 
GeneralRe: Cookies Pin
David Crow10-May-04 5:36
David Crow10-May-04 5:36 
GeneralUsing CSocket, how to identify whether the server is still connecting. Pin
laia10-May-04 2:58
laia10-May-04 2:58 
GeneralRe: Using CSocket, how to identify whether the server is still connecting. Pin
toxcct10-May-04 3:04
toxcct10-May-04 3:04 
GeneralExe file does not work Pin
TSG_Man10-May-04 2:57
TSG_Man10-May-04 2:57 
Generalimport lib file in VC.Net Pin
casper23410-May-04 2:18
casper23410-May-04 2:18 
GeneralRe: import lib file in VC.Net Pin
HENDRIK R10-May-04 2:57
HENDRIK R10-May-04 2:57 
GeneralRe: import lib file in VC.Net Pin
casper23410-May-04 4:51
casper23410-May-04 4:51 
GeneralRe: import lib file in VC.Net Pin
HENDRIK R10-May-04 6:08
HENDRIK R10-May-04 6:08 
GeneralRe: import lib file in VC.Net Pin
robert_s10-May-04 4:40
robert_s10-May-04 4:40 
GeneralRe: import lib file in VC.Net Pin
casper23410-May-04 5:05
casper23410-May-04 5:05 
GeneralRe: import lib file in VC.Net Pin
robert_s10-May-04 12:06
robert_s10-May-04 12:06 
GeneralActiveX window remains on top Pin
Abhi Lahare10-May-04 1:19
Abhi Lahare10-May-04 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.