]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
windows: Mark more local win32 helpers functions as static
authorPali Rohár <pali@kernel.org>
Sun, 30 Nov 2025 15:27:21 +0000 (16:27 +0100)
committerMartin Mareš <mj@ucw.cz>
Sun, 28 Dec 2025 20:49:06 +0000 (21:49 +0100)
After movement of win32_call_func_with_tcb_privilege() function from
i386-io-windows.h to win32-helpers.c done in 3.11.0, lot of win32 helpers
functions are not used outside of win32-helpers.c anymore. Mark them as
static and remove from win32-helpers.h header file.

lib/win32-helpers.c
lib/win32-helpers.h

index de52398bb5182f51cbf19a6c858d6cafdd299880..728eadfee27273adf588d214b51a35d4eb6ba0fd 100644 (file)
@@ -525,7 +525,7 @@ win32_change_error_mode(UINT new_mode, BOOL append)
  * not have permission to open its own current active access token) is evaluated
  * as thread does not have that privilege.
  */
-BOOL
+static BOOL
 win32_have_privilege(LUID luid_privilege)
 {
   PRIVILEGE_SET priv;
@@ -589,7 +589,7 @@ set_privilege(HANDLE token, LUID luid_privilege, BOOL enable)
  * used for reverting to this access token. It is set to NULL if the current
  * thread previously used primary process access token.
  */
-BOOL
+static BOOL
 win32_change_token(HANDLE new_token, HANDLE *old_token)
 {
   HANDLE current_token;
@@ -654,7 +654,7 @@ change_token_to_primary(HANDLE *old_token)
  * token is specified as NULL then revert to the primary process access token.
  * Use to revert after win32_change_token() or change_token_to_primary() call.
  */
-VOID
+static VOID
 win32_revert_to_token(HANDLE token)
 {
   /*
@@ -1238,7 +1238,7 @@ check_process_name(LPCWSTR image_name, DWORD image_name_byte_length, LPCSTR exe_
 }
 
 /* Open process handle with the query right specified by process exe file. */
-HANDLE
+static HANDLE
 win32_find_and_open_process_for_query(LPCSTR exe_file)
 {
   HMODULE ntdll;
@@ -1354,7 +1354,7 @@ try_grant_permissions_and_open_process_token(HANDLE process, DWORD rights)
  * Open primary access token of particular process handle with specified rights.
  * If permissions for specified rights are missing then try to grant them.
  */
-HANDLE
+static HANDLE
 win32_open_process_token_with_rights(HANDLE process, DWORD rights)
 {
   HANDLE old_token;
index ecd155b807c4c3ef7b06cca5bab5a7dd79a820e6..d5ff3fd9b40955481ccd490a8aba6bdb20edaa87 100644 (file)
@@ -6,11 +6,6 @@ BOOL win32_is_32bit_on_64bit_system(void);
 BOOL win32_is_32bit_on_win8_64bit_system(void);
 BOOL win32_is_not_native_process(USHORT *native_machine);
 UINT win32_change_error_mode(UINT new_mode, BOOL append);
-BOOL win32_have_privilege(LUID luid_privilege);
 BOOL win32_enable_privilege(LUID luid_privilege, HANDLE *revert_token, BOOL *revert_only_privilege);
 VOID win32_revert_privilege(LUID luid_privilege, HANDLE revert_token, BOOL revert_only_privilege);
-BOOL win32_change_token(HANDLE new_token, HANDLE *old_token);
-VOID win32_revert_to_token(HANDLE token);
-HANDLE win32_find_and_open_process_for_query(LPCSTR exe_file);
-HANDLE win32_open_process_token_with_rights(HANDLE process, DWORD rights);
 BOOL win32_call_func_with_tcb_privilege(BOOL (*function)(LPVOID), LPVOID argument);