peimg /inf running on wine

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
tclas
Newbie
Newbie
Posts: 2
Joined: Tue Sep 09, 2008 9:32 am

peimg /inf running on wine

Post by tclas »

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
tclas
Newbie
Newbie
Posts: 2
Joined: Tue Sep 09, 2008 9:32 am

Post by tclas »

Hi,

today I updated to wine 1.1.4. The behaviour is still the same.
But, I'm wondering if this thread is misplaced here, isn't it?

Regards.

tclas
jeffz
Level 5
Level 5
Posts: 345
Joined: Thu Mar 13, 2008 10:03 pm

Post by jeffz »

tclas wrote:Hi,

today I updated to wine 1.1.4. The behaviour is still the same.
But, I'm wondering if this thread is misplaced here, isn't it?

Regards.

tclas
You could file a bug report and attach your patch, adding the patch keyword, someone may give feedback.

I was going to reply earlier and say maybe you could write some testcases to test the behaviour of this function on windows. This might help you work out how correct your implementation is.
Locked