Bug 221429 - KUniqueApplication doesn't work in windows
Summary: KUniqueApplication doesn't work in windows
Status: RESOLVED FIXED
Alias: None
Product: kde-windows
Classification: Miscellaneous
Component: general (show other bugs)
Version: 4.3
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KDE-Windows
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-05 18:31 UTC by Joris Guisson
Modified: 2012-03-02 09:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
dbus-win32-kuniqueapplication.patch (517 bytes, patch)
2010-04-19 11:04 UTC, Krzysztof Nowicki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joris Guisson 2010-01-05 18:31:44 UTC
Version:            (using KDE 4.3.1)
OS:                MS Windows
Installed from:    MS Windows

Simply put you can open multiple instances of ktorrent on windows, in linux this is not possible and KUniqueApplication works as expected.
Comment 1 Christoph Feck 2010-01-05 20:05:21 UTC
Does DBus run?
Comment 2 Joris Guisson 2010-01-05 20:16:36 UTC
Yes dbus-daemon is running
Comment 3 Carlo Segato 2010-01-07 13:56:38 UTC
it works here with trunk
Comment 4 Krzysztof Nowicki 2010-04-19 11:04:06 UTC
Created attachment 42890 [details]
dbus-win32-kuniqueapplication.patch
Comment 5 Krzysztof Nowicki 2010-04-19 11:04:49 UTC
Hi,

I've been hunting down this bug and it seems that it's related to user privileges. I'm working on Windows XP without administrator rights and I hit this bug too.

I did some debugging and I tracked the problem down to DBus.

In bus/services.c, in function _dbus_process_exists() there is a call to OpenProcess(). The call requests PROCESS_ALL_ACCESS:

proc_handle = OpenProcess (PROCESS_ALL_ACCESS, FALSE, pid);

On my system this call fails with ERROR_ACCESS_DENIED.

If I change PROCESS_ALL_ACCESS to PROCESS_QUERY_INFORMATION it works.

The patch above contains the relevant code change.
Comment 6 Patrick Spendrin 2012-03-02 09:33:56 UTC
This works for a normal user in kontact (which is a KUniqueApplication) using mingw-w64 64bit on Windows 7 with the 4.8.0 release.
If that doesn't work, please reopen the bug report.