KM said:
Srivathsan,
Forgot to ask - whta error codes were returned from the EWF API calls
? (not from the wrappers but from the API functions).
It returns TRUE, i think the error codes are returned if the function
fails...
DWORD dwStatus = ERROR_SUCCESS;
PEWF_VOLUME_NAME_ENTRY pProVolList = NULL;
HANDLE hProVol = INVALID_HANDLE_VALUE;
BOOL bResult = FALSE;
//CEWFClass *EWFObject= CEWFClass::CreateInstance();
BOOL bReturnValue = TRUE;
// Get a list of protected volume names.
pProVolList = EwfMgrGetProtectedVolumeList();
if (!pProVolList)
{
dwStatus = GetLastError();
wprintf(L"Vol list Failed\n");
}
// Process and free each volume name in the list and
// use the volume name to demonstrate command use.
else
{
while (!EwfMgrVolumeNameListIsEmpty(pProVolList))
{
DWORD dwStatus = ERROR_SUCCESS;
HANDLE hProVol = INVALID_HANDLE_VALUE;
BOOL bResult = FALSE;
// Use the volume name to open a handle to this
protected volume.
hProVol =
EwfMgrOpenProtected(pProVolList->Name);
if (hProVol == INVALID_HANDLE_VALUE)
{
dwStatus = GetLastError();
wprintf(L"EwfMgrOpenProtected failed LE =
%u\n",dwStatus);
goto exit;
}
// For EWF_RAM_REG configurations, the second
parameter (commit)
// must be TRUE. This will commit the EWF_RAM_REG
disable state,
// which is required to disable the EWF_RAM_REG
configuration.
bResult = EwfMgrDisable(hProVol,TRUE);
if (!bResult)
{
dwStatus = GetLastError();
wprintf(L"EwfMgrDisable failed LE =
%u\n",dwStatus);
goto exit;
}
wprintf(L"EwfMgrDisable succeeded\n");
// This command requires a reboot to take effect.
//if (bReboot) DoReboot();
exit:
if (hProVol != INVALID_HANDLE_VALUE)
{
EwfMgrClose(hProVol);
}
EwfMgrVolumeNameEntryPop(&pProVolList);
This only gave the DISABLE COMMAND in the EWFMGR and no Commit is
issued
I just reread the thread and I am not sure I understood one of your
messages above. Are you saying that EWFMGR showed disabled state
after you issued EwfMgrDisable(hVol, TRUE) command? If so, what the
problem then? If you reboot after the first API call, do your
The EWF is still enabled in the Configuration...
Srivathsan.A