Thread: DC_VFS Change!
View Single Post
Old 12-08-2003, 08:01 AM  
Mouton
Posse Member
 
Join Date: Dec 2002
Posts: 1,956
Default

Code:
void getFileOwner(const char *complete_filename, char *user)
{
	if (!initSharedMem(1024 + (strlen(complete_filename) + 1) + sizeof(DC_VFS))) {
		strcpy(user,"nobody");
		return;
	}
	lpMessage->dwIdentifier	= DC_VFS_READ;
	LPDC_VFS pFileInformation = (LPDC_VFS)lpMessage->lpContext;
	lpContext = (LPVOID)((ULONG)lpMessage->lpContext + sizeof(DC_VFS));
	strcpy((LPTSTR)pFileInformation->pBuffer,complete_filename);
	dwReturn = SendMessage(hIoFTPD, WM_SHMEM, NULL, (LPARAM)hMemory);
	if (!dwReturn) {
		WaitForSingleObject(hEvent,10000);

		int uid = pFileInformation->Uid;
		if (pFileInformation->dwFileMode==0 || !resolveUidToName(uid,user))
			strcpy(user,"nobody");
	} else {
		strcpy(user,"nobody");
	}
	closeSharedMem();
}
Mouton is offline