/*1* Advpack private header2*3* Copyright 2006 James Hawkins4*5* This library is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* This library is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with this library; if not, write to the Free Software17* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA18*/1920#ifndef __ADVPACK_PRIVATE_H21#define __ADVPACK_PRIVATE_H2223HRESULT do_ocx_reg(HMODULE hocx, BOOL do_reg, const WCHAR *flags, const WCHAR *param);24LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted);25void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir);2627HRESULT launch_exe(LPCWSTR cmd, LPCWSTR dir, HANDLE *phEXE);2829static inline char *strdupWtoA(const WCHAR *str)30{31char *ret = NULL;3233if(str) {34size_t size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);35ret = malloc(size);36if(ret)37WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);38}3940return ret;41}4243#endif /* __ADVPACK_PRIVATE_H */444546