[Wine] peimg /inf running on wine

tclas wineforum-user at winehq.org
Wed Sep 10 10:57:38 CDT 2008


Hi forum,

I'm trying to get peimg.exe running on wine for some time, now. Unfortunately I didn't succeed yet. It would be great to get some hints here.

Peimg.exe is an application which is used to add hardware drivers in Windows PE "images" to be used during the installation Process of Vista and 2008 Servers. It is part of the windows AIK. While we are using a linux-based PreInsatallation Environment, this task has to be done under linux.

So I got the source (wine-1.1.2) and compiled it on my ubuntu box. I had to install Windows AIK (which is actually not needed to run the single application), add some native dlls (currently crypt, msasn1 and setupaip) from my XP-box and was able to run wine peimg /inf="c:\bla\bla.inf" /imge="c:\image\Windows" which should inject the driver-package represented by bla.inf into the extracted WinPE source located in .wine/drive_c/image/Windows.
In case the driver was already injected, peimg worked fine and apart from some  fixme:advapi:RegisterTraceGuidsW it worked fine and peimg reported success. The next thing was to run it in an environment where a driver really had to be injected. In this case, wine crashed because of a call of an unimplemented function PrivCoyFileExW which is really just a stub.
Unfortunately this is an undocumented function so I had to guess:
build/wine-1.1.2/dlls/kernel32/path.c

/**************************************************************************
 *           PrivCopyFileExW   (KERNEL32.@)
 *
 * This implementation ignores most of the extra parameters passed-in into
 * the "ex" version of the method and calls the CopyFile method.
 * It will have to be fixed eventually.
 */
BOOL WINAPI PrivCopyFileExW(LPCWSTR sourceFilename, LPCWSTR destFilename,
                        LPPROGRESS_ROUTINE progressRoutine, LPVOID appData,
                        LPBOOL cancelFlagPointer, DWORD copyFlags)
{
    /*
     * Interpret the only flag that CopyFile can interpret.
     */
    FIXME("src=%s dest=%s prg=0x%08x data=0x%08x flags=0x%08x\n", debugstr_w(sourceFilename), debugstr_w(destFilename), progressRoutine, appData, copyFlags);
    return CopyFileW(sourceFilename, destFilename, (copyFlags & COPY_FILE_FAIL_IF_EXISTS) != 0);
}
/**********************************************************************************************************

Puhh, well wine doesn't crash any more and the files are really copied but the output of peimg tells me:

PEIMG failed to complete the operation with status code 0x800703f9.

Well, this seems to be an undocumented ErrorCode. I started wine with WINEDEBUG=+relay,+snoop and noticed, that this is exactly the return value of a function call to drvstore.DriverStoreOfflineAddDriverPackageW.
It is implemented in the drvstore.dll, which is part of AIK, too. So anything has to be wrong there, but I don't know how to debug on.

So, if you have any idea, how to get tool to it's work, any hint would be very appreciated.

Regards.
tclas







More information about the wine-users mailing list