OSDN Git Service

Fix bugs of simultaneous connection.
[ffftp/ffftp.git] / mbswrapper.h
index 50e1ae1..9d134e1 100644 (file)
-// mbswrapper.h
-// Copyright (C) 2011 Suguru Kawamoto
-// マルチバイト文字ワイド文字APIラッパー
-
-#ifndef __MBSWRAPPER_H__
-#define __MBSWRAPPER_H__
-
-#include <stdio.h>
-#include <windows.h>
-#include <shlobj.h>
-
-#ifndef DO_NOT_REPLACE
-
-#undef CreateFile
-#define CreateFile CreateFileM
-HANDLE CreateFileM(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
-#undef MessageBox
-#define MessageBox MessageBoxM
-int MessageBoxM(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);
-#undef FindFirstFile
-#define FindFirstFile FindFirstFileM
-HANDLE FindFirstFileM(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData);
-#undef FindNextFile
-#define FindNextFile FindNextFileM
-BOOL FindNextFileM(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData);
-#undef GetLogicalDriveStrings
-#define GetLogicalDriveStrings GetLogicalDriveStringsM
-DWORD GetLogicalDriveStringsM(DWORD nBufferLength, LPSTR lpBuffer);
-#undef RegisterClassEx
-#define RegisterClassEx RegisterClassExM
-ATOM RegisterClassExM(CONST WNDCLASSEXA * v0);
-#undef CreateWindowEx
-#define CreateWindowEx CreateWindowExM
-HWND CreateWindowExM(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
-#undef GetWindowLong
-#define GetWindowLong GetWindowLongM
-LONG GetWindowLongM(HWND hWnd, int nIndex);
-#undef SetWindowLong
-#define SetWindowLong SetWindowLongM
-LONG SetWindowLongM(HWND hWnd, int nIndex, LONG dwNewLong);
-#undef DefWindowProc
-#define DefWindowProc DefWindowProcM
-LRESULT DefWindowProcM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
-#undef CallWindowProc
-#define CallWindowProc CallWindowProcM
-LRESULT CallWindowProcM(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
-#undef SendMessage
-#define SendMessage SendMessageM
-LRESULT SendMessageM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
-#undef DefDlgProc
-#define DefDlgProc DefDlgProcM
-LRESULT DefDlgProcM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
-#undef SendDlgItemMessage
-#define SendDlgItemMessage SendDlgItemMessageM
-LRESULT SendDlgItemMessageM(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);
-#undef SetWindowText
-#define SetWindowText SetWindowTextM
-BOOL SetWindowTextM(HWND hWnd, LPCSTR lpString);
-#undef DragQueryFile
-#define DragQueryFile DragQueryFileM
-UINT DragQueryFileM(HDROP hDrop, UINT iFile, LPSTR lpszFile, UINT cch);
-#undef GetCurrentDirectory
-#define GetCurrentDirectory GetCurrentDirectoryM
-DWORD GetCurrentDirectoryM(DWORD nBufferLength, LPSTR lpBuffer);
-#undef SetCurrentDirectory
-#define SetCurrentDirectory SetCurrentDirectoryM
-BOOL SetCurrentDirectoryM(LPCSTR lpPathName);
-#undef SetDllDirectory
-#define SetDllDirectory SetDllDirectoryM
-BOOL SetDllDirectoryM(LPCSTR lpPathName);
-#undef GetTempPath
-#define GetTempPath GetTempPathM
-DWORD GetTempPathM(DWORD nBufferLength, LPSTR lpBuffer);
-#undef GetFileAttributes
-#define GetFileAttributes GetFileAttributesM
-DWORD GetFileAttributesM(LPCSTR lpFileName);
-#undef GetModuleFileName
-#define GetModuleFileName GetModuleFileNameM
-DWORD GetModuleFileNameM(HMODULE hModule, LPCH lpFilename, DWORD nSize);
-#undef RegOpenKeyEx
-#define RegOpenKeyEx RegOpenKeyExM
-LSTATUS RegOpenKeyExM(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);
-#undef RegCreateKeyEx
-#define RegCreateKeyEx RegCreateKeyExM
-LSTATUS RegCreateKeyExM(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, DWORD dwOptions, REGSAM samDesired, CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition);
-#undef RegDeleteValue
-#define RegDeleteValue RegDeleteValueM
-LSTATUS RegDeleteValueM(HKEY hKey, LPCSTR lpValueName);
-#undef RegQueryValueEx
-#define RegQueryValueEx RegQueryValueExM
-LSTATUS RegQueryValueExM(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
-#undef RegSetValueEx
-#define RegSetValueEx RegSetValueExM
-LSTATUS RegSetValueExM(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE* lpData, DWORD cbData);
-#undef TextOut
-#define TextOut TextOutM
-BOOL TextOutM(HDC hdc, int x, int y, LPCSTR lpString, int c);
-#undef GetTextExtentPoint32
-#define GetTextExtentPoint32 GetTextExtentPoint32M
-BOOL GetTextExtentPoint32M(HDC hdc, LPCSTR lpString, int c, LPSIZE psizl);
-#undef PropertySheet
-#define PropertySheet PropertySheetM
-INT_PTR PropertySheetM(LPCPROPSHEETHEADERA v0);
-#undef GetOpenFileName
-#define GetOpenFileName GetOpenFileNameM
-BOOL GetOpenFileNameM(LPOPENFILENAMEA v0);
-#undef GetSaveFileName
-#define GetSaveFileName GetSaveFileNameM
-BOOL GetSaveFileNameM(LPOPENFILENAMEA v0);
-#undef HtmlHelp
-#define HtmlHelp HtmlHelpM
-HWND HtmlHelpM(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData);
-#undef CreateProcess
-#define CreateProcess CreateProcessM
-BOOL CreateProcessM(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);
-#undef FindExecutable
-#define FindExecutable FindExecutableM
-HINSTANCE FindExecutableM(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult);
-#undef ShellExecute
-#define ShellExecute ShellExecuteM
-HINSTANCE ShellExecuteM(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);
-#undef SHBrowseForFolder
-#define SHBrowseForFolder SHBrowseForFolderM
-PIDLIST_ABSOLUTE SHBrowseForFolderM(LPBROWSEINFOA lpbi);
-#undef SHGetPathFromIDList
-#define SHGetPathFromIDList SHGetPathFromIDListM
-BOOL SHGetPathFromIDListM(PCIDLIST_ABSOLUTE pidl, LPSTR pszPath);
-#undef SHFileOperation
-#define SHFileOperation SHFileOperationM
-int SHFileOperationM(LPSHFILEOPSTRUCTA lpFileOp);
-#undef AppendMenu
-#define AppendMenu AppendMenuM
-BOOL AppendMenuM(HMENU hMenu, UINT uFlags, UINT_PTR uIDNewItem, LPCSTR lpNewItem);
-#undef GetMenuItemInfo
-#define GetMenuItemInfo GetMenuItemInfoM
-BOOL GetMenuItemInfoM(HMENU hmenu, UINT item, BOOL fByPosition, LPMENUITEMINFOA lpmii);
-#undef CreateFontIndirect
-#define CreateFontIndirect CreateFontIndirectM
-HFONT CreateFontIndirectM(CONST LOGFONTA *lplf);
-#undef ChooseFont
-#define ChooseFont ChooseFontM
-BOOL ChooseFontM(LPCHOOSEFONTA v0);
-#undef DialogBoxParam
-#define DialogBoxParam DialogBoxParamM
-INT_PTR DialogBoxParamM(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
-#undef CreateDialogParam
-#define CreateDialogParam CreateDialogParamM
-HWND CreateDialogParamM(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
-#undef mkdir
-#define mkdir _mkdirM
-int mkdirM(const char * _Path);
-#undef _mkdir
-#define _mkdir _mkdirM
-int _mkdirM(const char * _Path);
-#undef rmdir
-#define rmdir rmdirM
-int rmdirM(const char * _Path);
-#undef _rmdir
-#define _rmdir _rmdirM
-int _rmdirM(const char * _Path);
-#undef _mbslen
-#define _mbslen _mbslenM
-size_t _mbslenM(const unsigned char * _Str);
-#undef _mbschr
-#define _mbschr _mbschrM
-unsigned char * _mbschrM(const unsigned char * _Str, unsigned int _Ch);
-#undef _mbsrchr
-#define _mbsrchr _mbsrchrM
-unsigned char * _mbsrchrM(const unsigned char * _Str, unsigned int _Ch);
-#undef _mbsstr
-#define _mbsstr _mbsstrM
-unsigned char * _mbsstrM(const unsigned char * _Str, const unsigned char * _Substr);
-#undef _mbscmp
-#define _mbscmp _mbscmpM
-int _mbscmpM(const unsigned char * _Str1, const unsigned char * _Str2);
-#undef _mbsicmp
-#define _mbsicmp _mbsicmpM
-int _mbsicmpM(const unsigned char * _Str1, const unsigned char * _Str2);
-#undef _mbsncmp
-#define _mbsncmp _mbsncmpM
-int _mbsncmpM(const unsigned char * _Str1, const unsigned char * _Str2, size_t _MaxCount);
-#undef _mbslwr
-#define _mbslwr _mbslwrM
-unsigned char * _mbslwrM(unsigned char * _String);
-#undef _mbsupr
-#define _mbsupr _mbsuprM
-unsigned char * _mbsuprM(unsigned char * _String);
-#undef _mbsninc
-#define _mbsninc _mbsnincM
-unsigned char * _mbsnincM(const unsigned char * _Str, size_t _Count);
-#undef fopen
-#define fopen fopenM
-FILE * fopenM(const char * _Filename, const char * _Mode);
-
-#undef CreateWindow
-#define CreateWindow(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) CreateWindowEx(0L, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
-#undef DialogBox
-#define DialogBox(hInstance, lpTemplate, hWndParent, lpDialogFunc) DialogBoxParam(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
-
-#endif
-
-int MtoW(LPWSTR pDst, int size, LPCSTR pSrc, int count);
-int WtoM(LPSTR pDst, int size, LPCWSTR pSrc, int count);
-int WtoA(LPSTR pDst, int size, LPCWSTR pSrc, int count);
-int TerminateStringM(LPSTR lpString, int size);
-int TerminateStringW(LPWSTR lpString, int size);
-int TerminateStringA(LPWSTR lpString, int size);
-size_t GetMultiStringLengthM(LPCSTR lpString);
-size_t GetMultiStringLengthW(LPCWSTR lpString);
-size_t GetMultiStringLengthA(LPCWSTR lpString);
-int MtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc);
-int WtoMMultiString(LPSTR pDst, int size, LPCWSTR pSrc);
-int WtoAMultiString(LPSTR pDst, int size, LPCWSTR pSrc);
-char* AllocateStringM(int size);
-wchar_t* AllocateStringW(int size);
-char* AllocateStringA(int size);
-wchar_t* DuplicateMtoW(LPCSTR lpString, int c);
-wchar_t* DuplicateMtoWBuffer(LPCSTR lpString, int c, int size);
-wchar_t* DuplicateMtoWMultiString(LPCSTR lpString);
-wchar_t* DuplicateMtoWMultiStringBuffer(LPCSTR lpString, int size);
-char* DuplicateWtoM(LPCWSTR lpString, int c);
-char* DuplicateWtoA(LPCWSTR lpString, int c);
-void FreeDuplicatedString(void* p);
-
-#endif
-
+// mbswrapper.h\r
+// Copyright (C) 2011 Suguru Kawamoto\r
+// マルチバイト文字ワイド文字APIラッパー\r
+\r
+#ifndef __MBSWRAPPER_H__\r
+#define __MBSWRAPPER_H__\r
+\r
+#include <stdio.h>\r
+#include <windows.h>\r
+#include <shlobj.h>\r
+\r
+#ifndef DO_NOT_REPLACE\r
+\r
+#undef WinMain\r
+#define WinMain WinMainM\r
+int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow);\r
+#undef LoadLibrary\r
+#define LoadLibrary LoadLibraryM\r
+HMODULE LoadLibraryM(LPCSTR lpLibFileName);\r
+#undef CreateFile\r
+#define CreateFile CreateFileM\r
+HANDLE CreateFileM(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);\r
+#undef MessageBox\r
+#define MessageBox MessageBoxM\r
+int MessageBoxM(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);\r
+#undef FindFirstFile\r
+#define FindFirstFile FindFirstFileM\r
+HANDLE FindFirstFileM(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData);\r
+#undef FindNextFile\r
+#define FindNextFile FindNextFileM\r
+BOOL FindNextFileM(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData);\r
+#undef GetLogicalDriveStrings\r
+#define GetLogicalDriveStrings GetLogicalDriveStringsM\r
+DWORD GetLogicalDriveStringsM(DWORD nBufferLength, LPSTR lpBuffer);\r
+#undef RegisterClassEx\r
+#define RegisterClassEx RegisterClassExM\r
+ATOM RegisterClassExM(CONST WNDCLASSEXA * v0);\r
+#undef CreateWindowEx\r
+#define CreateWindowEx CreateWindowExM\r
+HWND CreateWindowExM(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);\r
+#undef GetWindowLong\r
+#define GetWindowLong GetWindowLongM\r
+LONG GetWindowLongM(HWND hWnd, int nIndex);\r
+#undef SetWindowLong\r
+#define SetWindowLong SetWindowLongM\r
+LONG SetWindowLongM(HWND hWnd, int nIndex, LONG dwNewLong);\r
+#undef GetWindowLongPtr\r
+#define GetWindowLongPtr GetWindowLongPtrM\r
+LONG_PTR GetWindowLongPtrM(HWND hWnd, int nIndex);\r
+#undef SetWindowLongPtr\r
+#define SetWindowLongPtr SetWindowLongPtrM\r
+LONG_PTR SetWindowLongPtrM(HWND hWnd, int nIndex, LONG_PTR dwNewLong);\r
+#undef DefWindowProc\r
+#define DefWindowProc DefWindowProcM\r
+LRESULT DefWindowProcM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\r
+#undef CallWindowProc\r
+#define CallWindowProc CallWindowProcM\r
+LRESULT CallWindowProcM(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\r
+#undef SendMessage\r
+#define SendMessage SendMessageM\r
+LRESULT SendMessageM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\r
+#undef DefDlgProc\r
+#define DefDlgProc DefDlgProcM\r
+LRESULT DefDlgProcM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\r
+#undef SendDlgItemMessage\r
+#define SendDlgItemMessage SendDlgItemMessageM\r
+LRESULT SendDlgItemMessageM(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);\r
+#undef SetWindowText\r
+#define SetWindowText SetWindowTextM\r
+BOOL SetWindowTextM(HWND hWnd, LPCSTR lpString);\r
+#undef DragQueryFile\r
+#define DragQueryFile DragQueryFileM\r
+UINT DragQueryFileM(HDROP hDrop, UINT iFile, LPSTR lpszFile, UINT cch);\r
+#undef GetCommandLine\r
+#define GetCommandLine GetCommandLineM\r
+LPSTR GetCommandLineM();\r
+#undef GetCurrentDirectory\r
+#define GetCurrentDirectory GetCurrentDirectoryM\r
+DWORD GetCurrentDirectoryM(DWORD nBufferLength, LPSTR lpBuffer);\r
+#undef SetCurrentDirectory\r
+#define SetCurrentDirectory SetCurrentDirectoryM\r
+BOOL SetCurrentDirectoryM(LPCSTR lpPathName);\r
+#undef GetTempPath\r
+#define GetTempPath GetTempPathM\r
+DWORD GetTempPathM(DWORD nBufferLength, LPSTR lpBuffer);\r
+#undef GetFileAttributes\r
+#define GetFileAttributes GetFileAttributesM\r
+DWORD GetFileAttributesM(LPCSTR lpFileName);\r
+#undef GetModuleFileName\r
+#define GetModuleFileName GetModuleFileNameM\r
+DWORD GetModuleFileNameM(HMODULE hModule, LPCH lpFilename, DWORD nSize);\r
+#undef RegOpenKeyEx\r
+#define RegOpenKeyEx RegOpenKeyExM\r
+LSTATUS RegOpenKeyExM(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);\r
+#undef RegCreateKeyEx\r
+#define RegCreateKeyEx RegCreateKeyExM\r
+LSTATUS RegCreateKeyExM(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, DWORD dwOptions, REGSAM samDesired, CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition);\r
+#undef RegDeleteValue\r
+#define RegDeleteValue RegDeleteValueM\r
+LSTATUS RegDeleteValueM(HKEY hKey, LPCSTR lpValueName);\r
+#undef RegQueryValueEx\r
+#define RegQueryValueEx RegQueryValueExM\r
+LSTATUS RegQueryValueExM(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);\r
+#undef RegSetValueEx\r
+#define RegSetValueEx RegSetValueExM\r
+LSTATUS RegSetValueExM(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE* lpData, DWORD cbData);\r
+#undef TextOut\r
+#define TextOut TextOutM\r
+BOOL TextOutM(HDC hdc, int x, int y, LPCSTR lpString, int c);\r
+#undef GetTextExtentPoint32\r
+#define GetTextExtentPoint32 GetTextExtentPoint32M\r
+BOOL GetTextExtentPoint32M(HDC hdc, LPCSTR lpString, int c, LPSIZE psizl);\r
+#undef PropertySheet\r
+#define PropertySheet PropertySheetM\r
+INT_PTR PropertySheetM(LPCPROPSHEETHEADERA v0);\r
+#undef GetOpenFileName\r
+#define GetOpenFileName GetOpenFileNameM\r
+BOOL GetOpenFileNameM(LPOPENFILENAMEA v0);\r
+#undef GetSaveFileName\r
+#define GetSaveFileName GetSaveFileNameM\r
+BOOL GetSaveFileNameM(LPOPENFILENAMEA v0);\r
+#undef HtmlHelp\r
+#define HtmlHelp HtmlHelpM\r
+HWND HtmlHelpM(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD_PTR dwData);\r
+#undef CreateProcess\r
+#define CreateProcess CreateProcessM\r
+BOOL CreateProcessM(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);\r
+#undef FindExecutable\r
+#define FindExecutable FindExecutableM\r
+HINSTANCE FindExecutableM(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult);\r
+#undef ShellExecute\r
+#define ShellExecute ShellExecuteM\r
+HINSTANCE ShellExecuteM(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);\r
+#undef ShellExecuteEx\r
+#define ShellExecuteEx ShellExecuteExM\r
+BOOL ShellExecuteExM(LPSHELLEXECUTEINFOA lpExecInfo);\r
+#undef SHBrowseForFolder\r
+#define SHBrowseForFolder SHBrowseForFolderM\r
+PIDLIST_ABSOLUTE SHBrowseForFolderM(LPBROWSEINFOA lpbi);\r
+#undef SHGetPathFromIDList\r
+#define SHGetPathFromIDList SHGetPathFromIDListM\r
+BOOL SHGetPathFromIDListM(PCIDLIST_ABSOLUTE pidl, LPSTR pszPath);\r
+#undef SHFileOperation\r
+#define SHFileOperation SHFileOperationM\r
+int SHFileOperationM(LPSHFILEOPSTRUCTA lpFileOp);\r
+#undef SHGetFileInfo\r
+#define SHGetFileInfo SHGetFileInfoM\r
+DWORD_PTR SHGetFileInfoM(LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA *psfi, UINT cbFileInfo, UINT uFlags);\r
+#undef AppendMenu\r
+#define AppendMenu AppendMenuM\r
+BOOL AppendMenuM(HMENU hMenu, UINT uFlags, UINT_PTR uIDNewItem, LPCSTR lpNewItem);\r
+#undef GetMenuItemInfo\r
+#define GetMenuItemInfo GetMenuItemInfoM\r
+BOOL GetMenuItemInfoM(HMENU hmenu, UINT item, BOOL fByPosition, LPMENUITEMINFOA lpmii);\r
+#undef CreateFontIndirect\r
+#define CreateFontIndirect CreateFontIndirectM\r
+HFONT CreateFontIndirectM(CONST LOGFONTA *lplf);\r
+#undef ChooseFont\r
+#define ChooseFont ChooseFontM\r
+BOOL ChooseFontM(LPCHOOSEFONTA v0);\r
+#undef DialogBoxParam\r
+#define DialogBoxParam DialogBoxParamM\r
+INT_PTR DialogBoxParamM(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);\r
+#undef CreateDialogParam\r
+#define CreateDialogParam CreateDialogParamM\r
+HWND CreateDialogParamM(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);\r
+#undef sndPlaySound\r
+#define sndPlaySound sndPlaySoundM\r
+BOOL sndPlaySoundM(LPCSTR pszSound, UINT fuSound);\r
+#undef SetClipboardData\r
+#define SetClipboardData SetClipboardDataM\r
+HANDLE SetClipboardDataM(UINT uFormat, HANDLE hMem);\r
+#undef CopyFile\r
+#define CopyFile CopyFileM\r
+BOOL CopyFileM(LPCSTR lpExistingFileName, LPCSTR lpNewFileName, BOOL bFailIfExists);\r
+#undef MoveFile\r
+#define MoveFile MoveFileM\r
+BOOL MoveFileM(LPCSTR lpExistingFileName, LPCSTR lpNewFileName);\r
+#undef mkdir\r
+#define mkdir _mkdirM\r
+int mkdirM(const char * _Path);\r
+#undef _mkdir\r
+#define _mkdir _mkdirM\r
+int _mkdirM(const char * _Path);\r
+#undef rmdir\r
+#define rmdir rmdirM\r
+int rmdirM(const char * _Path);\r
+#undef _rmdir\r
+#define _rmdir _rmdirM\r
+int _rmdirM(const char * _Path);\r
+#undef remove\r
+#define remove removeM\r
+int removeM(const char * _Filename);\r
+#undef _remove\r
+#define _remove _removeM\r
+int _removeM(const char * _Filename);\r
+#undef _unlink\r
+#define _unlink _unlinkM\r
+int _unlinkM(const char * _Filename);\r
+#undef _mbslen\r
+#define _mbslen _mbslenM\r
+size_t _mbslenM(const unsigned char * _Str);\r
+#undef _mbschr\r
+#define _mbschr _mbschrM\r
+unsigned char * _mbschrM(const unsigned char * _Str, unsigned int _Ch);\r
+#undef _mbsrchr\r
+#define _mbsrchr _mbsrchrM\r
+unsigned char * _mbsrchrM(const unsigned char * _Str, unsigned int _Ch);\r
+#undef _mbsstr\r
+#define _mbsstr _mbsstrM\r
+unsigned char * _mbsstrM(const unsigned char * _Str, const unsigned char * _Substr);\r
+#undef _mbscmp\r
+#define _mbscmp _mbscmpM\r
+int _mbscmpM(const unsigned char * _Str1, const unsigned char * _Str2);\r
+#undef _mbsicmp\r
+#define _mbsicmp _mbsicmpM\r
+int _mbsicmpM(const unsigned char * _Str1, const unsigned char * _Str2);\r
+#undef _mbsncmp\r
+#define _mbsncmp _mbsncmpM\r
+int _mbsncmpM(const unsigned char * _Str1, const unsigned char * _Str2, size_t _MaxCount);\r
+#undef _mbslwr\r
+#define _mbslwr _mbslwrM\r
+unsigned char * _mbslwrM(unsigned char * _String);\r
+#undef _mbsupr\r
+#define _mbsupr _mbsuprM\r
+unsigned char * _mbsuprM(unsigned char * _String);\r
+#undef _mbsninc\r
+#define _mbsninc _mbsnincM\r
+unsigned char * _mbsnincM(const unsigned char * _Str, size_t _Count);\r
+#undef fopen\r
+#define fopen fopenM\r
+FILE * fopenM(const char * _Filename, const char * _Mode);\r
+\r
+#undef CreateWindow\r
+#define CreateWindow(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) CreateWindowEx(0L, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\r
+#undef DialogBox\r
+#define DialogBox(hInstance, lpTemplate, hWndParent, lpDialogFunc) DialogBoxParam(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)\r
+\r
+#endif\r
+\r
+int MtoW(LPWSTR pDst, int size, LPCSTR pSrc, int count);\r
+int WtoM(LPSTR pDst, int size, LPCWSTR pSrc, int count);\r
+int AtoW(LPWSTR pDst, int size, LPCSTR pSrc, int count);\r
+int WtoA(LPSTR pDst, int size, LPCWSTR pSrc, int count);\r
+int TerminateStringM(LPSTR lpString, int size);\r
+int TerminateStringW(LPWSTR lpString, int size);\r
+int TerminateStringA(LPSTR lpString, int size);\r
+size_t GetMultiStringLengthM(LPCSTR lpString);\r
+size_t GetMultiStringLengthW(LPCWSTR lpString);\r
+size_t GetMultiStringLengthA(LPCSTR lpString);\r
+int MtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc);\r
+int WtoMMultiString(LPSTR pDst, int size, LPCWSTR pSrc);\r
+int AtoWMultiString(LPWSTR pDst, int size, LPCSTR pSrc);\r
+int WtoAMultiString(LPSTR pDst, int size, LPCWSTR pSrc);\r
+char* AllocateStringM(int size);\r
+wchar_t* AllocateStringW(int size);\r
+char* AllocateStringA(int size);\r
+wchar_t* DuplicateMtoW(LPCSTR lpString, int c);\r
+wchar_t* DuplicateMtoWBuffer(LPCSTR lpString, int c, int size);\r
+wchar_t* DuplicateMtoWMultiString(LPCSTR lpString);\r
+wchar_t* DuplicateMtoWMultiStringBuffer(LPCSTR lpString, int size);\r
+char* DuplicateWtoM(LPCWSTR lpString, int c);\r
+wchar_t* DuplicateAtoW(LPCSTR lpString, int c);\r
+char* DuplicateWtoA(LPCWSTR lpString, int c);\r
+DWORD GetNextCharM(LPCSTR lpString, LPCSTR* ppNext);\r
+BOOL FixStringM(LPSTR pDst, LPCSTR pSrc);\r
+BOOL FixMultiStringM(LPSTR pDst, LPCSTR pSrc);\r
+BOOL CheckStringM(LPCSTR lpString);\r
+BOOL CheckMultiStringM(LPCSTR lpString);\r
+void FreeDuplicatedString(void* p);\r
+\r
+int WINAPI WinMainM(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);\r
+\r
+#endif\r
+\r