[APPHELP] Fix MAX_GUID_STRING_LEN define; use it for one buffer (#7137)

This commit is contained in:
Hermès Bélusca-Maïto 2024-07-11 17:56:30 +02:00
parent 04f04efc96
commit b3094aa001
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -26,7 +26,8 @@ const UNICODE_STRING InstalledSDBKeyName = RTL_CONSTANT_STRING(L"\\Registry\\Mac
/* from dpfilter.h */
#define DPFLTR_APPCOMPAT_ID 123
#define MAX_GUID_STRING_LEN sizeof("{12345678-1234-1234-0123-456789abcdef}")
#define MAX_GUID_STRING_LEN RTL_NUMBER_OF("{12345678-1234-1234-0123-456789abcdef}")
C_ASSERT(MAX_GUID_STRING_LEN == 39); // See psdk/cfgmgr32.h
#ifndef NT_SUCCESS
#define NT_SUCCESS(StatCode) ((NTSTATUS)(StatCode) >= 0)
@ -405,7 +406,7 @@ BOOL WINAPI SdbRegisterDatabase(
*/
BOOL WINAPI SdbUnregisterDatabase(_In_ const GUID *pguidDB)
{
WCHAR KeyBuffer[MAX_PATH], GuidBuffer[50];
WCHAR KeyBuffer[MAX_PATH], GuidBuffer[MAX_GUID_STRING_LEN];
UNICODE_STRING KeyName;
ACCESS_MASK KeyAccess;
OBJECT_ATTRIBUTES ObjectKey = RTL_INIT_OBJECT_ATTRIBUTES(&KeyName, OBJ_CASE_INSENSITIVE);