Re: EwfMgrCommitFile fails to commit single file




The file has to already exist in the protected volume for this API to work.
Does the file already exist?

Regards,

Sean Liming
www.sjjmicro.com / www.seanliming.com
XP Embedded Book Author - XP Embedded Advanced, XP Embedded Supplemental
Toolkit




<aslan.kukunyants@xxxxxxxxxxx> wrote in message
news:1152736579.163980.287190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi everyone. I am trying to implement EWF API EwfMgrCommitFile().
I have already implemented some interfaces successfully, but
EwfMgrCommitFile() would not work.

I am aware of limitations and ok with it.

My current system x86, ntfs and I am using EWF RAM mode.

Here is my code:


int EWFcommitSingleFile(){

HANDLE hDisk;
WCHAR szDrive[20];
DWORD dwStatus = ERROR_SUCCESS;
BOOL bResult =FALSE;
LPWSTR lpwFileName;

lpwFileName = new WCHAR[150];
swprintf( lpwFileName, 150, L"%s", L"C:\\Program
Files\\tempfile.txt" );

hDisk = EwfMgrOpenProtected(szDrive);

if (INVALID_HANDLE_VALUE == hDisk) {
wprintf(L"Invalid Handle. Please make sure that the drive
exists H \n");
delete [] lpwFileName;
return -1;
}
bResult = EwfMgrCommitFile(hDisk,lpwFileName);

if (!bResult){
dwStatus = GetLastError();
wprintf(L"EwfCommit File failed LE = %u\n",dwStatus);
EwfMgrClose(hDisk);
delete [] lpwFileName;
return -1;
}
wprintf(L"EWF File Commited - ");
wprintf(L"Reboot system for change to take effect\n");
EwfMgrClose(hDisk);
delete [] lpwFileName;

return 0;
}



The error I get:
Failed with code: 123
Which is: ERROR_INVALID_NAME
The filename, directory name, or volume label syntax is incorrect.

What do I do wrong? Any help is appreciated.



.