QSC Post Quantum Cryptographic Library 1.3.0.0 (C1)
A post quantum secure library written in Ansi C
Loading...
Searching...
No Matches
winutils.h
Go to the documentation of this file.
1/* 2020-2026 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE:
5 * This software and all accompanying materials are the exclusive property of
6 * Quantum Resistant Cryptographic Solutions Corporation (QRCS). The intellectual
7 * and technical concepts contained herein are proprietary to QRCS and are
8 * protected under applicable Canadian, U.S., and international copyright,
9 * patent, and trade secret laws.
10 *
11 * CRYPTOGRAPHIC ALGORITHMS AND IMPLEMENTATIONS:
12 * - This software includes implementations of cryptographic primitives and
13 * algorithms that are standardized or in the public domain, such as AES
14 * and SHA-3, which are not proprietary to QRCS.
15 * - This software also includes cryptographic primitives, constructions, and
16 * algorithms designed by QRCS, including but not limited to RCS, SCB, CSX, QMAC, and
17 * related components, which are proprietary to QRCS.
18 * - All source code, implementations, protocol compositions, optimizations,
19 * parameter selections, and engineering work contained in this software are
20 * original works of QRCS and are protected under this license.
21 *
22 * LICENSE AND USE RESTRICTIONS:
23 * - This software is licensed under the Quantum Resistant Cryptographic Solutions
24 * Public Research and Evaluation License (QRCS-PREL), 2025-2026.
25 * - Permission is granted solely for non-commercial evaluation, academic research,
26 * cryptographic analysis, interoperability testing, and feasibility assessment.
27 * - Commercial use, production deployment, commercial redistribution, or
28 * integration into products or services is strictly prohibited without a
29 * separate written license agreement executed with QRCS.
30 * - Licensing and authorized distribution are solely at the discretion of QRCS.
31 *
32 * EXPERIMENTAL CRYPTOGRAPHY NOTICE:
33 * Portions of this software may include experimental, novel, or evolving
34 * cryptographic designs. Use of this software is entirely at the user's risk.
35 *
36 * DISCLAIMER:
37 * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38 * IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
39 * FOR A PARTICULAR PURPOSE, SECURITY, OR NON-INFRINGEMENT. QRCS DISCLAIMS ALL
40 * LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
41 * ARISING FROM THE USE OR MISUSE OF THIS SOFTWARE.
42 *
43 * FULL LICENSE:
44 * This software is subject to the Quantum Resistant Cryptographic Solutions
45 * Public Research and Evaluation License (QRCS-PREL), 2025-2026. The complete license terms
46 * are provided in the accompanying LICENSE file or at https://www.qrcscorp.ca.
47 *
48 * Written by: John G. Underhill
49 * Contact: contact@qrcscorp.ca
50 */
51
52#ifndef QSC_WINUTILLS_H
53#define QSC_WINUTILLS_H
54
55#include "qsccommon.h"
56
57QSC_CPLUSPLUS_ENABLED_START
58
75
80#define QSC_WINTOOLS_ATTRIBUTES_BUFFER_SIZE 256ULL
81
86#define QSC_WINTOOLS_NETSTAT_BUFFER_SIZE 1024ULL
87
92#define QSC_WINTOOLS_NETSTAT_NAME_SIZE 256ULL
93
98#define QSC_WINTOOLS_PROCESS_LIST_SIZE 16384ULL
99
104#define QSC_WINTOOLS_REGISTRY_BUFFER_SIZE 1024ULL
105
110#define QSC_WINTOOLS_REGISTRY_LIST_SIZE 8192ULL
111
116#define QSC_WINTOOLS_RUNAS_BUFFER_SIZE 260ULL
117
122#define QSC_WINTOOLS_SERVICE_LIST_SIZE 16384ULL
123
128#define QSC_WINTOOLS_SERVICE_BUFFER_SIZE 512ULL
129
134#define QSC_WINTOOLS_SERVICE_LIST_DESCRIPTION
135
137//* \def QSC_WINTOOLS_SERVICE_LIST_ACTIVE_ONLY
138//* \brief Only include running services when listing services
139//*/
140//#define QSC_WINTOOLS_SERVICE_LIST_ACTIVE_ONLY
141
152
163
173QSC_EXPORT_API size_t qsc_winutils_file_get_attributes(char* result, size_t reslen, const char* path);
174
184QSC_EXPORT_API bool qsc_winutils_file_set_attribute(const char* path, const char* attr);
185
194QSC_EXPORT_API size_t qsc_winutils_network_statistics(char* result, size_t reslen);
195
204QSC_EXPORT_API size_t qsc_winutils_process_list(char* result, size_t reslen);
205
212
221
231QSC_EXPORT_API bool qsc_winutils_registry_key_add(const char* keypath, const char* value, qsc_winutils_registry_value_types vtype);
232
241
251QSC_EXPORT_API size_t qsc_winutils_registry_key_list(char* result, size_t reslen, const char* keypath);
252
261
271QSC_EXPORT_API bool qsc_winutils_run_as_user(const char* user, const char* password, const char* expath);
272
281QSC_EXPORT_API size_t qsc_winutils_service_list(char* result, size_t reslen);
282
289
299
308QSC_EXPORT_API size_t qsc_winutils_user_list(char* result, size_t reslen);
309
318QSC_EXPORT_API size_t qsc_winutils_current_user(char* result, size_t reslen);
319
324
325QSC_CPLUSPLUS_ENABLED_END
326
327#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 qsccommon.h:645
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:157
@ QSC_WINUTILS_SERVICE_STOP
Definition winutils.h:159
@ QSC_WINUTILS_SERVICE_RESUME
Definition winutils.h:161
@ QSC_WINUTILS_SERVICE_PAUSE
Definition winutils.h:160
@ QSC_WINUTILS_SERVICE_START
Definition winutils.h:158
qsc_winutils_registry_value_types
The registry value option types.
Definition winutils.h:146
@ REG_QWORD_TYPE
Definition winutils.h:149
@ REG_SZ_TYPE
Definition winutils.h:147
@ REG_BINARY_TYPE
Definition winutils.h:150
@ REG_DWORD_TYPE
Definition winutils.h:148
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.