http://bugs.winehq.org/show_bug.cgi?id=7882
--- Comment #1 from Mikolaj Zalewski mikolaj.zalewski@gmail.com 2007-08-20 21:06:38 --- Created an attachment (id=7702) --> (http://bugs.winehq.org/attachment.cgi?id=7702) patch
I've had the insufficient privileges problem when for some reason the pipe between advapis on the service and client sides got closed. On the server side there was a failure in ConnectNamedPipe and on the client side a failure of QueryServiceStatus what Photoshop seems to interpret as a lack of privileges. After such a change (which makes the code similar to the code in ole32) the problem seems to be gone. But I will have to check what's the source of the problem and if that's advapi that needs to be changed or something below.
After this change Photoshop complains that an error occured and it needs to be reinstalled. I currently don't know why this happens. This could be because the service tries to access directly the disc but fails (CreateFile("\\.\c:", ...)). There is also a small differance with Windows that when StartService is called with the service already running we print an ERR and return TRUE. But I wrote a dirty patch that returned FALSE and it didn't help.
The message box about the error can be dismissed by pressing Enter. Then Photoshop will hang. This happens because after a few calls the service ends it's thread but doesn't close the named pipe used to communicate. The service process doesn't terminate because there is an advapi thread running all the time. When Photoshop makes another request through the named pipe it hangs.