summaryrefslogtreecommitdiff
path: root/plugins/HTTPServer
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/HTTPServer')
-rw-r--r--plugins/HTTPServer/src/GuiElements.cpp28
-rw-r--r--plugins/HTTPServer/src/IndexXML.cpp12
-rw-r--r--plugins/HTTPServer/src/main.cpp38
3 files changed, 40 insertions, 38 deletions
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp
index d58a86e83d..d79e8a8450 100644
--- a/plugins/HTTPServer/src/GuiElements.cpp
+++ b/plugins/HTTPServer/src/GuiElements.cpp
@@ -443,7 +443,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare)
ofn.lStructSize = sizeof(OPENFILENAME);
char temp[MAX_PATH];
- mir_snprintf(temp, _T("%s (*.*)%c*.*%c%c"), Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, "%s (*.*)%c*.*%c%c", Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrFile = pstNewShare->pszRealPath;
@@ -1122,24 +1122,24 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{// Url Address
SetDlgItemText(hwndDlg, IDC_URL_ADDRESS, sUrlAddress.c_str());
HWND hComboBox = GetDlgItem(hwndDlg, IDC_URL_ADDRESS);
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("http://checkip.dyndns.org"));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("http://checkip.dyndns.org:8245/"));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("http://dynamic.zoneedit.com/checkip.html"));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("http://ipdetect.dnspark.com/"));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("http://update.dynu.com/basic/ipcheck.asp"));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("http://www.dnsart.com/myip.php"));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("http://www.dnsart.com:7777/myip.php"));
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"http://checkip.dyndns.org");
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"http://checkip.dyndns.org:8245/");
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"http://dynamic.zoneedit.com/checkip.html");
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"http://ipdetect.dnspark.com/");
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"http://update.dynu.com/basic/ipcheck.asp");
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"http://www.dnsart.com/myip.php");
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"http://www.dnsart.com:7777/myip.php");
}
{// Page keyword
SetDlgItemText(hwndDlg, IDC_PAGE_KEYWORD, sPageKeyword.c_str());
HWND hComboBox = GetDlgItem(hwndDlg, IDC_PAGE_KEYWORD);
SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"");
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)LPGENT("Current IP Address: "));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)LPGENT("Current Address: "));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)LPGENT("IP Address: "));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)LPGENT("You are browsing from"));
- SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("<HTML><BODY>"));
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)LPGEN("Current IP Address: "));
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)LPGEN("Current Address: "));
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)LPGEN("IP Address: "));
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)LPGEN("You are browsing from"));
+ SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)"<HTML><BODY>");
}
SetDlgItemInt(hwndDlg, IDC_MAX_SPEED, nMaxUploadSpeed >> 10, true);
@@ -1492,7 +1492,7 @@ void InitGuiElements()
hEventOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
if (!hEventOptionsInitialize)
- MessageBox(NULL, _T("Failed to HookEvent ME_OPT_INITIALISE"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to HookEvent ME_OPT_INITIALISE", MSG_BOX_TITEL, MB_OK);
bShowPopups = db_get_b(NULL, MODULE, "ShowPopups", bShowPopups) != 0;
}
diff --git a/plugins/HTTPServer/src/IndexXML.cpp b/plugins/HTTPServer/src/IndexXML.cpp
index 04bc7edd8c..c258832321 100644
--- a/plugins/HTTPServer/src/IndexXML.cpp
+++ b/plugins/HTTPServer/src/IndexXML.cpp
@@ -17,13 +17,15 @@
#include "Glob.h"
-static const TCHAR szXmlHeader1[] = _T("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n")
-_T("<?xml-stylesheet type=\"text/xsl\" href=\"");
+static const char szXmlHeader1[] =
+ "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n"
+ "<?xml-stylesheet type=\"text/xsl\" href=\"";
-static const TCHAR szXmlHeader2[] = _T("\"?>\r\n")
-_T("<config>\r\n");
+static const char szXmlHeader2[] =
+ "\"?>\r\n"
+ "<config>\r\n";
-static const TCHAR szXmlTail[] = _T("</config>");
+static const char szXmlTail[] = "</config>";
static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace,
const char * pszNew)
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp
index 3490f07599..76f1ffe840 100644
--- a/plugins/HTTPServer/src/main.cpp
+++ b/plugins/HTTPServer/src/main.cpp
@@ -20,9 +20,9 @@
#define szConfigFile "HTTPServer.xml"
-const TCHAR szXmlHeader[] = _T("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n")
-_T("<?xml-stylesheet type=\"text/xsl\" href=\"HTTPServer.xsl\"?>\r\n")
-_T("<config>\r\n");
+const char szXmlHeader[] = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n"
+"<?xml-stylesheet type=\"text/xsl\" href=\"HTTPServer.xsl\"?>\r\n"
+"<config>\r\n";
const char szXmlData[] = "\t<share>\r\n"
"\t\t<name>%s</name>\r\n"
@@ -32,7 +32,7 @@ const char szXmlData[] = "\t<share>\r\n"
"\t\t<ip_mask>%d.%d.%d.%d</ip_mask>\r\n"
"\t</share>\r\n";
-const TCHAR szXmlTail[] = _T("</config>");
+const char szXmlTail[] = "</config>";
const char* pszDefaultShares[] = {
"htdocs\\@settings\\favicon.ico", "/favicon.ico",
@@ -342,7 +342,7 @@ bool bWriteConfigurationFile()
HANDLE hFile = CreateFile(szBuf, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
TCHAR temp[200];
- mir_sntprintf(temp, _T("%s%s"), TranslateT("Failed to open or create file "), _T(szConfigFile));
+ mir_sntprintf(temp, "%s%s", TranslateT("Failed to open or create file "), _T(szConfigFile));
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
return false;
}
@@ -350,11 +350,11 @@ bool bWriteConfigurationFile()
DWORD dwBytesWriten = 0;
if (!WriteFile(hFile, szXmlHeader, sizeof(szXmlHeader) - 1, &dwBytesWriten, NULL)) {
TCHAR temp[200];
- mir_sntprintf(temp, _T("%s%s"), TranslateT("Failed to write xml header to file "), _T(szConfigFile));
+ mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml header to file "), _T(szConfigFile));
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
}
else {
- CLFileShareNode * pclCur = pclFirstNode;
+ CLFileShareNode *pclCur = pclFirstNode;
while (pclCur) {
DWORD dwBytesToWrite = mir_snprintf(szBuf, szXmlData,
pclCur->st.pszSrvPath,
@@ -365,7 +365,7 @@ bool bWriteConfigurationFile()
if (!WriteFile(hFile, szBuf, dwBytesToWrite, &dwBytesWriten, NULL)) {
TCHAR temp[200];
- mir_sntprintf(temp, _T("%s%s"), TranslateT("Failed to write xml data to file "), _T(szConfigFile));
+ mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml data to file "), _T(szConfigFile));
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
break;
}
@@ -374,7 +374,7 @@ bool bWriteConfigurationFile()
if (!WriteFile(hFile, szXmlTail, sizeof(szXmlTail) - 1, &dwBytesWriten, NULL)) {
TCHAR temp[200];
- mir_sntprintf(temp, _T("%s%s"), TranslateT("Failed to write xml tail to file "), _T(szConfigFile));
+ mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml tail to file "), _T(szConfigFile));
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
}
}
@@ -751,7 +751,7 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/)
nlu.ptszDescriptiveName = TranslateT("HTTP Server");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)& nlu);
if (!hNetlibUser) {
- MessageBox(NULL, _T("Failed to register NetLib user"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to register NetLib user", MSG_BOX_TITEL, MB_OK);
return 0;
}
@@ -865,49 +865,49 @@ extern "C" __declspec(dllexport) int Load()
hHttpAcceptConnectionsService = CreateServiceFunction(MS_HTTP_ACCEPT_CONNECTIONS, nToggelAcceptConnections);
if (!hHttpAcceptConnectionsService) {
- MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_ACCEPT_CONNECTIONS"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to CreateServiceFunction MS_HTTP_ACCEPT_CONNECTIONS", MSG_BOX_TITEL, MB_OK);
return 1;
}
hHttpAddChangeRemoveService = CreateServiceFunction(MS_HTTP_ADD_CHANGE_REMOVE, nAddChangeRemoveShare);
if (!hHttpAddChangeRemoveService) {
- MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_ADD_CHANGE_REMOVE"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to CreateServiceFunction MS_HTTP_ADD_CHANGE_REMOVE", MSG_BOX_TITEL, MB_OK);
return 1;
}
hHttpGetShareService = CreateServiceFunction(MS_HTTP_GET_SHARE, nGetShare);
if (!hHttpGetShareService) {
- MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_GET_SHARE"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to CreateServiceFunction MS_HTTP_GET_SHARE", MSG_BOX_TITEL, MB_OK);
return 1;
}
hHttpGetAllShares = CreateServiceFunction(MS_HTTP_GET_ALL_SHARES, nHttpGetAllShares);
if (!hHttpGetAllShares) {
- MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_GET_ALL_SHARES"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to CreateServiceFunction MS_HTTP_GET_ALL_SHARES", MSG_BOX_TITEL, MB_OK);
return 1;
}
hEventSystemInit = HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
if (!hEventSystemInit) {
- MessageBox(NULL, _T("Failed to HookEvent ME_SYSTEM_MODULESLOADED"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to HookEvent ME_SYSTEM_MODULESLOADED", MSG_BOX_TITEL, MB_OK);
return 1;
}
hPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
if (!hPreShutdown) {
- MessageBox(NULL, _T("Failed to HookEvent ME_SYSTEM_PRESHUTDOWN"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to HookEvent ME_SYSTEM_PRESHUTDOWN", MSG_BOX_TITEL, MB_OK);
return 1;
}
if (CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szPluginPath)) {
- MessageBox(NULL, _T("Failed to retrieve plugin path."), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to retrieve plugin path.", MSG_BOX_TITEL, MB_OK);
return 1;
}
- mir_tstrncat(szPluginPath, _T("\\HTTPServer\\"), _countof(szPluginPath) - mir_tstrlen(szPluginPath));
+ mir_tstrncat(szPluginPath, "\\HTTPServer\\", _countof(szPluginPath) - mir_tstrlen(szPluginPath));
int err = CreateDirectoryTree(szPluginPath);
if ((err != 0) && (err != ERROR_ALREADY_EXISTS)) {
- MessageBox(NULL, _T("Failed to create HTTPServer directory."), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, "Failed to create HTTPServer directory.", MSG_BOX_TITEL, MB_OK);
return 1;
}