OSDN Git Service

Fix bugs of text encoding routines.
[ffftp/ffftp.git] / mbswrapper.h
1 // mbswrapper.h
2 // Copyright (C) 2011 Suguru Kawamoto
3 // \83}\83\8b\83`\83o\83C\83g\95\8e\9a\83\8f\83C\83h\95\8e\9aAPI\83\89\83b\83p\81[
4
5 #ifndef __MBSWRAPPER_H__
6 #define __MBSWRAPPER_H__
7
8 #ifndef DO_NOT_REPLACE
9
10 #undef CreateFile
11 #define CreateFile CreateFileM
12 #undef MessageBox
13 #define MessageBox MessageBoxM
14 #undef FindFirstFile
15 #define FindFirstFile FindFirstFileM
16 #undef FindNextFile
17 #define FindNextFile FindNextFileM
18 #undef GetLogicalDriveStrings
19 #define GetLogicalDriveStrings GetLogicalDriveStringsM
20 #undef CreateWindowEx
21 #define CreateWindowEx CreateWindowExM
22 #undef SendMessage
23 #define SendMessage SendMessageM
24 #undef SendDlgItemMessage
25 #define SendDlgItemMessage SendDlgItemMessageM
26 #undef SetWindowText
27 #define SetWindowText SetWindowTextM
28 #undef DragQueryFile
29 #define DragQueryFile DragQueryFileM
30 #undef GetCurrentDirectory
31 #define GetCurrentDirectory GetCurrentDirectoryM
32 #undef SetCurrentDirectory
33 #define SetCurrentDirectory SetCurrentDirectoryM
34 #undef SetDllDirectory
35 #define SetDllDirectory SetDllDirectoryM
36 #undef GetFileAttributes
37 #define GetFileAttributes GetFileAttributesM
38 #undef GetModuleFileName
39 #define GetModuleFileName GetModuleFileNameM
40 #undef RegOpenKeyEx
41 #define RegOpenKeyEx RegOpenKeyExM
42 #undef RegCreateKeyEx
43 #define RegCreateKeyEx RegCreateKeyExM
44 #undef RegDeleteValue
45 #define RegDeleteValue RegDeleteValueM
46 #undef RegQueryValueEx
47 #define RegQueryValueEx RegQueryValueExM
48 #undef RegSetValueEx
49 #define RegSetValueEx RegSetValueExM
50 #undef TextOut
51 #define TextOut TextOutM
52 #undef GetTextExtentPoint32
53 #define GetTextExtentPoint32 GetTextExtentPoint32M
54 #undef PropertySheet
55 #define PropertySheet PropertySheetM
56 #undef GetOpenFileName
57 #define GetOpenFileName GetOpenFileNameM
58 #undef GetSaveFileName
59 #define GetSaveFileName GetSaveFileNameM
60 #undef HtmlHelp
61 #define HtmlHelp HtmlHelpM
62 #undef CreateProcess
63 #define CreateProcess CreateProcessM
64 #undef FindExecutable
65 #define FindExecutable FindExecutableM
66 #undef ShellExecute
67 #define ShellExecute ShellExecuteM
68 #undef SHBrowseForFolder
69 #define SHBrowseForFolder SHBrowseForFolderM
70 #undef SHGetPathFromIDList
71 #define SHGetPathFromIDList SHGetPathFromIDListM
72 #undef SHFileOperation
73 #define SHFileOperation SHFileOperationM
74 #undef AppendMenu
75 #define AppendMenu AppendMenuM
76 #undef GetMenuItemInfo
77 #define GetMenuItemInfo GetMenuItemInfoM
78 #undef CreateFontIndirect
79 #define CreateFontIndirect CreateFontIndirectM
80 #undef ChooseFont
81 #define ChooseFont ChooseFontM
82 #undef DialogBoxParam
83 #define DialogBoxParam DialogBoxParamM
84
85 #undef CreateWindow
86 #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)
87
88 #endif
89
90 int MtoW(LPWSTR pDst, int size, LPCSTR pSrc, int count);
91 int WtoM(LPSTR pDst, int size, LPCWSTR pSrc, int count);
92 int WtoA(LPSTR pDst, int size, LPCWSTR pSrc, int count);
93 int TerminateStringM(LPSTR lpString, int size);
94 int TerminateStringW(LPWSTR lpString, int size);
95 size_t GetMultiStringLengthM(LPCSTR lpString);
96 size_t GetMultiStringLengthW(LPCWSTR lpString);
97 char* AllocateStringM(int size);
98 wchar_t* AllocateStringW(int size);
99 char* AllocateStringA(int size);
100 wchar_t* DuplicateMtoW(LPCSTR lpString, int c);
101 wchar_t* DuplicateMtoWBuffer(LPCSTR lpString, int c, int size);
102 wchar_t* DuplicateMtoWMultiString(LPCSTR lpString);
103 wchar_t* DuplicateMtoWMultiStringBuffer(LPCSTR lpString, int size);
104 char* DuplicateWtoM(LPCWSTR lpString, int c);
105 char* DuplicateWtoA(LPCWSTR lpString, int c);
106 void FreeDuplicatedString(void* p);
107
108 #endif
109