Partially revert commit 30810893ad.

[SETUPAPI]
- Add 'pSetup'-Prefix to the string table functions according to the new naming convention.
- Remove the obsolete function StringTableTrim.
This commit is contained in:
Hermès Bélusca-Maïto 2023-09-13 16:55:54 +02:00
parent 5a17e99bdb
commit c19769b9bd
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -20,6 +20,24 @@
#include "setupapi_private.h" #include "setupapi_private.h"
#define _PSETUP(func) pSetup ## func
#define StringTableInitialize _PSETUP(StringTableInitialize)
#define StringTableInitializeEx _PSETUP(StringTableInitializeEx)
#define StringTableDestroy _PSETUP(StringTableDestroy)
#define StringTableAddString _PSETUP(StringTableAddString)
#define StringTableAddStringEx _PSETUP(StringTableAddStringEx)
#define StringTableDuplicate _PSETUP(StringTableDuplicate)
#define StringTableGetExtraData _PSETUP(StringTableGetExtraData)
#define StringTableLookUpString _PSETUP(StringTableLookUpString)
#define StringTableLookUpStringEx _PSETUP(StringTableLookUpStringEx)
#define StringTableSetExtraData _PSETUP(StringTableSetExtraData)
#define StringTableStringFromId _PSETUP(StringTableStringFromId)
#define StringTableStringFromIdEx _PSETUP(StringTableStringFromIdEx)
#define StringTableTrim _PSETUP(StringTableTrim)
#define TABLE_DEFAULT_SIZE 256 #define TABLE_DEFAULT_SIZE 256
typedef struct _TABLE_SLOT typedef struct _TABLE_SLOT
@ -39,7 +57,7 @@ typedef struct _STRING_TABLE
/************************************************************************** /**************************************************************************
* pSetupStringTableInitialize [SETUPAPI.@] * StringTableInitialize [SETUPAPI.@]
* *
* Creates a new string table and initializes it. * Creates a new string table and initializes it.
* *
@ -51,7 +69,7 @@ typedef struct _STRING_TABLE
* Failure: NULL * Failure: NULL
*/ */
HSTRING_TABLE WINAPI HSTRING_TABLE WINAPI
pSetupStringTableInitialize(VOID) StringTableInitialize(VOID)
{ {
PSTRING_TABLE pStringTable; PSTRING_TABLE pStringTable;
@ -84,9 +102,8 @@ pSetupStringTableInitialize(VOID)
return (HSTRING_TABLE)pStringTable; return (HSTRING_TABLE)pStringTable;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableInitializeEx [SETUPAPI.@] * StringTableInitializeEx [SETUPAPI.@]
* *
* Creates a new string table and initializes it. * Creates a new string table and initializes it.
* *
@ -99,7 +116,7 @@ pSetupStringTableInitialize(VOID)
* Failure: NULL * Failure: NULL
*/ */
HSTRING_TABLE WINAPI HSTRING_TABLE WINAPI
pSetupStringTableInitializeEx(DWORD dwMaxExtraDataSize, StringTableInitializeEx(DWORD dwMaxExtraDataSize,
DWORD dwReserved) DWORD dwReserved)
{ {
PSTRING_TABLE pStringTable; PSTRING_TABLE pStringTable;
@ -129,9 +146,8 @@ pSetupStringTableInitializeEx(DWORD dwMaxExtraDataSize,
return (HSTRING_TABLE)pStringTable; return (HSTRING_TABLE)pStringTable;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableDestroy [SETUPAPI.@] * StringTableDestroy [SETUPAPI.@]
* *
* Destroys a string table. * Destroys a string table.
* *
@ -142,7 +158,7 @@ pSetupStringTableInitializeEx(DWORD dwMaxExtraDataSize,
* None * None
*/ */
VOID WINAPI VOID WINAPI
pSetupStringTableDestroy(HSTRING_TABLE hStringTable) StringTableDestroy(HSTRING_TABLE hStringTable)
{ {
PSTRING_TABLE pStringTable; PSTRING_TABLE pStringTable;
DWORD i; DWORD i;
@ -171,9 +187,8 @@ pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
MyFree(pStringTable); MyFree(pStringTable);
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableAddString [SETUPAPI.@] * StringTableAddString [SETUPAPI.@]
* *
* Adds a new string to the string table. * Adds a new string to the string table.
* *
@ -193,7 +208,7 @@ pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
* this case. * this case.
*/ */
DWORD WINAPI DWORD WINAPI
pSetupStringTableAddString(HSTRING_TABLE hStringTable, StringTableAddString(HSTRING_TABLE hStringTable,
LPWSTR lpString, LPWSTR lpString,
DWORD dwFlags) DWORD dwFlags)
{ {
@ -248,7 +263,7 @@ pSetupStringTableAddString(HSTRING_TABLE hStringTable,
MyFree(pNewSlots); MyFree(pNewSlots);
pStringTable->dwMaxSlots = dwNewMaxSlots; pStringTable->dwMaxSlots = dwNewMaxSlots;
return pSetupStringTableAddString(hStringTable, lpString, dwFlags); return StringTableAddString(hStringTable, lpString, dwFlags);
} }
/* Search for an empty slot */ /* Search for an empty slot */
@ -276,9 +291,8 @@ pSetupStringTableAddString(HSTRING_TABLE hStringTable,
return (DWORD)-1; return (DWORD)-1;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableAddStringEx [SETUPAPI.@] * StringTableAddStringEx [SETUPAPI.@]
* *
* Adds a new string plus extra data to the string table. * Adds a new string plus extra data to the string table.
* *
@ -300,7 +314,7 @@ pSetupStringTableAddString(HSTRING_TABLE hStringTable,
* this case. * this case.
*/ */
DWORD WINAPI DWORD WINAPI
pSetupStringTableAddStringEx(HSTRING_TABLE hStringTable, StringTableAddStringEx(HSTRING_TABLE hStringTable,
LPWSTR lpString, LPWSTR lpString,
DWORD dwFlags, DWORD dwFlags,
LPVOID lpExtraData, LPVOID lpExtraData,
@ -386,9 +400,8 @@ pSetupStringTableAddStringEx(HSTRING_TABLE hStringTable,
return (DWORD)-1; return (DWORD)-1;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableDuplicate [SETUPAPI.@] * StringTableDuplicate [SETUPAPI.@]
* *
* Duplicates a given string table. * Duplicates a given string table.
* *
@ -401,7 +414,7 @@ pSetupStringTableAddStringEx(HSTRING_TABLE hStringTable,
* *
*/ */
HSTRING_TABLE WINAPI HSTRING_TABLE WINAPI
pSetupStringTableDuplicate(HSTRING_TABLE hStringTable) StringTableDuplicate(HSTRING_TABLE hStringTable)
{ {
PSTRING_TABLE pSourceTable; PSTRING_TABLE pSourceTable;
PSTRING_TABLE pDestinationTable; PSTRING_TABLE pDestinationTable;
@ -470,9 +483,8 @@ pSetupStringTableDuplicate(HSTRING_TABLE hStringTable)
return (HSTRING_TABLE)pDestinationTable; return (HSTRING_TABLE)pDestinationTable;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableGetExtraData [SETUPAPI.@] * StringTableGetExtraData [SETUPAPI.@]
* *
* Retrieves extra data from a given string table entry. * Retrieves extra data from a given string table entry.
* *
@ -487,7 +499,7 @@ pSetupStringTableDuplicate(HSTRING_TABLE hStringTable)
* Failure: FALSE * Failure: FALSE
*/ */
BOOL WINAPI BOOL WINAPI
pSetupStringTableGetExtraData(HSTRING_TABLE hStringTable, StringTableGetExtraData(HSTRING_TABLE hStringTable,
DWORD dwId, DWORD dwId,
LPVOID lpExtraData, LPVOID lpExtraData,
DWORD dwExtraDataSize) DWORD dwExtraDataSize)
@ -523,9 +535,8 @@ pSetupStringTableGetExtraData(HSTRING_TABLE hStringTable,
return TRUE; return TRUE;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableLookUpString [SETUPAPI.@] * StringTableLookUpString [SETUPAPI.@]
* *
* Searches a string table for a given string. * Searches a string table for a given string.
* *
@ -540,7 +551,7 @@ pSetupStringTableGetExtraData(HSTRING_TABLE hStringTable,
* Failure: -1 * Failure: -1
*/ */
DWORD WINAPI DWORD WINAPI
pSetupStringTableLookUpString(HSTRING_TABLE hStringTable, StringTableLookUpString(HSTRING_TABLE hStringTable,
LPWSTR lpString, LPWSTR lpString,
DWORD dwFlags) DWORD dwFlags)
{ {
@ -577,9 +588,8 @@ pSetupStringTableLookUpString(HSTRING_TABLE hStringTable,
return (DWORD)-1; return (DWORD)-1;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableLookUpStringEx [SETUPAPI.@] * StringTableLookUpStringEx [SETUPAPI.@]
* *
* Searches a string table and extra data for a given string. * Searches a string table and extra data for a given string.
* *
@ -596,7 +606,7 @@ pSetupStringTableLookUpString(HSTRING_TABLE hStringTable,
* Failure: -1 * Failure: -1
*/ */
DWORD WINAPI DWORD WINAPI
pSetupStringTableLookUpStringEx(HSTRING_TABLE hStringTable, StringTableLookUpStringEx(HSTRING_TABLE hStringTable,
LPWSTR lpString, LPWSTR lpString,
DWORD dwFlags, DWORD dwFlags,
LPVOID lpExtraData, LPVOID lpExtraData,
@ -643,9 +653,8 @@ pSetupStringTableLookUpStringEx(HSTRING_TABLE hStringTable,
return ~0u; return ~0u;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableSetExtraData [SETUPAPI.@] * StringTableSetExtraData [SETUPAPI.@]
* *
* Sets extra data for a given string table entry. * Sets extra data for a given string table entry.
* *
@ -660,7 +669,7 @@ pSetupStringTableLookUpStringEx(HSTRING_TABLE hStringTable,
* Failure: FALSE * Failure: FALSE
*/ */
BOOL WINAPI BOOL WINAPI
pSetupStringTableSetExtraData(HSTRING_TABLE hStringTable, StringTableSetExtraData(HSTRING_TABLE hStringTable,
DWORD dwId, DWORD dwId,
LPVOID lpExtraData, LPVOID lpExtraData,
DWORD dwExtraDataSize) DWORD dwExtraDataSize)
@ -704,9 +713,8 @@ pSetupStringTableSetExtraData(HSTRING_TABLE hStringTable,
return TRUE; return TRUE;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableStringFromId [SETUPAPI.@] * StringTableStringFromId [SETUPAPI.@]
* *
* Returns a pointer to a string for the given string ID. * Returns a pointer to a string for the given string ID.
* *
@ -719,7 +727,7 @@ pSetupStringTableSetExtraData(HSTRING_TABLE hStringTable,
* Failure: NULL * Failure: NULL
*/ */
LPWSTR WINAPI LPWSTR WINAPI
pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, StringTableStringFromId(HSTRING_TABLE hStringTable,
DWORD dwId) DWORD dwId)
{ {
PSTRING_TABLE pStringTable; PSTRING_TABLE pStringTable;
@ -740,9 +748,8 @@ pSetupStringTableStringFromId(HSTRING_TABLE hStringTable,
return pStringTable->pSlots[dwId - 1].pString; return pStringTable->pSlots[dwId - 1].pString;
} }
/************************************************************************** /**************************************************************************
* pSetupStringTableStringFromIdEx [SETUPAPI.@] * StringTableStringFromIdEx [SETUPAPI.@]
* *
* Returns a string for the given string ID. * Returns a string for the given string ID.
* *
@ -757,7 +764,7 @@ pSetupStringTableStringFromId(HSTRING_TABLE hStringTable,
* Failure: FALSE * Failure: FALSE
*/ */
BOOL WINAPI BOOL WINAPI
pSetupStringTableStringFromIdEx(HSTRING_TABLE hStringTable, StringTableStringFromIdEx(HSTRING_TABLE hStringTable,
DWORD dwId, DWORD dwId,
LPWSTR lpBuffer, LPWSTR lpBuffer,
LPDWORD lpBufferLength) LPDWORD lpBufferLength)
@ -795,3 +802,20 @@ pSetupStringTableStringFromIdEx(HSTRING_TABLE hStringTable,
return bResult; return bResult;
} }
/**************************************************************************
* StringTableTrim [SETUPAPI.@]
*
* ...
*
* PARAMS
* hStringTable [I] Handle to the string table
*
* RETURNS
* None
*/
VOID WINAPI
StringTableTrim(HSTRING_TABLE hStringTable)
{
FIXME("%p\n", hStringTable);
}