您好我们购买了带有MS Windows Embedded Standard-HP Customized的HP PC,我们在启用EWF功能方面遇到了问题。如果我尝试使用EMF管理器检查EWF状态:
ewfmgr c:
我收到错误:
“Failed getting protected volume configuration with error 1. incorrect function.”
如果我尝试使用命令启用EWF:
ewfmgr c -enable
我收到错误:
Failed opening the target device \\.\c with error 2
The system cannot find the file specified.
我尝试使用HP实用程序 - HP Write Filter Configuration来启用EWF。
但是当我使用此实用程序启用EWF时,重新启动PC并禁用EWF。
只有FBWF正在运作。
有什么不好的?任何的想法?
在“Reg RAM”以外的模式下,EWF需要特殊版本的Windows引导加载程序(NTLDR)和一些未分区的磁盘空间来创建覆盖卷。我不知道您的HP PC是否配置了这些。
此处列出了一些EWF系统要求:
http://msdn.microsoft.com/en-ca/library/bb499124.aspx
EWF通常在第一个引导代理(FBA)过程中创建其覆盖卷。你可以查看fbalog.txt的错误。这里有一些重建EWF卷的说明:
http://msdn.microsoft.com/en-us/library/ms913271(WinEmbedded.5).aspx
找不到文件错误可能是由于第二个命令中缺少':
'。
试试ewfmgr c: -enable
吧。
我意识到这个问题已经过时了,但是在我的搜索中出现了,所以我想我会留下我的答案。
当我遇到这个错误时,是因为我使用imeagex恢复了一个图像。在拍摄备用图片之前,我没有运行sysprep。我擦除并重新创建了更新分区签名的分区,这使得EWF混淆不足以使其无效。
EWF没有一个很好的工具来配置受保护的卷。所以我写了一个。这是源头。
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include <winioctl.h>
#include <tchar.h>
const TCHAR VOL_PATH[] = TEXT("SYSTEM\\CurrentControlSet\\Services\\ewf\\Parameters\\Protected\\Volume%i");
VOID Usage(){
_tprintf(TEXT("Usage: ewfvoladd <Drive Letter> <Volume Number>\n"));
}
INT _tmain(INT iArgCount, LPCTSTR pszArgVals[]){
INT iReturn = 0;
if (iArgCount == 3){
TCHAR szDrive[MAX_PATH];
_sntprintf_s(szDrive,MAX_PATH,TEXT("\\\\.\\%s:"),pszArgVals[1]);
szDrive[MAX_PATH-1] = 0;
HANDLE hPartition = CreateFile(szDrive,GENERIC_READ,FILE_SHARE_READ | FILE_SHARE_WRITE,nullptr,OPEN_EXISTING,0,nullptr);
if (hPartition != INVALID_HANDLE_VALUE){
PARTITION_INFORMATION piPartInfo = {};
DWORD dwSize = sizeof(piPartInfo);
if (DeviceIoControl(hPartition,IOCTL_DISK_GET_PARTITION_INFO,nullptr,0,&piPartInfo,dwSize,&dwSize,nullptr)){
dwSize = sizeof(DRIVE_LAYOUT_INFORMATION) + sizeof(PARTITION_INFORMATION) * 9;
LPBYTE pbDrive = new BYTE [ dwSize ];
ZeroMemory(pbDrive,dwSize);
DRIVE_LAYOUT_INFORMATION *pdliDrive = (DRIVE_LAYOUT_INFORMATION*)pbDrive;
if (DeviceIoControl(hPartition,IOCTL_DISK_GET_DRIVE_LAYOUT,nullptr,0,pdliDrive,dwSize,&dwSize,nullptr)){
TCHAR szVol[MAX_PATH];
_sntprintf_s(szVol,MAX_PATH,VOL_PATH,(INT)_ttol(pszArgVals[2]));
szVol[MAX_PATH-1] = 0;
HKEY hVol = nullptr;
LONG lRegErr = RegCreateKeyEx(HKEY_LOCAL_MACHINE,szVol,0,nullptr,REG_OPTION_NON_VOLATILE,KEY_WRITE,nullptr,&hVol,nullptr);
if (lRegErr == ERROR_SUCCESS){
const DWORD dwZero = 0,
dwOne = 1,
dwTwo = 2;
lRegErr = RegSetValueEx(hVol,TEXT("Type"),0,REG_DWORD,(LPCBYTE)&dwTwo,sizeof(dwTwo));
if (lRegErr != ERROR_SUCCESS){
iReturn = (INT)lRegErr;
_tprintf(TEXT("Failed to set Type: %i\n"),iReturn);
}
lRegErr = RegSetValueEx(hVol,TEXT("Enabled"),0,REG_DWORD,(LPCBYTE)&dwZero,sizeof(dwZero));
if (lRegErr != ERROR_SUCCESS){
iReturn = (INT)lRegErr;
_tprintf(TEXT("Failed to set Enabled: %i\n"),iReturn);
}
lRegErr = RegSetValueEx(hVol,TEXT("CompareBeforeAlloc"),0,REG_DWORD,(LPCBYTE)&dwOne,sizeof(dwOne));
if (lRegErr != ERROR_SUCCESS){
iReturn = (INT)lRegErr;
_tprintf(TEXT("Failed to set CompareBeforeAlloc: %i\n"),iReturn);
}
lRegErr = RegSetValueEx(hVol,TEXT("DiskSignature"),0,REG_DWORD,(LPCBYTE)&pdliDrive->Signature,sizeof(pdliDrive->Signature));
if (lRegErr != ERROR_SUCCESS){
iReturn = (INT)lRegErr;
_tprintf(TEXT("Failed to set DiskSignature: %i\n"),iReturn);
}
lRegErr = RegSetValueEx(hVol,TEXT("PartitionOffset"),0,REG_QWORD,(LPCBYTE)&piPartInfo.StartingOffset.QuadPart,sizeof(piPartInfo.StartingOffset.QuadPart));
if (lRegErr != ERROR_SUCCESS){
iReturn = (INT)lRegErr;
_tprintf(TEXT("Failed to set PartitionOffset: %i\n"),iReturn);
}
RegCloseKey(hVol);
}else{
iReturn = (INT)lRegErr;
_tprintf(TEXT("Failed to open registry key (%s): %i\n"),szVol,iReturn);
}
}else{
iReturn = (INT)GetLastError();
_tprintf(TEXT("Failed to get disk info: %i\n"),iReturn);
}
delete [] pbDrive;
}else{
iReturn = (INT)GetLastError();
_tprintf(TEXT("Failed to get partition info: %i\n"),iReturn);
}
CloseHandle(hPartition);
}else{
iReturn = (INT)GetLastError();
_tprintf(TEXT("Failed to open drive: %i\n"),iReturn);
}
}else{
iReturn = ERROR_INVALID_PARAMETER;
Usage();
_tprintf(TEXT("\nNot enough parameters\n"));
}
return iReturn;
}
因此,如果您只有1个分区并且它是C:驱动器,您将运行以下命令并重新启动。
ewfvoladd c 0
那么你应该能够像这样启用EWF
ewfmgr c: -enable
重新启动,你就完成了。