On Sun, 2017-06-25 at 21:13 -0500, Zebediah Figura wrote:
> @@ -156,18 +158,12 @@ static const WCHAR szValidateProductID[] =
> static const WCHAR szWriteEnvironmentStrings[] =
> {'W','r','i','t','e','E','n','v','i','r','o','n','m','e','n','t','S','t','r','i','n','g','s',0};
>
> -static void ui_actionstart(MSIPACKAGE *package, LPCWSTR action)
> +static void ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
> {
> - static const WCHAR Query_t[] =
> - {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
> - '`','A','c','t','i','o', 'n','T','e','x','t','`',' ',
> - 'W','H','E','R','E', ' ','`','A','c','t','i','o','n','`',' ','=',
> - ' ','\'','%','s','\'',0};
> - MSIRECORD * row;
> -
> - row = MSI_QueryGetRecord( package->db, Query_t, action );
> - if (!row)
> - return;
> + MSIRECORD *row = MSI_CreateRecord(3);
> + MSI_RecordSetStringW(row, 1, action);
> + MSI_RecordSetStringW(row, 2, description);
> + MSI_RecordSetStringW(row, 3, template);
Please check the result of the MSI_CreateRecord call.
> @@ -175,28 +171,21 @@ static void ui_actionstart(MSIPACKAGE *package, LPCWSTR action)
> static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start,
> UINT rc)
> {
> - MSIRECORD * row;
> - static const WCHAR template_s[]=
> - {'A','c','t','i','o','n',' ','s','t','a','r','t',' ','%','s',':',' ',
> - '%','s', '.',0};
> - static const WCHAR template_e[]=
> - {'A','c','t','i','o','n',' ','e','n','d','e','d',' ','%','s',':',' ',
> - '%','s', '.',' ','R','e','t','u','r','n',' ','v','a','l','u','e',' ',
> - '%','i','.',0};
> + MSIRECORD *row;
> + WCHAR template[1024];
> static const WCHAR format[] =
> {'H','H','\'',':','\'','m','m','\'',':','\'','s','s',0};
> WCHAR message[1024];
> WCHAR timet[0x100];
>
> GetTimeFormatW(LOCALE_USER_DEFAULT, 0, NULL, format, timet, 0x100);
> - if (start)
> - sprintfW(message,template_s,timet,action);
> - else
> - sprintfW(message,template_e,timet,action,rc);
> -
> - row = MSI_CreateRecord(1);
> - MSI_RecordSetStringW(row,1,message);
> -
> + LoadStringW(msi_hInstance, start ? IDS_INFO_ACTIONSTART : IDS_INFO_ACTIONENDED, template, 1024);
> + sprintfW(message, template, timet);
> +
> + row = MSI_CreateRecord(2);
> + MSI_RecordSetStringW(row, 0, message);
> + MSI_RecordSetStringW(row, 1, action);
> + MSI_RecordSetInteger(row, 2, !rc);
Same here.