Quote Originally Posted by ProgMaster
I've tested this and what i found. Message "step 1" i receive, but second message i dont receive. Thats means that it crashes at:

But i cant understand why ???? What im doing wrong ?
try this:
Code:
char szRef[MAX_PATH]={0};
DWORD cbRef = sizeof(szRef);
if(!LookupAccountName(NULL, chCurrentUser, &userSID, &dwSID, szRef, &cbRef, 0)) 
{ 
  ::MessageBox(NULL, "cant lookupacc", "error", MB_OK); 
}
Cheers