While working on some advapi32.service functions I found that having some tests for those APIs could be very useful. However nbot having added completely new tests so far there are a few issues I feel intimidated about.
The actual task of adding a new test file service.c does seem fairly straightforward to me, considering I can just take some other test file and copy the framework from it, adding the new service.c to the Makefile.in.
However there are a few issues I see. First almost any test won't make much sense without at least one service installed and activated. As it is now there seem to be no services installed by default in a clean Wine install. So I guess I would also need an extra executable somehow that implements a basic service that could for instance communicate through a pipe with the service test. It could be as simple as an executable that implements all the necessary communication with the service manager and offers some sort of pipe loopback as main service activity. But how am I going to add such an extra executable to the make logic of the advapi32 test?
Also under real Windows installing a service will in many cases fail since that requires administrative privileges for the current process and I'm not sure we can and want to enforce something like that especially for the unattended wine test service if that is still working.
I would really appreciate some help about adding an extra executable to the creation to the advapi32 make logic so that meaningful tests could be done on Wine. Or maybe someone knows of a service that is going to be added to a standard Wine installation soon?
Rolf Kalbermatter
On 5/18/07, Rolf Kalbermatter r.kalbermatter@hccnet.nl wrote:
While working on some advapi32.service functions I found that having some tests for those APIs could be very useful. However nbot having added completely new tests so far there are a few issues I feel intimidated about.
The actual task of adding a new test file service.c does seem fairly straightforward to me, considering I can just take some other test file and copy the framework from it, adding the new service.c to the Makefile.in.
However there are a few issues I see. First almost any test won't make much sense without at least one service installed and activated. As it is now there seem to be no services installed by default in a clean Wine install.
Have you looked? regedit HKLM\System\CurrentControlSet\Services. I'm not familiar with spooler, but I assume it's installed by default on win9x, whereas msi is not. Whichever service you test, though, you can just skip if the service doesn't exist.
So I guess I would also need an extra executable somehow that implements a basic service that could for instance communicate through a pipe with the service test. It could be as simple as an executable that implements all the necessary communication with the service manager and offers some sort of pipe loopback as main service activity. But how am I going to add such an extra executable to the make logic of the advapi32 test?
You won't need any of this.
Also under real Windows installing a service will in many cases fail since that requires administrative privileges for the current process and I'm not sure we can and want to enforce something like that especially for the unattended wine test service if that is still working.
Just check the return value of OpenSCManager; skip the test if they aren't admin. msdn implies that OpenSCManager will return ERROR_ACCESS_DENIED if they don't have the correct privileges. It's a trivial issue that most tests currently don't bother with.
James Hawkins [mailto:truiken@gmail.com] wrote
Have you looked? regedit HKLM\System\CurrentControlSet\Services. I'm not familiar with spooler, but I assume it's installed by default on win9x, whereas msi is not. Whichever service you test, though, you can just skip if the service doesn't exist.
Well I have checked and on a clean Wine install from current git there is no service installed at all. I see a VxD/MSTCP entry in the registry but no other settings in there that would be needed for a service to be started nor any other service entry. On that account I wonder what the VxD/MSTCP entry does at all or if it could be removed?
You won't need any of this.
Without at least one working service entry (active or not) there won't be many meaningful tests we could do for the service API.
Just check the return value of OpenSCManager; skip the test if they aren't admin. msdn implies that OpenSCManager will return ERROR_ACCESS_DENIED if they don't have the correct privileges. It's a trivial issue that most tests currently don't bother with.
I thought skip would be the solution but need to read on that. Last time I did a Wine test skip didn't exist at all.
Still on a clean Wine install I don't see how we can currently do many useful service API tests at all.
Rolf Kalbermatter
On 5/20/07, Rolf Kalbermatter r.kalbermatter@hccnet.nl wrote:
James Hawkins [mailto:truiken@gmail.com] wrote
Have you looked? regedit HKLM\System\CurrentControlSet\Services. I'm not familiar with spooler, but I assume it's installed by default on win9x, whereas msi is not. Whichever service you test, though, you can just skip if the service doesn't exist.
Well I have checked and on a clean Wine install from current git there is no service installed at all. I see a VxD/MSTCP entry in the registry but no other settings in there that would be needed for a service to be started nor any other service entry. On that account I wonder what the VxD/MSTCP entry does at all or if it could be removed?
Then something is wrong with your setup. Both MSIServer and Spooler are registered services when you run wineprefixcreate.
You won't need any of this.
Without at least one working service entry (active or not) there won't be many meaningful tests we could do for the service API.
Read above.
Just check the return value of OpenSCManager; skip the test if they aren't admin. msdn implies that OpenSCManager will return ERROR_ACCESS_DENIED if they don't have the correct privileges. It's a trivial issue that most tests currently don't bother with.
I thought skip would be the solution but need to read on that. Last time I did a Wine test skip didn't exist at all.
Still on a clean Wine install I don't see how we can currently do many useful service API tests at all.
On a clean install, there are two services to test. You need to figure out why you don't have those services. This is from a clean .wine:
REGEDIT4
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services]
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSIServer] "DisplayName"="MSIServer" "ErrorControl"=dword:00000001 "ImagePath"="c:\windows\system32\msiexec.exe" "Start"=dword:00000003 "Type"=dword:00000020
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Spooler] "Description"="Loads files to memory for later printing." "DisplayName"="Print Spooler" "ErrorControl"=dword:00000001 "Group"="SpoolerGroup" "ImagePath"="spoolsv.exe" "ObjectName"="LocalSystem" "Start"=dword:00000002 "Type"=dword:00000110
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD]
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP] @=""
On So, 2007-05-20 at 11:23 +0200, Rolf Kalbermatter wrote:
Well I have checked and on a clean Wine install from current git there is no service installed at all.
We have the Spooler-Service (only as a stub, but startable), so the entries should be present in the Registry.
Without at least one working service entry (active or not) there won't be many meaningful tests we could do for the service API.
You can take dlls/winspool.drv/tests/info.c as example, what I did for the Monitor-Tests. (Lines starting at 155; 283; 326)
Still on a clean Wine install I don't see how we can currently do many useful service API tests at all.
Because we have no need for a Service in Wine yet....
I mentioned already the idea for a "winetest.dll" / "winetest.drv" to allow tests, that need a dll next to "winetest.exe" (Global Hook, Printmonitor, Printer Driver, .... ).
A Service need also a DLL and the with the new "ntoskrnl.exe", a Driver "winetest.sys" might be useful.
It's also possible to add the new Files as a Resource in "winetest.exe", to have only a single file to download / start.
An Item to discuss is an Option in winetest.exe to Disable the Kernelmode-Testdriver.