QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
winutils.h
Go to the documentation of this file.
1/* 2025 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE: This software and all accompanying materials are the exclusive
5 * property of Quantum Resistant Cryptographic Solutions Corporation (QRCS).
6 * The intellectual and technical concepts contained within this implementation
7 * are proprietary to QRCS and its authorized licensors and are protected under
8 * applicable U.S. and international copyright, patent, and trade secret laws.
9 *
10 * CRYPTOGRAPHIC STANDARDS:
11 * - This software includes implementations of cryptographic algorithms such as
12 * SHA3, AES, and others. These algorithms are public domain or standardized
13 * by organizations such as NIST and are NOT the property of QRCS.
14 * - However, all source code, optimizations, and implementations in this library
15 * are original works of QRCS and are protected under this license.
16 *
17 * RESTRICTIONS:
18 * - Redistribution, modification, or unauthorized distribution of this software,
19 * in whole or in part, is strictly prohibited.
20 * - This software is provided for non-commercial, educational, and research
21 * purposes only. Commercial use in any form is expressly forbidden.
22 * - Licensing and authorized distribution are solely at the discretion of QRCS.
23 * - Any use of this software implies acceptance of these restrictions.
24 *
25 * DISCLAIMER:
26 * This software is provided "as is," without warranty of any kind, express or
27 * implied, including but not limited to warranties of merchantability or fitness
28 * for a particular purpose. QRCS disclaims all liability for any direct, indirect,
29 * incidental, or consequential damages resulting from the use or misuse of this software.
30 *
31 * FULL LICENSE:
32 * This software is subject to the **Quantum Resistant Cryptographic Solutions
33 * Proprietary License (QRCS-PL)**. The complete license terms are included
34 * in the LICENSE.txt file distributed with this software.
35 *
36 * Written by: John G. Underhill
37 * Contact: john.underhill@protonmail.com
38 */
39
40#ifndef QSC_WINUTILLS_H
41#define QSC_WINUTILLS_H
42
43#include "common.h"
44
45QSC_CPLUSPLUS_ENABLED_START
46
63
68#define QSC_WINTOOLS_ATTRIBUTES_BUFFER_SIZE 256ULL
69
74#define QSC_WINTOOLS_NETSTAT_BUFFER_SIZE 1024ULL
75
80#define QSC_WINTOOLS_NETSTAT_NAME_SIZE 256ULL
81
86#define QSC_WINTOOLS_PROCESS_LIST_SIZE 16384ULL
87
92#define QSC_WINTOOLS_REGISTRY_BUFFER_SIZE 1024ULL
93
98#define QSC_WINTOOLS_REGISTRY_LIST_SIZE 8192ULL
99
104#define QSC_WINTOOLS_RUNAS_BUFFER_SIZE 260ULL
105
110#define QSC_WINTOOLS_SERVICE_LIST_SIZE 16384ULL
111
116#define QSC_WINTOOLS_SERVICE_BUFFER_SIZE 512ULL
117
122#define QSC_WINTOOLS_SERVICE_LIST_DESCRIPTION
123
125//* \def QSC_WINTOOLS_SERVICE_LIST_ACTIVE_ONLY
126//* \brief Only include running services when listing services
127//*/
128//#define QSC_WINTOOLS_SERVICE_LIST_ACTIVE_ONLY
129
140
151
161QSC_EXPORT_API size_t qsc_winutils_file_get_attributes(char* result, size_t reslen, const char* path);
162
172QSC_EXPORT_API bool qsc_winutils_file_set_attribute(const char* path, const char* attr);
173
182QSC_EXPORT_API size_t qsc_winutils_network_statistics(char* result, size_t reslen);
183
192QSC_EXPORT_API size_t qsc_winutils_process_list(char* result, size_t reslen);
193
200
209
219QSC_EXPORT_API bool qsc_winutils_registry_key_add(const char* keypath, const char* value, qsc_winutils_registry_value_types vtype);
220
229
239QSC_EXPORT_API size_t qsc_winutils_registry_key_list(char* result, size_t reslen, const char* keypath);
240
249
259QSC_EXPORT_API bool qsc_winutils_run_as_user(const char* user, const char* password, const char* expath);
260
269QSC_EXPORT_API size_t qsc_winutils_service_list(char* result, size_t reslen);
270
277
287
296QSC_EXPORT_API size_t qsc_winutils_user_list(char* result, size_t reslen);
297
306QSC_EXPORT_API size_t qsc_winutils_current_user(char* result, size_t reslen);
307
312
313QSC_CPLUSPLUS_ENABLED_END
314
315#endif
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition common.h:520
QSC_EXPORT_API void qsc_winutils_test(void)
Test the winutils functions.
QSC_EXPORT_API size_t qsc_winutils_file_get_attributes(char *result, size_t reslen, const char *path)
Get a list of file attributes.
qsc_winutils_service_states
The service states enumeration.
Definition winutils.h:145
@ QSC_WINUTILS_SERVICE_STOP
Definition winutils.h:147
@ QSC_WINUTILS_SERVICE_RESUME
Definition winutils.h:149
@ QSC_WINUTILS_SERVICE_PAUSE
Definition winutils.h:148
@ QSC_WINUTILS_SERVICE_START
Definition winutils.h:146
qsc_winutils_registry_value_types
The registry value option types.
Definition winutils.h:134
@ REG_QWORD_TYPE
Definition winutils.h:137
@ REG_SZ_TYPE
Definition winutils.h:135
@ REG_BINARY_TYPE
Definition winutils.h:138
@ REG_DWORD_TYPE
Definition winutils.h:136
QSC_EXPORT_API size_t qsc_winutils_registry_key_list(char *result, size_t reslen, const char *keypath)
Create a list of registry keys under a starting key, ex. 'HKEY_CURRENT_USER\Software'.
QSC_EXPORT_API size_t qsc_winutils_service_list(char *result, size_t reslen)
Create a list of running services.
QSC_EXPORT_API bool qsc_winutils_process_token_elevate(void)
Elevate the token access.
QSC_EXPORT_API size_t qsc_winutils_network_statistics(char *result, size_t reslen)
Get a list of network statistics seperated by newline characters.
QSC_EXPORT_API bool qsc_winutils_run_as_user(const char *user, const char *password, const char *expath)
Run an application using the executable name and login credentials.
QSC_EXPORT_API size_t qsc_winutils_current_user(char *result, size_t reslen)
Get the logged in user account name.
QSC_EXPORT_API bool qsc_winutils_run_executable(const char *path)
Run an application using the executable path.
QSC_EXPORT_API bool qsc_winutils_registry_key_add(const char *keypath, const char *value, qsc_winutils_registry_value_types vtype)
Create a registry key and add a value.
QSC_EXPORT_API bool qsc_winutils_registry_key_delete(const char *keypath)
Delete a registry key.
QSC_EXPORT_API bool qsc_winutils_service_state(const char *name, qsc_winutils_service_states state)
Change the running state of a system service.
QSC_EXPORT_API bool qsc_winutils_process_terminate(const char *name)
Terminate a process.
QSC_EXPORT_API size_t qsc_winutils_service_list_size(void)
Get the size of the services list string.
QSC_EXPORT_API bool qsc_winutils_file_set_attribute(const char *path, const char *attr)
Set a file attribute. Valid attributes are readonly, hidden, system, archive, normal,...
QSC_EXPORT_API size_t qsc_winutils_user_list(char *result, size_t reslen)
Create a list of system user accounts and their descriptions.
QSC_EXPORT_API size_t qsc_winutils_process_list(char *result, size_t reslen)
Create a list of processes and their descriptions.