From 963c2e44ac4298eb23b9de015e954a7550b7394c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 18 Oct 2022 09:32:03 +0200 Subject: [PATCH] Update MsiFormatRecord() SAL Documentation says hInstall may be NULL "in which case only the record field parameters are processed and properties are not available for substitution." Signed-off-by: Simon Rozman --- include/WinStd/MSI.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/WinStd/MSI.h b/include/WinStd/MSI.h index 9e7aa053..66a38fec 100644 --- a/include/WinStd/MSI.h +++ b/include/WinStd/MSI.h @@ -134,7 +134,7 @@ static UINT MsiRecordGetStringW(_In_ MSIHANDLE hRecord, _In_ unsigned int iField /// @copydoc MsiFormatRecordW() template -static UINT MsiFormatRecordA(_In_ MSIHANDLE hInstall, _In_ MSIHANDLE hRecord, _Inout_ std::basic_string &sValue) +static UINT MsiFormatRecordA(_In_opt_ MSIHANDLE hInstall, _In_ MSIHANDLE hRecord, _Inout_ std::basic_string &sValue) { assert(0); // TODO: Test this code. @@ -166,7 +166,7 @@ static UINT MsiFormatRecordA(_In_ MSIHANDLE hInstall, _In_ MSIHANDLE hRecord, _I /// \sa [MsiFormatRecord function](https://msdn.microsoft.com/en-us/library/aa370109.aspx) /// template -static UINT MsiFormatRecordW(_In_ MSIHANDLE hInstall, _In_ MSIHANDLE hRecord, _Inout_ std::basic_string &sValue) +static UINT MsiFormatRecordW(_In_opt_ MSIHANDLE hInstall, _In_ MSIHANDLE hRecord, _Inout_ std::basic_string &sValue) { wchar_t szStackBuffer[WINSTD_STACK_BUFFER_BYTES/sizeof(wchar_t)]; DWORD dwSize = _countof(szStackBuffer);