mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-23 06:59:53 -05:00
daemon: Add support for running as a service on win32
* Minimal implementation of --system on win32.
* Wrap main with a Windows Service on win32 (with a fallback to
running it directly).
* Update PA_SYSTEM_{RUNTIME,STATE,CONFIG}_PATH and HOME dynamically
on Windows (overrides the build config, similar to the existing
config path replacement logic).
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/549>
This commit is contained in:
parent
87b4d68978
commit
4f3ca10d9e
4 changed files with 151 additions and 1 deletions
|
|
@ -83,6 +83,7 @@
|
|||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#include <windows.h>
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSUP
|
||||
|
|
@ -171,6 +172,15 @@ char *pa_win32_get_toplevel(HANDLE handle) {
|
|||
return toplevel;
|
||||
}
|
||||
|
||||
char *pa_win32_get_system_appdata() {
|
||||
static char appdata[MAX_PATH] = {0};
|
||||
|
||||
if (!*appdata && SHGetFolderPathAndSubDirA(NULL, CSIDL_COMMON_APPDATA|CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, "PulseAudio", appdata) != S_OK)
|
||||
return NULL;
|
||||
|
||||
return appdata;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void set_nonblock(int fd, bool nonblock) {
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ bool pa_running_in_vm(void);
|
|||
|
||||
#ifdef OS_IS_WIN32
|
||||
char *pa_win32_get_toplevel(HANDLE handle);
|
||||
char *pa_win32_get_system_appdata();
|
||||
#endif
|
||||
|
||||
size_t pa_page_size(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue