From d4b9ac46a0a474d6f2cd3514db7ef07e7a3e6178 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Mon, 16 Mar 2015 17:44:39 +0100 Subject: [PATCH] winemenubuilder: Avoid a couple of forward declarations. --- programs/winemenubuilder/winemenubuilder.c | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index d902e93b01e..2bdbdbf8f61 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -195,8 +195,6 @@ static char *xdg_config_dir; static char *xdg_data_dir; static char *xdg_desktop_dir; -static WCHAR* assoc_query(ASSOCSTR assocStr, LPCWSTR name, LPCWSTR extra); -static HRESULT open_icon(LPCWSTR filename, int index, BOOL bWait, IStream **ppStream); /* Utility routines */ static unsigned short crc16(const char* string) @@ -1004,6 +1002,28 @@ end: return hr; } +static WCHAR* assoc_query(ASSOCSTR assocStr, LPCWSTR name, LPCWSTR extra) +{ + HRESULT hr; + WCHAR *value = NULL; + DWORD size = 0; + hr = AssocQueryStringW(0, assocStr, name, extra, NULL, &size); + if (SUCCEEDED(hr)) + { + value = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR)); + if (value) + { + hr = AssocQueryStringW(0, assocStr, name, extra, value, &size); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, value); + value = NULL; + } + } + } + return value; +} + static HRESULT open_file_type_icon(LPCWSTR szFileName, IStream **ppStream) { static const WCHAR openW[] = {'o','p','e','n',0}; @@ -1939,28 +1959,6 @@ static HRESULT get_cmdline( IShellLinkW *sl, LPWSTR szPath, DWORD pathSize, return hr; } -static WCHAR* assoc_query(ASSOCSTR assocStr, LPCWSTR name, LPCWSTR extra) -{ - HRESULT hr; - WCHAR *value = NULL; - DWORD size = 0; - hr = AssocQueryStringW(0, assocStr, name, extra, NULL, &size); - if (SUCCEEDED(hr)) - { - value = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR)); - if (value) - { - hr = AssocQueryStringW(0, assocStr, name, extra, value, &size); - if (FAILED(hr)) - { - HeapFree(GetProcessHeap(), 0, value); - value = NULL; - } - } - } - return value; -} - static char *slashes_to_minuses(const char *string) { int i;