docs: update file level doxygen blocks (#1258)

This commit is contained in:
ReenigneArcher 2023-05-07 18:12:39 -04:00 committed by GitHub
parent 07808de447
commit 4ca6dc6c8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
89 changed files with 415 additions and 102 deletions

View File

@ -1,3 +1,7 @@
/**
* @file src/audio.cpp
* @brief todo
*/
#include <thread> #include <thread>
#include <opus/opus_multistream.h> #include <opus/opus_multistream.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/audio.h
* @brief todo
*/
#pragma once #pragma once
#include "thread_safe.h" #include "thread_safe.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/cbs.cpp
* @brief todo
*/
extern "C" { extern "C" {
#include <cbs/cbs_h264.h> #include <cbs/cbs_h264.h>
#include <cbs/cbs_h265.h> #include <cbs/cbs_h265.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/cbs.h
* @brief todo
*/
#pragma once #pragma once
#include "utility.h" #include "utility.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/config.cpp
* @brief todo
*/
#include <algorithm> #include <algorithm>
#include <filesystem> #include <filesystem>
#include <fstream> #include <fstream>

View File

@ -1,3 +1,7 @@
/**
* @file src/config.h
* @brief todo
*/
#pragma once #pragma once
#include <bitset> #include <bitset>

View File

@ -1,4 +1,9 @@
// TODO: Authentication, better handling of routes common to nvhttp, cleanup /**
* @file src/confighttp.cpp
* @brief todo
*
* @todo Authentication, better handling of routes common to nvhttp, cleanup
*/
#define BOOST_BIND_GLOBAL_PLACEHOLDERS #define BOOST_BIND_GLOBAL_PLACEHOLDERS

View File

@ -1,3 +1,7 @@
/**
* @file src/confighttp.h
* @brief todo
*/
#pragma once #pragma once
#include <functional> #include <functional>

View File

@ -1,3 +1,7 @@
/**
* @file src/crypto.cpp
* @brief todo
*/
#include "crypto.h" #include "crypto.h"
#include <openssl/pem.h> #include <openssl/pem.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/crypto.h
* @brief todo
*/
#pragma once #pragma once
#include <array> #include <array>

View File

@ -1,3 +1,7 @@
/**
* @file src/httpcommon.cpp
* @brief todo
*/
#define BOOST_BIND_GLOBAL_PLACEHOLDERS #define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include "process.h" #include "process.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/httpcommon.h
* @brief todo
*/
#pragma once #pragma once
#include "network.h" #include "network.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/input.cpp
* @brief todo
*/
// define uint32_t for <moonlight-common-c/src/Input.h> // define uint32_t for <moonlight-common-c/src/Input.h>
#include <cstdint> #include <cstdint>
extern "C" { extern "C" {

View File

@ -1,3 +1,7 @@
/**
* @file src/input.h
* @brief todo
*/
#pragma once #pragma once
#include <functional> #include <functional>

View File

@ -1,5 +1,6 @@
/** /**
* @file main.cpp * @file src/main.cpp
* @brief Main entry point for Sunshine.
*/ */
// standard includes // standard includes
@ -116,9 +117,9 @@ namespace lifetime {
static std::atomic_int desired_exit_code; static std::atomic_int desired_exit_code;
/** /**
* @brief Terminates Sunshine gracefully with the provided exit code * @brief Terminates Sunshine gracefully with the provided exit code.
* @param exit_code The exit code to return from main() * @param exit_code The exit code to return from main().
* @param async Specifies whether our termination will be non-blocking * @param async Specifies whether our termination will be non-blocking.
*/ */
void void
exit_sunshine(int exit_code, bool async) { exit_sunshine(int exit_code, bool async) {
@ -137,7 +138,7 @@ namespace lifetime {
} }
/** /**
* @brief Gets the argv array passed to main() * @brief Gets the argv array passed to main().
*/ */
char ** char **
get_argv() { get_argv() {
@ -150,8 +151,8 @@ namespace service_ctrl {
class service_controller { class service_controller {
public: public:
/** /**
* @brief Constructor for service_controller class * @brief Constructor for service_controller class.
* @param service_desired_access SERVICE_* desired access flags * @param service_desired_access SERVICE_* desired access flags.
*/ */
service_controller(DWORD service_desired_access) { service_controller(DWORD service_desired_access) {
scm_handle = OpenSCManagerA(nullptr, nullptr, SC_MANAGER_CONNECT); scm_handle = OpenSCManagerA(nullptr, nullptr, SC_MANAGER_CONNECT);
@ -180,7 +181,7 @@ namespace service_ctrl {
} }
/** /**
* @brief Asynchronously starts the Sunshine service * @brief Asynchronously starts the Sunshine service.
*/ */
bool bool
start_service() { start_service() {
@ -200,8 +201,8 @@ namespace service_ctrl {
} }
/** /**
* @brief Query the service status * @brief Query the service status.
* @param status The SERVICE_STATUS struct to populate * @param status The SERVICE_STATUS struct to populate.
*/ */
bool bool
query_service_status(SERVICE_STATUS &status) { query_service_status(SERVICE_STATUS &status) {
@ -224,7 +225,7 @@ namespace service_ctrl {
}; };
/** /**
* @brief Check if the service is running * @brief Check if the service is running.
* *
* EXAMPLES: * EXAMPLES:
* ```cpp * ```cpp
@ -244,7 +245,7 @@ namespace service_ctrl {
} }
/** /**
* @brief Start the service and wait for startup to complete * @brief Start the service and wait for startup to complete.
* *
* EXAMPLES: * EXAMPLES:
* ```cpp * ```cpp
@ -278,7 +279,7 @@ namespace service_ctrl {
} }
/** /**
* @brief Wait for the UI to be ready after Sunshine startup * @brief Wait for the UI to be ready after Sunshine startup.
* *
* EXAMPLES: * EXAMPLES:
* ```cpp * ```cpp
@ -335,7 +336,7 @@ namespace service_ctrl {
#endif #endif
/** /**
* @brief Launch the Web UI * @brief Launch the Web UI.
* *
* EXAMPLES: * EXAMPLES:
* ```cpp * ```cpp

View File

@ -1,5 +1,6 @@
/** /**
* @file main.h * @file src/main.h
* @brief Main header file for the Sunshine application.
*/ */
// macros // macros

View File

@ -1,3 +1,7 @@
/**
* @file src/move_by_copy.h
* @brief todo
*/
#pragma once #pragma once
#include <utility> #include <utility>

View File

@ -1,3 +1,7 @@
/**
* @file src/network.cpp
* @brief todo
*/
#include "network.h" #include "network.h"
#include "utility.h" #include "utility.h"
#include <algorithm> #include <algorithm>

View File

@ -1,3 +1,7 @@
/**
* @file src/network.h
* @brief todo
*/
#pragma once #pragma once
#include <tuple> #include <tuple>

View File

@ -1,5 +1,6 @@
/** /**
* @file nvhttp.h * @file src/nvhttp.h
* @brief todo
*/ */
// macros // macros

View File

@ -1,5 +1,6 @@
/** /**
* @file nvhttp.h * @file src/nvhttp.h
* @brief todo
*/ */
// macros // macros
@ -18,9 +19,10 @@ namespace nvhttp {
/** /**
* @brief The protocol version. * @brief The protocol version.
* @details The version of the GameStream protocol we are mocking.
* @note The negative 4th number indicates to Moonlight that this is Sunshine.
*/ */
constexpr auto VERSION = "7.1.431.-1"; constexpr auto VERSION = "7.1.431.-1";
// The negative 4th version number tells Moonlight that this is Sunshine
/** /**
* @brief The GFE version we are replicating. * @brief The GFE version we are replicating.

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/common.h
* @brief todo
*/
#pragma once #pragma once
#include <bitset> #include <bitset>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/audio.cpp
* @brief todo
*/
#include <bitset> #include <bitset>
#include <sstream> #include <sstream>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/cuda.cpp
* @brief todo
*/
#include <bitset> #include <bitset>
#include <NvFBC.h> #include <NvFBC.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/cuda.cu
* @brief todo
*/
// #include <algorithm> // #include <algorithm>
#include <helper_math.h> #include <helper_math.h>
#include <chrono> #include <chrono>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/cuda.h
* @brief todo
*/
#pragma once #pragma once
#if defined(SUNSHINE_BUILD_CUDA) #if defined(SUNSHINE_BUILD_CUDA)

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/graphics.cpp
* @brief todo
*/
#include "graphics.h" #include "graphics.h"
#include "src/video.h" #include "src/video.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/graphics.h
* @brief todo
*/
#pragma once #pragma once
#include <optional> #include <optional>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/input.cpp
* @brief todo
*/
#include <fcntl.h> #include <fcntl.h>
#include <linux/uinput.h> #include <linux/uinput.h>
#include <poll.h> #include <poll.h>
@ -1108,7 +1112,7 @@ namespace platf {
* *
* EXAMPLES: * EXAMPLES:
* ```cpp * ```cpp
* x_move_mouse(input, 10, 10); // Move mouse 10 pixels down and right * x_move_mouse(input, 10, 10); // Move mouse 10 pixels down and right
* ``` * ```
*/ */
static void static void
@ -1204,7 +1208,7 @@ namespace platf {
* *
* EXAMPLES: * EXAMPLES:
* ```cpp * ```cpp
* button_mouse(input, 1, false); // Press left mouse button * button_mouse(input, 1, false); // Press left mouse button
* ``` * ```
*/ */
void void
@ -1336,12 +1340,12 @@ namespace platf {
* @brief XTest keyboard emulation. * @brief XTest keyboard emulation.
* @param input The input_t instance to use. * @param input The input_t instance to use.
* @param modcode The moonlight key code. * @param modcode The moonlight key code.
* @param release Whether the event was a press (false) or a release (true) * @param release Whether the event was a press (false) or a release (true).
* @param flags SS_KBE_FLAG_* values * @param flags SS_KBE_FLAG_* values.
* *
* EXAMPLES: * EXAMPLES:
* ```cpp * ```cpp
* x_keyboard(input, 0x5A, false, 0); // Press Z * x_keyboard(input, 0x5A, false, 0); // Press Z
* ``` * ```
*/ */
static void static void
@ -1371,12 +1375,12 @@ namespace platf {
* @brief Keyboard emulation. * @brief Keyboard emulation.
* @param input The input_t instance to use. * @param input The input_t instance to use.
* @param modcode The moonlight key code. * @param modcode The moonlight key code.
* @param release Whether the event was a press (false) or a release (true) * @param release Whether the event was a press (false) or a release (true).
* @param flags SS_KBE_FLAG_* values * @param flags SS_KBE_FLAG_* values.
* *
* EXAMPLES: * EXAMPLES:
* ```cpp * ```cpp
* keyboard(input, 0x5A, false, 0); // Press Z * keyboard(input, 0x5A, false, 0); // Press Z
* ``` * ```
*/ */
void void

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/kmsgrab.cpp
* @brief todo
*/
#include <drm_fourcc.h> #include <drm_fourcc.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,7 +1,7 @@
/** /**
* @file misc.cpp * @file src/misc.cpp
* @brief todo
*/ */
// standard includes // standard includes
#include <fstream> #include <fstream>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/misc.h
* @brief todo
*/
#pragma once #pragma once
#include <unistd.h> #include <unistd.h>

View File

@ -1,5 +1,9 @@
/**
// adapted from https://www.avahi.org/doxygen/html/client-publish-service_8c-example.html * @file src/platform/linux/publish.cpp
* @brief todo
* @note Adapted from https://www.avahi.org/doxygen/html/client-publish-service_8c-example.html
* @todo Use a common file for this and src/platform/macos/publish.cpp
*/
#include <thread> #include <thread>
#include "misc.h" #include "misc.h"
@ -13,7 +17,7 @@ using namespace std::literals;
namespace avahi { namespace avahi {
/** /**
* @brief Error codes used by avahi * @brief Error codes used by avahi.
*/ */
enum err_e { enum err_e {
OK = 0, /**< OK */ OK = 0, /**< OK */
@ -116,7 +120,7 @@ namespace avahi {
}; };
/** /**
* @brief Some flags for publishing functions * @brief Flags for publishing functions.
*/ */
enum PublishFlags { enum PublishFlags {
PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */ PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/vaapi.cpp
* @brief todo
*/
#include <sstream> #include <sstream>
#include <string> #include <string>
@ -82,7 +86,7 @@ namespace va {
}; };
/** /**
* @brief Currently defined profiles * @brief Defined profiles
*/ */
enum class profile_e { enum class profile_e {
// Profile ID used for video processing. // Profile ID used for video processing.

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/vaapi.h
* @brief todo
*/
#pragma once #pragma once
#include "misc.h" #include "misc.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/wayland.cpp
* @brief todo
*/
#include <wayland-client.h> #include <wayland-client.h>
#include <wayland-util.h> #include <wayland-util.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/wayland.h
* @brief todo
*/
#pragma once #pragma once
#include <bitset> #include <bitset>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/wlgrab.cpp
* @brief todo
*/
#include "src/platform/common.h" #include "src/platform/common.h"
#include "src/main.h" #include "src/main.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/x11grab.cpp
* @brief todo
*/
#include "src/platform/common.h" #include "src/platform/common.h"
#include <fstream> #include <fstream>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/linux/x11grab.h
* @brief todo
*/
#pragma once #pragma once
#include <optional> #include <optional>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/av_audio.h
* @brief todo
*/
#pragma once #pragma once
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/av_audio.m
* @brief todo
*/
#import "av_audio.h" #import "av_audio.h"
@implementation AVAudio @implementation AVAudio

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/av_img_t.h
* @brief todo
*/
#pragma once #pragma once
#include "src/platform/common.h" #include "src/platform/common.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/av_video.h
* @brief todo
*/
#pragma once #pragma once
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/av_video.m
* @brief todo
*/
#import "av_video.h" #import "av_video.h"
@implementation AVVideo @implementation AVVideo

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/display.mm
* @brief todo
*/
#include "src/platform/common.h" #include "src/platform/common.h"
#include "src/platform/macos/av_img_t.h" #include "src/platform/macos/av_img_t.h"
#include "src/platform/macos/av_video.h" #include "src/platform/macos/av_video.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/input.cpp
* @brief todo
*/
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
#include <mach/mach.h> #include <mach/mach.h>
#include <mach/mach_time.h> #include <mach/mach_time.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/microphone.mm
* @brief todo
*/
#include "src/platform/common.h" #include "src/platform/common.h"
#include "src/platform/macos/av_audio.h" #include "src/platform/macos/av_audio.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/misc.h
* @brief todo
*/
#pragma once #pragma once
#include <vector> #include <vector>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/misc.mm
* @brief todo
*/
#include <Foundation/Foundation.h> #include <Foundation/Foundation.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <dlfcn.h> #include <dlfcn.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/nv12_zero_device.cpp
* @brief todo
*/
#include "src/platform/macos/nv12_zero_device.h" #include "src/platform/macos/nv12_zero_device.h"
#include "src/platform/macos/av_img_t.h" #include "src/platform/macos/av_img_t.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/macos/nv12_zero_device.h
* @brief todo
*/
#pragma once #pragma once
#include "src/platform/common.h" #include "src/platform/common.h"

View File

@ -1,5 +1,9 @@
/**
// adapted from https://www.avahi.org/doxygen/html/client-publish-service_8c-example.html * @file src/platform/macos/publish.cpp
* @brief todo
* @note Adapted from https://www.avahi.org/doxygen/html/client-publish-service_8c-example.html
* @todo Use a common file for this and src/platform/linux/publish.cpp
*/
#include <thread> #include <thread>
#include "misc.h" #include "misc.h"
@ -13,7 +17,7 @@ using namespace std::literals;
namespace avahi { namespace avahi {
/** /**
* @brief Error codes used by avahi * @brief Error codes used by avahi.
*/ */
enum err_e { enum err_e {
OK = 0, /**< OK */ OK = 0, /**< OK */
@ -116,7 +120,7 @@ namespace avahi {
}; };
/** /**
* @brief Some flags for publishing functions * @brief Flags for publishing functions.
*/ */
enum PublishFlags { enum PublishFlags {
PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */ PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */

View File

@ -1,10 +1,10 @@
// ---------------------------------------------------------------------------- /**
// PolicyConfig.h * @file src/platform/windows/PolicyConfig.h
// Undocumented COM-interface IPolicyConfig. * @brief Undocumented COM-interface IPolicyConfig.
// Use for set default audio render endpoint * @details Use for setting default audio render endpoint.
// @author EreTIk * @author EreTIk
// http://eretik.omegahg.com/ * @see http://eretik.omegahg.com/
// ---------------------------------------------------------------------------- */
#pragma once #pragma once

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/audio.cpp
* @brief todo
*/
#include <audioclient.h> #include <audioclient.h>
#include <mmdeviceapi.h> #include <mmdeviceapi.h>
#include <roapi.h> #include <roapi.h>
@ -678,11 +682,9 @@ namespace platf::audio {
} }
/** /**
* @brief Find the audio device ID given a user-specified name * @brief Find the audio device ID given a user-specified name.
* * @param name The name provided by the user.
* @param name The name provided by the user * @return The matching device ID, or nothing if not found.
*
* @return The matching device ID, or nothing if not found
*/ */
std::optional<std::wstring> std::optional<std::wstring>
find_device_id_by_name(const std::string &name) { find_device_id_by_name(const std::string &name) {

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/display.h
* @brief todo
*/
#pragma once #pragma once
#include <d3d11.h> #include <d3d11.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/display_base.cpp
* @brief todo
*/
#include <cmath> #include <cmath>
#include <codecvt> #include <codecvt>
#include <initguid.h> #include <initguid.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/display_ram.cpp
* @brief todo
*/
#include "display.h" #include "display.h"
#include "misc.h" #include "misc.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/display_vram.cpp
* @brief todo
*/
#include <cmath> #include <cmath>
#include <codecvt> #include <codecvt>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/input.cpp
* @brief todo
*/
#include <windows.h> #include <windows.h>
#include <cmath> #include <cmath>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/misc.cpp
* @brief todo
*/
#include <csignal> #include <csignal>
#include <filesystem> #include <filesystem>
#include <iomanip> #include <iomanip>
@ -229,9 +233,8 @@ namespace platf {
} }
/** /**
* @brief A function to obtain the current sessions user's primary token with elevated privileges * @brief Obtain the current sessions user's primary token with elevated privileges.
* * @return The user's token. If user has admin capability it will be elevated, otherwise it will be a limited token. On error, `nullptr`.
* @return The users token, if user has admin capability it will be elevated. If not, it will return back a limited token. On error, nullptrs
*/ */
HANDLE HANDLE
retrieve_users_token(bool elevated) { retrieve_users_token(bool elevated) {
@ -333,10 +336,9 @@ namespace platf {
} }
/** /**
* @brief Check if the current process is running with system-level privileges.
@brief Check if the current process is running with system-level privileges. * @return `true` if the current process has system-level privileges, `false` otherwise.
@return true if the current process has system-level privileges, false otherwise. */
*/
bool bool
is_running_as_system() { is_running_as_system() {
BOOL ret; BOOL ret;
@ -430,14 +432,13 @@ namespace platf {
} }
/** /**
* @brief Creates a bp::child object from the results of launching a process * @brief Create a `bp::child` object from the results of launching a process.
* * @param process_launched A boolean indicating if the launch was successful.
* @param process_launched A boolean indicating whether the launch was successful or not * @param cmd The command that was used to launch the process.
* @param cmd The command that was used to launch the process * @param ec A reference to an `std::error_code` object that will store any error that occurred during the launch.
* @param ec A reference to an std::error_code object that will store any error that occurred during the launch * @param process_info A reference to a `PROCESS_INFORMATION` structure that contains information about the new process.
* @param process_info A reference to a PROCESS_INFORMATION structure that contains information about the new process * @param group A pointer to a `bp::group` object that will add the new process to its group, if not null.
* @param group A pointer to a bp::group object that will add the new process to its group, if not null * @return A `bp::child` object representing the new process, or an empty `bp::child` object if the launch failed.
* @return A bp::child object representing the new process, or an empty bp::child object if the launch failed or an error occurred
*/ */
bp::child bp::child
create_boost_child_from_results(bool process_launched, const std::string &cmd, std::error_code &ec, PROCESS_INFORMATION &process_info, bp::group *group) { create_boost_child_from_results(bool process_launched, const std::string &cmd, std::error_code &ec, PROCESS_INFORMATION &process_info, bp::group *group) {
@ -477,11 +478,10 @@ namespace platf {
} }
/** /**
* @brief Impersonate the current user, invoke the callback function, then returns back to system context. * @brief Impersonate the current user and invoke the callback function.
* * @param user_token A handle to the user's token that was obtained from the shell.
* @param user_token A handle to the user's token that was obtained from the shell * @param callback A function that will be executed while impersonating the user.
* @param callback A function that will be executed while impersonating the user * @return An `std::error_code` object that will store any error that occurred during the impersonation
* @return An std::error_code object that will store any error that occurred during the impersonation
*/ */
std::error_code std::error_code
impersonate_current_user(HANDLE user_token, std::function<void()> callback) { impersonate_current_user(HANDLE user_token, std::function<void()> callback) {
@ -515,11 +515,10 @@ namespace platf {
} }
/** /**
* @brief A function to create a STARTUPINFOEXW structure for launching a process * @brief A function to create a `STARTUPINFOEXW` structure for launching a process.
* * @param file A pointer to a `FILE` object that will be used as the standard output and error for the new process, or null if not needed.
* @param file A pointer to a FILE object that will be used as the standard output and error for the new process, or null if not needed * @param ec A reference to a `std::error_code` object that will store any error that occurred during the creation of the structure.
* @param ec A reference to an std::error_code object that will store any error that occurred during the creation of the structure * @return A `STARTUPINFOEXW` structure that contains information about how to launch the new process.
* @return A STARTUPINFOEXW structure that contains information about how to launch the new process
*/ */
STARTUPINFOEXW STARTUPINFOEXW
create_startup_info(FILE *file, std::error_code &ec) { create_startup_info(FILE *file, std::error_code &ec) {
@ -563,22 +562,19 @@ namespace platf {
} }
/** /**
* @brief Runs a command on the users profile * @brief Run a command on the users profile.
* *
* This function launches a child process as the user, using the current user's environment * Launches a child process as the user, using the current user's environment and a specific working directory.
* and a specific working directory. If the launch is successful, a `bp::child` object representing the new
* process is returned. Otherwise, an error code is returned.
* *
* @param elevated Specify to elevate the process or not * @param elevated Specify whether to elevate the process.
* @param interactive Specifies whether this will run in a window or hidden * @param interactive Specify whether this will run in a window or hidden.
* @param cmd The command to run * @param cmd The command to run.
* @param working_dir The working directory for the new process * @param working_dir The working directory for the new process.
* @param env The environment variables to use for the new process * @param env The environment variables to use for the new process.
* @param file A file object to redirect the child process's output to (may be nullptr) * @param file A file object to redirect the child process's output to (may be `nullptr`).
* @param ec An error code, set to indicate any errors that occur during the launch process * @param ec An error code, set to indicate any errors that occur during the launch process.
* @param group A pointer to a `bp::group` object to which the new process should belong (may be nullptr) * @param group A pointer to a `bp::group` object to which the new process should belong (may be `nullptr`).
* * @return A `bp::child` object representing the new process, or an empty `bp::child` object if the launch fails.
* @return A `bp::child` object representing the new process, or an empty `bp::child` object if the launch fails
*/ */
bp::child bp::child
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) { run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/misc.h
* @brief todo
*/
#pragma once #pragma once
#include <chrono> #include <chrono>

View File

@ -1,3 +1,7 @@
/**
* @file src/platform/windows/publish.cpp
* @brief todo
*/
#include <winsock2.h> #include <winsock2.h>
#include <windows.h> #include <windows.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/process.cpp
* @brief todo
*/
#define BOOST_BIND_GLOBAL_PLACEHOLDERS #define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include "process.h" #include "process.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/process.h
* @brief todo
*/
#pragma once #pragma once
#ifndef __kernel_entry #ifndef __kernel_entry

View File

@ -1,3 +1,7 @@
/**
* @file src/round_robin.h
* @brief todo
*/
#pragma once #pragma once
#include <iterator> #include <iterator>

View File

@ -1,3 +1,7 @@
/**
* @file src/rstp.cpp
* @brief todo
*/
#define BOOST_BIND_GLOBAL_PLACEHOLDERS #define BOOST_BIND_GLOBAL_PLACEHOLDERS
extern "C" { extern "C" {

View File

@ -1,3 +1,7 @@
/**
* @file src/rtsp.h
* @brief todo
*/
#pragma once #pragma once
#include <atomic> #include <atomic>

View File

@ -1,3 +1,7 @@
/**
* @file src/stat_trackers.cpp
* @brief todo
*/
#include "stat_trackers.h" #include "stat_trackers.h"
namespace stat_trackers { namespace stat_trackers {

View File

@ -1,3 +1,7 @@
/**
* @file src/stat_trackers.h
* @brief todo
*/
#pragma once #pragma once
#include <chrono> #include <chrono>

View File

@ -1,3 +1,7 @@
/**
* @file src/stream.cpp
* @brief todo
*/
#include "process.h" #include "process.h"
#include <future> #include <future>

View File

@ -1,3 +1,7 @@
/**
* @file src/stream.h
* @brief todo
*/
#pragma once #pragma once
#include <boost/asio.hpp> #include <boost/asio.hpp>

View File

@ -1,3 +1,7 @@
/**
* @file src/sync.h
* @brief todo
*/
#pragma once #pragma once
#include <array> #include <array>

View File

@ -1,5 +1,6 @@
/** /**
* @file system_tray.cpp * @file src/system_tray.cpp
* @brief todo
*/ */
// macros // macros
#if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1 #if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1
@ -230,7 +231,7 @@ namespace system_tray {
/** /**
* @brief Run the system tray with platform specific options. * @brief Run the system tray with platform specific options.
* @note macOS requires that UI elements be created on the main thread, so the system tray is not implemented for macOS. * @note macOS requires that UI elements be created on the main thread, so the system tray is not currently implemented for macOS.
*/ */
void void
run_tray() { run_tray() {

View File

@ -1,5 +1,6 @@
/** /**
* @file system_tray.h * @file src/system_tray.h
* @brief todo
*/ */
#pragma once #pragma once
@ -7,8 +8,6 @@
// system_tray namespace // system_tray namespace
namespace system_tray { namespace system_tray {
void
open_url(const std::string &url);
void void
tray_open_ui_cb(struct tray_menu *item); tray_open_ui_cb(struct tray_menu *item);
void void

View File

@ -1,3 +1,7 @@
/**
* @file src/task_pool.h
* @brief todo
*/
#pragma once #pragma once
#include <chrono> #include <chrono>

View File

@ -1,3 +1,7 @@
/**
* @file src/thread_pool.h
* @brief todo
*/
#pragma once #pragma once
#include "task_pool.h" #include "task_pool.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/thread_safe.h
* @brief todo
*/
#pragma once #pragma once
#include <array> #include <array>

View File

@ -1,3 +1,7 @@
/**
* @file src/upnp.cpp
* @brief todo
*/
#include <miniupnpc.h> #include <miniupnpc.h>
#include <upnpcommands.h> #include <upnpcommands.h>

View File

@ -1,3 +1,7 @@
/**
* @file src/upnp.h
* @brief todo
*/
#pragma once #pragma once
#include "platform/common.h" #include "platform/common.h"

View File

@ -1,3 +1,7 @@
/**
* @file src/utility.h
* @brief todo
*/
#pragma once #pragma once
#include <algorithm> #include <algorithm>

View File

@ -1,3 +1,7 @@
/**
* @file src/uuid.h
* @brief todo
*/
#pragma once #pragma once
#include <random> #include <random>

View File

@ -1,3 +1,8 @@
/**
* @file src/version.h.in
* @brief Version definitions for Sunshine.
* @note The final `version.h` is generated from this file during the CMake build.
*/
#pragma once #pragma once
#define PROJECT_NAME "@PROJECT_NAME@" #define PROJECT_NAME "@PROJECT_NAME@"

View File

@ -1,3 +1,7 @@
/**
* @file src/video.cpp
* @brief todo
*/
#include <atomic> #include <atomic>
#include <bitset> #include <bitset>
#include <list> #include <list>

View File

@ -1,3 +1,7 @@
/**
* @file src/video.h
* @brief todo
*/
#pragma once #pragma once
#include "input.h" #include "input.h"

View File

@ -1,7 +1,7 @@
// /**
// Created by loki on 1/24/20. * @file tools/audio.cpp
// * @brief todo
*/
#include <audioclient.h> #include <audioclient.h>
#include <mmdeviceapi.h> #include <mmdeviceapi.h>
#include <roapi.h> #include <roapi.h>

View File

@ -1,3 +1,7 @@
/**
* @file tools/ddprobe.cpp
* @brief todo
*/
#include <d3d11.h> #include <d3d11.h>
#include <dxgi1_2.h> #include <dxgi1_2.h>

View File

@ -1,7 +1,7 @@
// /**
// Created by loki on 1/23/20. * @file tools/dxgi.cpp
// * @brief todo
*/
#include <d3dcommon.h> #include <d3dcommon.h>
#include <dxgi.h> #include <dxgi.h>

View File

@ -1,3 +1,7 @@
/**
* @file tools/sunshinesvc.cpp
* @brief todo
*/
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <Windows.h> #include <Windows.h>
#include <wtsapi32.h> #include <wtsapi32.h>