Commit 48d62fc6 authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Build with msvcrt.

parent d1e1efe0
......@@ -6,6 +6,8 @@ DELAYIMPORTS = ole32 oleaut32 shdocvw version comctl32 gdiplus
# AUTHORS file is in the top-level directory
EXTRAINCL = -I$(top_srcdir)
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
appbar.c \
assoc.c \
......
......@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......@@ -32,7 +30,6 @@
#include "winuser.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(appbar);
......
......@@ -30,7 +30,6 @@
#include "shobjidl.h"
#include "shell32_main.h"
#include "ver.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
......@@ -395,7 +394,7 @@ static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This,
if (pszCommand[0] == '"')
{
pszStart = pszCommand + 1;
pszEnd = strchrW(pszStart, '"');
pszEnd = wcschr(pszStart, '"');
if (pszEnd)
*pszEnd = 0;
*len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL);
......@@ -403,7 +402,7 @@ static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This,
else
{
pszStart = pszCommand;
for (pszEnd = pszStart; (pszEnd = strchrW(pszEnd, ' ')); pszEnd++)
for (pszEnd = pszStart; (pszEnd = wcschr(pszEnd, ' ')); pszEnd++)
{
WCHAR c = *pszEnd;
*pszEnd = 0;
......@@ -529,7 +528,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString(
hr = ASSOC_GetCommand(This, pszExtra, &command);
if (SUCCEEDED(hr))
{
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, command, strlenW(command) + 1);
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, command, lstrlenW(command) + 1);
heap_free(command);
}
return hr;
......@@ -553,7 +552,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString(
/* hKeyProgID is NULL or there is no default value, so fail */
return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION);
}
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, docName, strlenW(docName) + 1);
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, docName, lstrlenW(docName) + 1);
heap_free(docName);
return hr;
}
......@@ -593,12 +592,12 @@ static HRESULT WINAPI IQueryAssociations_fnGetString(
DWORD *langCodeDesc = (DWORD *)bufW;
for (i = 0; i < flen / sizeof(DWORD); i++)
{
sprintfW(fileDescW, fileDescFmtW, LOWORD(langCodeDesc[i]),
swprintf(fileDescW, ARRAY_SIZE(fileDescW), fileDescFmtW, LOWORD(langCodeDesc[i]),
HIWORD(langCodeDesc[i]));
if (VerQueryValueW(verinfoW, fileDescW, (LPVOID *)&bufW, &flen))
{
/* Does strlenW(bufW) == 0 mean we use the filename? */
len = strlenW(bufW) + 1;
/* Does lstrlenW(bufW) == 0 mean we use the filename? */
len = lstrlenW(bufW) + 1;
TRACE("found FileDescription: %s\n", debugstr_w(bufW));
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, bufW, len);
heap_free(verinfoW);
......@@ -610,7 +609,7 @@ get_friendly_name_fail:
PathRemoveExtensionW(path);
PathStripPathW(path);
TRACE("using filename: %s\n", debugstr_w(path));
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, path, strlenW(path) + 1);
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, path, lstrlenW(path) + 1);
heap_free(verinfoW);
return hr;
}
......@@ -631,7 +630,7 @@ get_friendly_name_fail:
{
ret = RegGetValueW(This->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL, contentType, &size);
if (ret == ERROR_SUCCESS)
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, contentType, strlenW(contentType) + 1);
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, contentType, lstrlenW(contentType) + 1);
else
hr = HRESULT_FROM_WIN32(ret);
heap_free(contentType);
......@@ -657,7 +656,7 @@ get_friendly_name_fail:
{
ret = RegGetValueW(This->hkeyProgID, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, icon, &size);
if (ret == ERROR_SUCCESS)
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, icon, strlenW(icon) + 1);
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, icon, lstrlenW(icon) + 1);
else
hr = HRESULT_FROM_WIN32(ret);
heap_free(icon);
......@@ -667,7 +666,7 @@ get_friendly_name_fail:
} else {
/* there is no DefaultIcon subkey or hkeyProgID is NULL, so return the default document icon */
if (This->hkeyProgID == NULL)
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, documentIcon, strlenW(documentIcon) + 1);
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, documentIcon, lstrlenW(documentIcon) + 1);
else
return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION);
}
......@@ -685,8 +684,8 @@ get_friendly_name_fail:
hr = CLSIDFromString(pszExtra, &clsid);
if (FAILED(hr)) return hr;
strcpyW(keypath, shellexW);
strcatW(keypath, pszExtra);
lstrcpyW(keypath, shellexW);
lstrcatW(keypath, pszExtra);
ret = RegOpenKeyExW(This->hkeySource, keypath, 0, KEY_READ, &hkey);
if (ret) return HRESULT_FROM_WIN32(ret);
......
......@@ -25,7 +25,6 @@
- implement ACO_RTLREADING style
- implement ACO_WORD_FILTER style
*/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
......@@ -48,8 +47,6 @@
#include "debughlp.h"
#include "shell32_main.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef struct
......@@ -116,7 +113,7 @@ static inline WCHAR *filter_protocol(WCHAR *str)
{
static const WCHAR http[] = {'h','t','t','p'};
if (!strncmpW(str, http, ARRAY_SIZE(http)))
if (!wcsncmp(str, http, ARRAY_SIZE(http)))
{
str += ARRAY_SIZE(http);
str += (*str == 's'); /* https */
......@@ -130,7 +127,7 @@ static inline WCHAR *filter_www(WCHAR *str)
{
static const WCHAR www[] = {'w','w','w','.'};
if (!strncmpW(str, www, ARRAY_SIZE(www)))
if (!wcsncmp(str, www, ARRAY_SIZE(www)))
return str + ARRAY_SIZE(www);
return NULL;
}
......@@ -147,7 +144,7 @@ static enum prefix_filtering get_text_prefix_filtering(const WCHAR *text)
UINT i;
for (i = 0; i < ARRAY_SIZE(buf) - 1 && text[i]; i++)
buf[i] = tolowerW(text[i]);
buf[i] = towlower(text[i]);
buf[i] = '\0';
if (filter_protocol(buf)) return prefix_filtering_none;
......@@ -176,25 +173,25 @@ static inline int sort_strs_cmpfn_impl(WCHAR *a, WCHAR *b, enum prefix_filtering
{
WCHAR *str1 = filter_str_prefix(a, pfx_filter);
WCHAR *str2 = filter_str_prefix(b, pfx_filter);
return strcmpiW(str1, str2);
return wcsicmp(str1, str2);
}
static int sort_strs_cmpfn_none(const void *a, const void *b)
static int __cdecl sort_strs_cmpfn_none(const void *a, const void *b)
{
return sort_strs_cmpfn_impl(*(WCHAR* const*)a, *(WCHAR* const*)b, prefix_filtering_none);
}
static int sort_strs_cmpfn_protocol(const void *a, const void *b)
static int __cdecl sort_strs_cmpfn_protocol(const void *a, const void *b)
{
return sort_strs_cmpfn_impl(*(WCHAR* const*)a, *(WCHAR* const*)b, prefix_filtering_protocol);
}
static int sort_strs_cmpfn_all(const void *a, const void *b)
static int __cdecl sort_strs_cmpfn_all(const void *a, const void *b)
{
return sort_strs_cmpfn_impl(*(WCHAR* const*)a, *(WCHAR* const*)b, prefix_filtering_all);
}
static int (*const sort_strs_cmpfn[])(const void*, const void*) =
static int (* __cdecl sort_strs_cmpfn[])(const void*, const void*) =
{
sort_strs_cmpfn_none,
sort_strs_cmpfn_protocol,
......@@ -259,7 +256,7 @@ static UINT find_matching_enum_str(IAutoCompleteImpl *ac, UINT start, WCHAR *tex
while (a < b)
{
UINT i = (a + b - 1) / 2;
int cmp = strncmpiW(text, filter_str_prefix(strs[i], pfx_filter), len);
int cmp = wcsnicmp(text, filter_str_prefix(strs[i], pfx_filter), len);
if (cmp == 0)
{
index = i;
......@@ -351,7 +348,7 @@ static BOOL draw_listbox_item(IAutoCompleteImpl *ac, DRAWITEMSTRUCT *info, UINT
str = ac->listbox_strs[info->itemID];
ExtTextOutW(hdc, info->rcItem.left + 1, info->rcItem.top,
ETO_OPAQUE | ETO_CLIPPED, &info->rcItem, str,
strlenW(str), NULL);
lstrlenW(str), NULL);
if (state & ODS_SELECTED)
{
......@@ -400,7 +397,7 @@ static BOOL select_item_with_return_key(IAutoCompleteImpl *ac, HWND hwnd)
if (sel >= 0)
{
text = ac->listbox_strs[sel];
set_text_and_selection(ac, hwnd, text, 0, strlenW(text));
set_text_and_selection(ac, hwnd, text, 0, lstrlenW(text));
hide_listbox(ac, hwndListBox, TRUE);
ac->no_fwd_char = '\r'; /* RETURN char */
return TRUE;
......@@ -457,7 +454,7 @@ static LRESULT change_selection(IAutoCompleteImpl *ac, HWND hwnd, UINT key)
SendMessageW(ac->hwndListBox, LB_SETCURSEL, sel, 0);
msg = (sel >= 0) ? ac->listbox_strs[sel] : ac->txtbackup;
len = strlenW(msg);
len = lstrlenW(msg);
set_text_and_selection(ac, hwnd, msg, len, len);
return 0;
......@@ -493,23 +490,23 @@ static BOOL aclist_expand(IAutoCompleteImpl *ac, WCHAR *txt)
if (!ac->enum_strs) old_txt = empty;
/* skip the shared prefix */
while ((c = tolowerW(txt[i])) == tolowerW(old_txt[i]))
while ((c = towlower(txt[i])) == towlower(old_txt[i]))
{
if (c == '\0') return FALSE;
i++;
}
/* they differ at this point, check for a delim further in txt */
for (last_delim = NULL, p = &txt[i]; (p = strpbrkW(p, delims)) != NULL; p++)
for (last_delim = NULL, p = &txt[i]; (p = wcspbrk(p, delims)) != NULL; p++)
last_delim = p;
if (last_delim) return do_aclist_expand(ac, txt, last_delim);
/* txt has no delim after i, check for a delim further in old_txt */
if (strpbrkW(&old_txt[i], delims))
if (wcspbrk(&old_txt[i], delims))
{
/* scan backwards to find the first delim before txt[i] (if any) */
while (i--)
if (strchrW(delims, txt[i]))
if (wcschr(delims, txt[i]))
return do_aclist_expand(ac, txt, &txt[i]);
/* Windows doesn't expand without a delim, but it does reset */
......@@ -532,7 +529,7 @@ static void autoappend_str(IAutoCompleteImpl *ac, WCHAR *text, UINT len, WCHAR *
/* The character capitalization can be different,
so merge text and str into a new string */
size = len + strlenW(&str[len]) + 1;
size = len + lstrlenW(&str[len]) + 1;
if ((tmp = heap_alloc(size * sizeof(*tmp))))
{
......@@ -694,7 +691,7 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT
if (!(text = heap_alloc((len + 1) * sizeof(WCHAR))))
return 0;
len = SendMessageW(hwnd, WM_GETTEXT, len + 1, (LPARAM)text);
sz = strlenW(ac->quickComplete) + 1 + len;
sz = lstrlenW(ac->quickComplete) + 1 + len;
if ((buf = heap_alloc(sz * sizeof(WCHAR))))
{
......@@ -860,7 +857,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
if (sel < 0)
return 0;
msg = This->listbox_strs[sel];
set_text_and_selection(This, This->hwndEdit, msg, 0, strlenW(msg));
set_text_and_selection(This, This->hwndEdit, msg, 0, lstrlenW(msg));
hide_listbox(This, hwnd, TRUE);
return 0;
}
......@@ -1091,7 +1088,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
UINT i;
/* pwszRegKeyPath contains the key as well as the value, so split it */
value = strrchrW(pwzsRegKeyPath, '\\');
value = wcsrchr(pwzsRegKeyPath, '\\');
len = value - pwzsRegKeyPath;
if (value && (key = heap_alloc((len+1) * sizeof(*key))) != NULL)
......@@ -1127,7 +1124,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
if (!This->quickComplete && pwszQuickComplete)
{
size_t len = strlenW(pwszQuickComplete)+1;
size_t len = lstrlenW(pwszQuickComplete)+1;
if ((This->quickComplete = heap_alloc(len * sizeof(WCHAR))) != NULL)
memcpy(This->quickComplete, pwszQuickComplete, len * sizeof(WCHAR));
}
......@@ -1242,7 +1239,7 @@ static HRESULT WINAPI IAutoCompleteDropDown_fnGetDropDownStatus(
if (sel >= 0)
{
WCHAR *str = This->listbox_strs[sel];
size_t size = (strlenW(str) + 1) * sizeof(*str);
size_t size = (lstrlenW(str) + 1) * sizeof(*str);
if (!(*ppwszString = CoTaskMemAlloc(size)))
return E_OUTOFMEMORY;
......
......@@ -592,11 +592,11 @@ static LRESULT BrsFolder_Treeview_Rename(browse_info *info, NMTVDISPINFOW *pnmtv
item_data = (LPTV_ITEMDATA)item.lParam;
SHGetPathFromIDListW(item_data->lpifq, old_path);
if(!(p = strrchrW(old_path, '\\')))
if(!(p = wcsrchr(old_path, '\\')))
return 0;
p = new_path+(p-old_path+1);
memcpy(new_path, old_path, (p-new_path)*sizeof(WCHAR));
strcpyW(p, pnmtv->item.pszText);
lstrcpyW(p, pnmtv->item.pszText);
if(!MoveFileW(old_path, new_path))
return 0;
......@@ -824,7 +824,7 @@ static HRESULT BrsFolder_NewFolder(browse_info *info)
goto cleanup;
}
len = strlenW(name);
len = lstrlenW(name);
if(len<MAX_PATH)
name[len++] = '\\';
hr = ISFHelper_GetUniqueName(sfhelper, &name[len], MAX_PATH-len);
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......@@ -43,7 +40,6 @@
#include "shresdef.h"
#include "shlwapi.h"
#include "pidl.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
......@@ -234,9 +230,9 @@ static BOOL HCR_RegGetDefaultIconW(HKEY hkey, LPWSTR szDest, DWORD len, int* pic
lstrcpynW(szDest, sTemp, len);
}
if (ParseFieldW (szDest, 2, sNum, 5))
*picon_idx = atoiW(sNum);
else
*picon_idx=0; /* sometimes the icon number is missing */
*picon_idx = wcstol(sNum, NULL, 10);
else
*picon_idx=0; /* sometimes the icon number is missing */
ParseFieldW (szDest, 1, szDest, len);
PathUnquoteSpacesW(szDest);
return TRUE;
......
......@@ -47,7 +47,6 @@
#include "shell32_main.h"
#include "shlwapi.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
......@@ -74,12 +73,12 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
SHGetPathFromIDListW(pidlRoot, wszRootPath);
PathAddBackslashW(wszRootPath);
rootlen = strlenW(wszRootPath);
rootlen = lstrlenW(wszRootPath);
for (i=0; i<cidl;i++)
{
_ILSimpleGetTextW(apidl[i], wszFileName, MAX_PATH);
size += (rootlen + strlenW(wszFileName) + 1) * sizeof(WCHAR);
size += (rootlen + lstrlenW(wszFileName) + 1) * sizeof(WCHAR);
}
size += sizeof(WCHAR);
......@@ -93,14 +92,14 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
pDropFiles->pFiles = offset * sizeof(WCHAR);
pDropFiles->fWide = TRUE;
strcpyW(wszFileName, wszRootPath);
lstrcpyW(wszFileName, wszRootPath);
for (i=0; i<cidl;i++)
{
_ILSimpleGetTextW(apidl[i], wszFileName + rootlen, MAX_PATH - rootlen);
strcpyW(((WCHAR*)pDropFiles)+offset, wszFileName);
offset += strlenW(wszFileName) + 1;
lstrcpyW(((WCHAR*)pDropFiles)+offset, wszFileName);
offset += lstrlenW(wszFileName) + 1;
}
((WCHAR*)pDropFiles)[offset] = 0;
......@@ -203,7 +202,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
if (!bSuccess)
return 0;
size = (strlenW(szTemp)+1) * sizeof(WCHAR);
size = (lstrlenW(szTemp)+1) * sizeof(WCHAR);
/* fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
......
......@@ -31,7 +31,6 @@
#include "winreg.h"
#include "wine/debug.h"
#include "cpl.h"
#include "wine/unicode.h"
#include "commctrl.h"
#define NO_SHLWAPI_REG
......@@ -680,7 +679,7 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
/* first add .cpl files in the system directory */
GetSystemDirectoryW( buffer, MAX_PATH );
p = buffer + strlenW(buffer);
p = buffer + lstrlenW(buffer);
*p++ = '\\';
lstrcpyW(p, wszAllCpl);
......@@ -732,7 +731,7 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
*end = '\0';
if (beg) {
if (*beg == '@') {
sp = atoiW(beg + 1);
sp = wcstol(beg + 1, NULL, 10);
} else if (*beg == '\0') {
sp = -1;
} else {
......@@ -780,7 +779,7 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
/* Now check if there had been a numerical value in the extra params */
if ((extraPmts) && (*extraPmts == '@') && (sp == -1)) {
sp = atoiW(extraPmts + 1);
sp = wcstol(extraPmts + 1, NULL, 10);
}
TRACE("cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp);
......
......@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......
......@@ -32,7 +32,6 @@
#include "shell32_main.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
......@@ -124,7 +123,7 @@ static inline HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic,
do
{
if ((finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
lstrcmpW(finddata.cFileName, dotW) && lstrcmpW(finddata.cFileName, dotdotW))
wcscmp(finddata.cFileName, dotW) && wcscmp(finddata.cFileName, dotdotW))
{
len += lstrlenW(finddata.cFileName) + 2;
groups_data = heap_realloc(groups_data, len * sizeof(WCHAR));
......@@ -173,7 +172,7 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
static WCHAR *last_group;
if (!strcmpiW(command, create_groupW))
if (!wcsicmp(command, create_groupW))
{
WCHAR *path;
......@@ -187,7 +186,7 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
heap_free(last_group);
last_group = path;
}
else if (!strcmpiW(command, delete_groupW))
else if (!wcsicmp(command, delete_groupW))
{
WCHAR *path, *path2;
SHFILEOPSTRUCTW shfos = {0};
......@@ -197,9 +196,9 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
path = get_programs_path(argv[0]);
path2 = heap_alloc((strlenW(path) + 2) * sizeof(*path));
strcpyW(path2, path);
path2[strlenW(path) + 1] = 0;
path2 = heap_alloc((lstrlenW(path) + 2) * sizeof(*path));
lstrcpyW(path2, path);
path2[lstrlenW(path) + 1] = 0;
shfos.wFunc = FO_DELETE;
shfos.pFrom = path2;
......@@ -212,7 +211,7 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
if (ret || shfos.fAnyOperationsAborted) return DDE_FNOTPROCESSED;
}
else if (!strcmpiW(command, show_groupW))
else if (!wcsicmp(command, show_groupW))
{
WCHAR *path;
......@@ -227,7 +226,7 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
heap_free(last_group);
last_group = path;
}
else if (!strcmpiW(command, add_itemW))
else if (!wcsicmp(command, add_itemW))
{
WCHAR *path, *name;
DWORD len;
......@@ -253,13 +252,13 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
heap_free(path);
if (argc >= 2) IShellLinkW_SetDescription(link, argv[1]);
if (argc >= 4) IShellLinkW_SetIconLocation(link, argv[2], atoiW(argv[3]));
if (argc >= 4) IShellLinkW_SetIconLocation(link, argv[2], wcstol(argv[3], NULL, 10));
if (argc >= 7) IShellLinkW_SetWorkingDirectory(link, argv[6]);
if (argc >= 8) IShellLinkW_SetHotkey(link, atoiW(argv[7]));
if (argc >= 8) IShellLinkW_SetHotkey(link, wcstol(argv[7], NULL, 10));
if (argc >= 9)
{
if (atoiW(argv[8]) == 0) IShellLinkW_SetShowCmd(link, SW_SHOWMINNOACTIVE);
else if (atoiW(argv[8]) == 1) IShellLinkW_SetShowCmd(link, SW_SHOWNORMAL);
if (wcstol(argv[8], NULL, 10) == 0) IShellLinkW_SetShowCmd(link, SW_SHOWMINNOACTIVE);
else if (wcstol(argv[8], NULL, 10) == 1) IShellLinkW_SetShowCmd(link, SW_SHOWNORMAL);
}
hres = IShellLinkW_QueryInterface(link, &IID_IPersistFile, (void **)&file);
......@@ -270,7 +269,7 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
}
if (argc >= 2)
{
name = heap_alloc((strlenW(last_group) + 1 + strlenW(argv[1]) + 5) * sizeof(*name));
name = heap_alloc((lstrlenW(last_group) + 1 + lstrlenW(argv[1]) + 5) * sizeof(*name));
lstrcpyW(name, last_group);
lstrcatW(name, slashW);
lstrcatW(name, argv[1]);
......@@ -280,10 +279,10 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
{
const WCHAR *filename = PathFindFileNameW(argv[0]);
int len = PathFindExtensionW(filename) - filename;
name = heap_alloc((strlenW(last_group) + 1 + len + 5) * sizeof(*name));
name = heap_alloc((lstrlenW(last_group) + 1 + len + 5) * sizeof(*name));
lstrcpyW(name, last_group);
lstrcatW(name, slashW);
lstrcpynW(name+strlenW(name), filename, len + 1);
lstrcpynW(name+lstrlenW(name), filename, len + 1);
lstrcatW(name, dotlnkW);
}
hres = IPersistFile_Save(file, name, TRUE);
......@@ -294,14 +293,14 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
if (FAILED(hres)) return DDE_FNOTPROCESSED;
}
else if (!strcmpiW(command, delete_itemW) || !strcmpiW(command, replace_itemW))
else if (!wcsicmp(command, delete_itemW) || !wcsicmp(command, replace_itemW))
{
WCHAR *name;
BOOL ret;
if (argc < 1) return DDE_FNOTPROCESSED;
name = heap_alloc((strlenW(last_group) + 1 + strlenW(argv[0]) + 5) * sizeof(*name));
name = heap_alloc((lstrlenW(last_group) + 1 + lstrlenW(argv[0]) + 5) * sizeof(*name));
lstrcpyW(name, last_group);
lstrcatW(name, slashW);
lstrcatW(name, argv[0]);
......@@ -313,7 +312,7 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
if (!ret) return DDE_FNOTPROCESSED;
}
else if (!strcmpiW(command, exit_progmanW))
else if (!wcsicmp(command, exit_progmanW))
{
/* do nothing */
}
......@@ -345,7 +344,7 @@ static DWORD parse_dde_command(HSZ hszTopic, WCHAR *command)
command++;
while (*command == ' ') command++;
if (!(p = strpbrkW(command, opcode_end))) goto error;
if (!(p = wcspbrk(command, opcode_end))) goto error;
opcode = strndupW(command, p - command);
......@@ -361,11 +360,11 @@ static DWORD parse_dde_command(HSZ hszTopic, WCHAR *command)
if (*command == '"')
{
command++;
if (!(p = strchrW(command, '"'))) goto error;
if (!(p = wcschr(command, '"'))) goto error;
}
else
{
if (!(p = strpbrkW(command, param_end))) goto error;
if (!(p = wcspbrk(command, param_end))) goto error;
while (p[-1] == ' ') p--;
}
......
......@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
......@@ -121,7 +118,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
WCHAR *dest, *result, *result_end=NULL;
static const WCHAR dotexeW[] = {'.','e','x','e',0};
result = heap_alloc(sizeof(WCHAR)*(strlenW(cmdline)+5));
result = heap_alloc(sizeof(WCHAR)*(lstrlenW(cmdline)+5));
src = cmdline;
dest = result;
......@@ -139,12 +136,12 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
else {
while (*src)
{
if (isspaceW(*src))
if (iswspace(*src))
{
*dest = 0;
if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result))
break;
strcatW(dest, dotexeW);
lstrcatW(dest, dotexeW);
if (INVALID_FILE_ATTRIBUTES != GetFileAttributesW(result))
break;
}
......@@ -267,7 +264,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER_EXE, filter_exe, 256);
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER_ALL, filter_all, 256);
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_CAPTION, szCaption, MAX_PATH);
snprintfW( filter, MAX_PATH, filterW, filter_exe, 0, 0, filter_all, 0, 0 );
swprintf( filter, MAX_PATH, filterW, filter_exe, 0, 0, filter_all, 0, 0 );
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAMEW);
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
......
......@@ -25,7 +25,6 @@
#define COBJMACROS
#include "wine/debug.h"
#include "wine/unicode.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
......@@ -77,9 +76,9 @@ BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags
if(!lpszPath || !lpszPath[0]) return FALSE;
strcpyW(szPath, lpszPath);
lstrcpyW(szPath, lpszPath);
PathAddBackslashW(szPath);
strcatW(szPath,stars);
lstrcatW(szPath,stars);
hFile = FindFirstFileW(szPath,&stffile);
if ( hFile != INVALID_HANDLE_VALUE )
......@@ -93,7 +92,7 @@ BOOL CreateFolderEnumList(IEnumIDListImpl *list, LPCWSTR lpszPath, DWORD dwFlags
{
if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
dwFlags & SHCONTF_FOLDERS &&
strcmpW(stffile.cFileName, dot) && strcmpW(stffile.cFileName, dotdot))
wcscmp(stffile.cFileName, dot) && wcscmp(stffile.cFileName, dotdot))
{
pidl = _ILCreateFromFindDataW(&stffile);
succeeded = succeeded && AddToEnumList(list, pidl);
......
......@@ -17,9 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
......@@ -148,7 +145,7 @@ static HRESULT getIconLocationForFolder(IExtractIconWImpl *This, UINT uFlags, LP
WCHAR wszIconIndex[10];
SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, iconIndex,
wszIconIndex, 10);
*piIndex = atoiW(wszIconIndex);
*piIndex = wcstol(wszIconIndex, NULL, 10);
}
else if (SHELL32_GetCustomFolderAttribute(This->pidl, shellClassInfo, clsid,
wszCLSIDValue, CHARS_IN_GUID) &&
......@@ -218,7 +215,7 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UIN
'%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','}',0 };
WCHAR xriid[50];
sprintfW(xriid, fmt,
swprintf(xriid, ARRAY_SIZE(xriid), fmt,
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]);
......
......@@ -18,15 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#define COBJMACROS
......@@ -103,7 +97,7 @@ static INT CALLBACK SIC_CompareEntries( LPVOID p1, LPVOID p2, LPARAM lparam)
(e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT))
return 1;
if (strcmpiW(e1->sSourceFile,e2->sSourceFile))
if (wcsicmp(e1->sSourceFile,e2->sSourceFile))
return 1;
return 0;
......@@ -129,7 +123,7 @@ HRESULT SIC_get_location( int list_idx, WCHAR *file, DWORD *size, int *res_idx )
if (dpa_idx != -1)
{
found = DPA_GetPtr( sic_hdpa, dpa_idx );
needed = (strlenW( found->sSourceFile ) + 1) * sizeof(WCHAR);
needed = (lstrlenW( found->sSourceFile ) + 1) * sizeof(WCHAR);
if (needed <= *size)
{
memcpy( file, found->sSourceFile, needed );
......@@ -311,8 +305,8 @@ static INT SIC_IconAppend (const WCHAR *sourcefile, INT src_index, HICON *hicons
entry = SHAlloc(sizeof(*entry));
GetFullPathNameW(sourcefile, MAX_PATH, path, NULL);
entry->sSourceFile = heap_alloc( (strlenW(path)+1)*sizeof(WCHAR) );
strcpyW( entry->sSourceFile, path );
entry->sSourceFile = heap_alloc( (lstrlenW(path)+1)*sizeof(WCHAR) );
lstrcpyW( entry->sSourceFile, path );
entry->dwSourceIndex = src_index;
entry->dwFlags = flags;
......@@ -422,7 +416,7 @@ static int get_shell_icon_size(void)
if (!RegQueryValueExW( key, ShellIconSize, NULL, &type, (BYTE *)buf, &size ) && type == REG_SZ)
{
if (size == sizeof(buf)) buf[size / sizeof(WCHAR) - 1] = 0;
value = atoiW( buf );
value = wcstol( buf, NULL, 10 );
}
RegCloseKey( key );
}
......@@ -579,7 +573,7 @@ INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags )
*/
static int SIC_LoadOverlayIcon(int icon_idx)
{
WCHAR buffer[1024], wszIdx[8];
WCHAR buffer[1024], wszIdx[12];
HKEY hKeyShellIcons;
LPCWSTR iconPath;
int iconIdx;
......@@ -598,12 +592,12 @@ static int SIC_LoadOverlayIcon(int icon_idx)
{
DWORD count = sizeof(buffer);
sprintfW(wszIdx, wszNumFmt, icon_idx);
swprintf(wszIdx, ARRAY_SIZE(wszIdx), wszNumFmt, icon_idx);
/* read icon path and index */
if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS)
{
LPWSTR p = strchrW(buffer, ',');
LPWSTR p = wcschr(buffer, ',');
if (!p)
{
......@@ -613,7 +607,7 @@ static int SIC_LoadOverlayIcon(int icon_idx)
}
*p++ = 0;
iconPath = buffer;
iconIdx = atoiW(p);
iconIdx = wcstol(p, NULL, 10);
}
RegCloseKey(hKeyShellIcons);
......
......@@ -22,9 +22,6 @@
*
*/
#include "config.h"
#include "wine/port.h"
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
......@@ -1783,7 +1780,7 @@ LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)
if (pszDest)
{
strcpy(pszDest, "x:\\");
pszDest[0]=toupperW(lpszNew[0]);
pszDest[0]=towupper(lpszNew[0]);
TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
}
}
......
......@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......@@ -51,7 +49,6 @@
#include "shfldr.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
......@@ -290,7 +287,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
else
{
if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
strcatW (psfi->szTypeName, szFolder);
lstrcatW (psfi->szTypeName, szFolder);
else
{
WCHAR sTemp[64];
......@@ -307,7 +304,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
if (sTemp[0])
{
lstrcpynW (psfi->szTypeName, sTemp, 64);
strcatW (psfi->szTypeName, szSpaceFile);
lstrcatW (psfi->szTypeName, szSpaceFile);
}
else
{
......@@ -361,12 +358,12 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &psfi->iIcon))
{
if (lstrcmpW(p1W, sTemp))
strcpyW(psfi->szDisplayName, sTemp);
if (wcscmp(p1W, sTemp))
lstrcpyW(psfi->szDisplayName, sTemp);
else
{
/* the icon is in the file */
strcpyW(psfi->szDisplayName, szFullPath);
lstrcpyW(psfi->szDisplayName, szFullPath);
}
}
else
......@@ -420,8 +417,8 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx))
{
if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */
strcpyW(sTemp, szFullPath);
if (!wcscmp(p1W,sTemp)) /* icon is in the file */
lstrcpyW(sTemp, szFullPath);
psfi->iIcon = SIC_GetIconIndex(sTemp, icon_idx, 0);
if (psfi->iIcon == -1)
......@@ -891,12 +888,12 @@ static void add_authors( HWND list )
MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, strW, sizeW );
strW[sizeW - 1] = 0;
start = strpbrkW( strW, eol ); /* skip the header line */
start = wcspbrk( strW, eol ); /* skip the header line */
while (start)
{
while (*start && strchrW( eol, *start )) start++;
while (*start && wcschr( eol, *start )) start++;
if (!*start) break;
end = strpbrkW( start, eol );
end = wcspbrk( start, eol );
if (end) *end++ = 0;
SendMessageW( list, LB_ADDSTRING, -1, (LPARAM)start );
start = end;
......@@ -928,7 +925,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
"wine_get_build_id");
SendDlgItemMessageW(hWnd, stc1, STM_SETICON,(WPARAM)info->hIcon, 0);
GetWindowTextW( hWnd, template, ARRAY_SIZE(template) );
sprintfW( buffer, template, info->szApp );
swprintf( buffer, ARRAY_SIZE(buffer), template, info->szApp );
SetWindowTextW( hWnd, buffer );
SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT1), info->szApp );
SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT2), info->szOtherStuff );
......@@ -937,7 +934,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
if (wine_get_build_id)
{
MultiByteToWideChar( CP_UTF8, 0, wine_get_build_id(), -1, version, ARRAY_SIZE(version) );
sprintfW( buffer, template, version );
swprintf( buffer, ARRAY_SIZE(buffer), template, version );
SetWindowTextW( GetDlgItem(hWnd, IDC_ABOUT_STATIC_TEXT3), buffer );
}
hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_LISTBOX);
......
......@@ -36,7 +36,6 @@
#include "shlobj.h"
#include "shellapi.h"
#include "wine/heap.h"
#include "wine/unicode.h"
#include "wine/list.h"
/*******************************************
......
......@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#define COBJMACROS
......
......@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdarg.h>
......
......@@ -309,15 +309,15 @@ BOOL run_winemenubuilder( const WCHAR *args )
void *redir;
GetSystemDirectoryW( app, MAX_PATH - ARRAY_SIZE(menubuilder) );
strcatW( app, menubuilder );
lstrcatW( app, menubuilder );
len = (strlenW( app ) + strlenW( args ) + 1) * sizeof(WCHAR);
len = (lstrlenW( app ) + lstrlenW( args ) + 1) * sizeof(WCHAR);
buffer = heap_alloc( len );
if( !buffer )
return FALSE;
strcpyW( buffer, app );
strcatW( buffer, args );
lstrcpyW( buffer, app );
lstrcatW( buffer, args );
TRACE("starting %s\n",debugstr_w(buffer));
......@@ -422,10 +422,10 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *f
return S_FALSE;
}
*filename = CoTaskMemAlloc((strlenW(This->filepath) + 1) * sizeof(WCHAR));
*filename = CoTaskMemAlloc((lstrlenW(This->filepath) + 1) * sizeof(WCHAR));
if (!*filename) return E_OUTOFMEMORY;
strcpyW(*filename, This->filepath);
lstrcpyW(*filename, This->filepath);
return S_OK;
}
......@@ -1946,7 +1946,7 @@ static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, const W
heap_free(This->sIcoPath);
if (path)
{
size_t len = (strlenW(path) + 1) * sizeof(WCHAR);
size_t len = (lstrlenW(path) + 1) * sizeof(WCHAR);
This->sIcoPath = heap_alloc(len);
if (!This->sIcoPath)
return E_OUTOFMEMORY;
......@@ -2027,7 +2027,7 @@ static LPWSTR ShellLink_GetAdvertisedArg(LPCWSTR str)
if( !str )
return NULL;
p = strchrW( str, ':' );
p = wcschr( str, ':' );
if( !p )
return NULL;
len = p - str;
......@@ -2059,7 +2059,7 @@ static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str)
str += 2;
/* there must be a colon straight after a guid */
p = strchrW( str, ':' );
p = wcschr( str, ':' );
if( !p )
return E_FAIL;
len = p - str;
......@@ -2083,7 +2083,7 @@ static HRESULT ShellLink_SetAdvertiseInfo(IShellLinkImpl *This, LPCWSTR str)
return E_FAIL;
/* skip to the next field */
str = strchrW( str, ':' );
str = wcschr( str, ':' );
if( !str )
return E_FAIL;
}
......@@ -2137,7 +2137,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
}
/* any other quote marks are invalid */
if (strchrW(pszFile, '"'))
if (wcschr(pszFile, '"'))
{
heap_free(unquoted);
return S_FALSE;
......@@ -2443,7 +2443,7 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
mii.cbSize = sizeof mii;
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.dwTypeData = szOpen;
mii.cch = strlenW( mii.dwTypeData );
mii.cch = lstrlenW( mii.dwTypeData );
mii.wID = idCmdFirst + id++;
mii.fState = MFS_DEFAULT | MFS_ENABLED;
mii.fType = MFT_STRING;
......
......@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
......@@ -42,7 +40,6 @@
#include "winerror.h"
#include "undocshell.h"
#include "wine/unicode.h"
#include "shell32_main.h"
#include "wine/debug.h"
......@@ -668,7 +665,7 @@ UINT WINAPI DragQueryFileW(
}
}
i = strlenW(lpwDrop);
i = lstrlenW(lpwDrop);
if ( !lpszwFile) goto end; /* needed buffer size */
lstrcpynW (lpszwFile, lpwDrop, lLength);
end:
......
......@@ -19,7 +19,6 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <string.h>
#include <stdarg.h>
......@@ -2012,7 +2011,7 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
if (GetFileAttributesW(pszLinkTo) == INVALID_FILE_ATTRIBUTES)
return FALSE;
basename = strrchrW(pszLinkTo, '\\');
basename = wcsrchr(pszLinkTo, '\\');
if (basename)
basename = basename+1;
else
......@@ -2022,13 +2021,13 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
if (!PathAddBackslashW(pszName))
return FALSE;
dst_basename = pszName + strlenW(pszName);
dst_basename = pszName + lstrlenW(pszName);
snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, lnkformat, basename);
swprintf(dst_basename, pszName + MAX_PATH - dst_basename, lnkformat, basename);
while (GetFileAttributesW(pszName) != INVALID_FILE_ATTRIBUTES)
{
snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, lnkformatnum, basename, i);
swprintf(dst_basename, pszName + MAX_PATH - dst_basename, lnkformatnum, basename, i);
i++;
}
......
......@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
......@@ -155,12 +153,8 @@ HRESULT WINAPI SHRegCloseKey (HKEY hkey)
*/
HRESULT WINAPI SHCreateSessionKey(REGSAM access, HKEY *hkey)
{
static const WCHAR session_format[] = {
'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'E','x','p','l','o','r','e','r','\\','S','e','s','s','i','o','n','I','n','f','o','\\','%','u',0};
DWORD session, ret;
WCHAR str[ARRAY_SIZE(session_format) + 16];
WCHAR str[ARRAY_SIZE(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SessionInfo\\") + 16];
if (hkey)
*hkey = NULL;
......@@ -171,7 +165,8 @@ HRESULT WINAPI SHCreateSessionKey(REGSAM access, HKEY *hkey)
if (!ProcessIdToSessionId(GetCurrentProcessId(), &session))
return E_INVALIDARG;
sprintfW(str, session_format, session);
swprintf(str, ARRAY_SIZE(str),
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SessionInfo\\%u", session);
TRACE("using session key %s\n", debugstr_w(str));
ret = RegCreateKeyExW(HKEY_CURRENT_USER, str, 0, NULL, REG_OPTION_VOLATILE, access, NULL, hkey, NULL);
......
......@@ -35,7 +35,6 @@
#include "shlwapi.h"
#include "shell32_main.h"
#include "undocshell.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
......@@ -155,8 +154,8 @@ static int StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
TRACE("(%p, %p %s)\n",
lpWideCharStr, lpWString, debugstr_w(lpWString));
strcpyW (lpWideCharStr, lpWString );
return strlenW(lpWideCharStr);
lstrcpyW (lpWideCharStr, lpWString );
return lstrlenW(lpWideCharStr);
}
BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
......
......@@ -74,7 +74,7 @@ static inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str)
'%','0','2','x','%','0','2','x','-',
'%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x',
'%','0','2','x','%','0','2','x','}',0 };
return sprintfW(str, fmtW,
return swprintf(str, CHARS_IN_GUID, fmtW,
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
......
......@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......@@ -189,7 +186,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
pidlTemp = _ILCreateMyComputer ();
szNext = lpszDisplayName;
}
else if (!strncmpW( lpszDisplayName, unix_root, 9 ))
else if (!wcsncmp( lpszDisplayName, unix_root, 9 ))
{
pidlTemp = _ILCreateGuid(PT_GUID, &CLSID_UnixDosFolder);
szNext = lpszDisplayName;
......@@ -303,7 +300,7 @@ static void add_shell_namespace_extensions(IEnumIDListImpl *list, HKEY root)
DWORD attributes, value_size = sizeof(attributes);
/* Check if extension is configured as nonenumerable */
sprintfW(clsidkeyW, clsidfmtW, guid);
swprintf(clsidkeyW, ARRAY_SIZE(clsidkeyW), clsidfmtW, guid);
RegGetValueW(HKEY_CLASSES_ROOT, clsidkeyW, attributesW, RRF_RT_REG_DWORD | RRF_ZEROONFAILURE,
NULL, &attributes, &value_size);
......@@ -603,7 +600,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
{
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
(GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING))
strcpyW(pszPath, This->sPathTarget);
lstrcpyW(pszPath, This->sPathTarget);
else
HCR_GetClassNameW(&CLSID_ShellDesktop, pszPath, MAX_PATH);
}
......
......@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......@@ -346,16 +343,16 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
lstrcpynW( szPath + len, lpszDisplayName + 1, MAX_PATH - len );
for (p = szPath + len; *p; p++) if (*p == '/') *p = '\\';
}
else if (!strncmpiW( lpszDisplayName, unix_root, 9 ))
else if (!wcsnicmp( lpszDisplayName, unix_root, 9 ))
{
lstrcpynW( szPath + len, lpszDisplayName + 9, MAX_PATH - len );
if ((p = strchrW( szPath + len, '\\' )))
if ((p = wcschr( szPath + len, '\\' )))
while (*p == '\\') *p++ = 0;
szNext = p;
}
/* Special case for the root folder. */
if (!strcmpiW( szPath, unix_root ))
if (!wcsicmp( szPath, unix_root ))
{
*ppidl = SHAlloc(sizeof(USHORT));
if (!*ppidl) return E_FAIL;
......@@ -371,7 +368,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) && fsbd)
{
find_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
strcpyW( find_data.cFileName, szPath + len );
lstrcpyW( find_data.cFileName, szPath + len );
pidlTemp = _ILCreateFromFindDataW( &find_data );
}
if (pidlTemp) /* try to analyse the next element */
......@@ -384,7 +381,7 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface,
{
if (FAILED( IFileSystemBindData_GetFindData( fsbd, &find_data )))
find_data.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
strcpyW( find_data.cFileName, szPath + len );
lstrcpyW( find_data.cFileName, szPath + len );
pidlTemp = _ILCreateFromFindDataW( &find_data );
}
else hr = _ILCreateFromPathW(szPath, &pidlTemp);
......@@ -623,7 +620,7 @@ static HRESULT SHELL32_CreateExtensionUIObject(IShellFolder2 *iface,
MultiByteToWideChar(CP_ACP, 0, extensionA, -1, extensionW, 20);
sprintfW(buf, formatW, extensionW, riid->Data1, riid->Data2, riid->Data3,
swprintf(buf, ARRAY_SIZE(buf), formatW, extensionW, riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7]);
......@@ -832,7 +829,7 @@ static void get_display_name( WCHAR dest[MAX_PATH], const WCHAR *path, LPCITEMID
lstrcpynW( dest, path, MAX_PATH );
/* try to get a better path than the \\?\unix one */
if (!strncmpiW( path, unix_root, 9 ))
if (!wcsnicmp( path, unix_root, 9 ))
{
if (!is_unix)
{
......@@ -964,7 +961,7 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface,
/* pidl has to contain a single non-empty SHITEMID */
if (_ILIsDesktop(pidl) || !_ILIsPidlSimple(pidl) || !_ILGetTextPointer(pidl)) return E_INVALIDARG;
if (strpbrkW( lpName, invalid_chars )) return HRESULT_FROM_WIN32(ERROR_CANCELLED);
if (wcspbrk( lpName, invalid_chars )) return HRESULT_FROM_WIN32(ERROR_CANCELLED);
/* build source path */
lstrcpynW(szSrc, This->sPathTarget, MAX_PATH);
......@@ -979,7 +976,7 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface,
if(!(dwFlags & SHGDN_FORPARSING) && SHELL_FS_HideExtension(szSrc)) {
WCHAR *ext = PathFindExtensionW(szSrc);
if(*ext != '\0') {
INT len = strlenW(szDest);
INT len = lstrlenW(szDest);
lstrcpynW(szDest + len, ext, MAX_PATH - len);
}
}
......@@ -1168,7 +1165,7 @@ next:
dwFetched) {
_ILSimpleGetTextW (pidl, wszText, MAX_PATH);
if (0 == lstrcmpiW (wszText, pwszName)) {
snprintfW (pwszName, uLen, wszFormat, wszNewFolder, i++);
swprintf (pwszName, uLen, wszFormat, wszNewFolder, i++);
if (i > 99) {
hr = E_FAIL;
break;
......@@ -1242,7 +1239,7 @@ ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCWSTR pwszName,
/* Cannot Create folder because of permissions */
LoadStringW (shell32_hInstance, IDS_CREATEFOLDER_DENIED, wszTempText, ARRAY_SIZE(wszTempText));
LoadStringW (shell32_hInstance, IDS_CREATEFOLDER_CAPTION, wszCaption, ARRAY_SIZE(wszCaption));
sprintfW (wszText, wszTempText, wszNewDir);
swprintf (wszText, ARRAY_SIZE(wszText), wszTempText, wszNewDir);
MessageBoxW (hwnd, wszText, wszCaption, MB_OK | MB_ICONEXCLAMATION);
}
......@@ -1500,12 +1497,12 @@ IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
else
{
static const WCHAR unix_root[] = {'\\','\\','?','\\','u','n','i','x','\\',0};
strcpyW( wszTemp, unix_root );
lstrcpyW( wszTemp, unix_root );
}
}
else SHGetPathFromIDListW( pidl, wszTemp );
if ((len = strlenW(wszTemp)))
if ((len = lstrlenW(wszTemp)))
{
This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR));
if (!This->sPathTarget) return E_OUTOFMEMORY;
......@@ -1581,14 +1578,14 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
if (ppfti->csidl != -1) {
if (SHGetSpecialFolderPathW (0, wszTemp, ppfti->csidl,
ppfti->csidl & CSIDL_FLAG_CREATE)) {
int len = strlenW(wszTemp);
int len = lstrlenW(wszTemp);
This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR));
if (!This->sPathTarget)
return E_OUTOFMEMORY;
memcpy(This->sPathTarget, wszTemp, (len + 1) * sizeof(WCHAR));
}
} else if (ppfti->szTargetParsingName[0]) {
int len = strlenW(ppfti->szTargetParsingName);
int len = lstrlenW(ppfti->szTargetParsingName);
This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR));
if (!This->sPathTarget)
return E_OUTOFMEMORY;
......@@ -1596,7 +1593,7 @@ IFSFldr_PersistFolder3_InitializeEx (IPersistFolder3 * iface,
(len + 1) * sizeof(WCHAR));
} else if (ppfti->pidlTargetFolder) {
if (SHGetPathFromIDListW(ppfti->pidlTargetFolder, wszTemp)) {
int len = strlenW(wszTemp);
int len = lstrlenW(wszTemp);
This->sPathTarget = SHAlloc((len + 1) * sizeof(WCHAR));
if (!This->sPathTarget)
return E_OUTOFMEMORY;
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......@@ -699,10 +696,10 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
GetVolumeInformationW (pszPath, wszDrive, ARRAY_SIZE(wszDrive) - 5, NULL, NULL,
NULL, NULL, 0);
strcatW (wszDrive, wszOpenBracket);
lstrcpynW (wszDrive + strlenW(wszDrive), pszPath, 3);
strcatW (wszDrive, wszCloseBracket);
strcpyW (pszPath, wszDrive);
lstrcatW (wszDrive, wszOpenBracket);
lstrcpynW (wszDrive + lstrlenW(wszDrive), pszPath, 3);
lstrcatW (wszDrive, wszCloseBracket);
lstrcpyW (pszPath, wszDrive);
}
}
else
......
......@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......@@ -40,7 +37,6 @@
#include "shell32_main.h"
#include "shresdef.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "debughlp.h"
#include "shfldr.h"
......@@ -196,8 +192,8 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * ifac
*ppidl = NULL;
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
len = strlenW(szElement);
if (len == ARRAY_SIZE(wszEntireNetwork) && !strncmpiW(szElement, wszEntireNetwork, ARRAY_SIZE(wszEntireNetwork)))
len = lstrlenW(szElement);
if (len == ARRAY_SIZE(wszEntireNetwork) && !wcsnicmp(szElement, wszEntireNetwork, ARRAY_SIZE(wszEntireNetwork)))
{
pidlTemp = _ILCreateEntireNetwork();
if (pidlTemp)
......
......@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#define COBJMACROS
#include <stdarg.h>
......
......@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
......
......@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
......
......@@ -331,9 +331,9 @@ static BOOL FileMenu_AppendItemW(
if (lpText != FM_SEPARATOR)
{
int len = strlenW (lpText);
int len = lstrlenW (lpText);
myItem = SHAlloc(sizeof(FMITEM) + len*sizeof(WCHAR));
strcpyW (myItem->szItemText, lpText);
lstrcpyW (myItem->szItemText, lpText);
myItem->cchItemText = len;
myItem->iIconIndex = icon;
myItem->hMenu = hMenu;
......
......@@ -36,9 +36,6 @@
* Release() ???
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -389,7 +389,7 @@ static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size)
for (i = 0; i < llen / sizeof(DWORD); i++)
{
sprintfW(fileDescW, fileDescFmtW, LOWORD(lang[i]), HIWORD(lang[i]));
swprintf(fileDescW, ARRAY_SIZE(fileDescW), fileDescFmtW, LOWORD(lang[i]), HIWORD(lang[i]));
if (VerQueryValueW(data, fileDescW, (LPVOID *)&desc, &dlen))
{
if (dlen > size - 1) dlen = size - 1;
......@@ -476,7 +476,7 @@ static void init_file_properties_dlg(HWND hwndDlg, struct file_properties_info *
SetDlgItemTextW(hwndDlg, IDC_FPROP_PROG_NAME, buffer2);
else
{
WCHAR *p = strrchrW(buffer, '\\');
WCHAR *p = wcsrchr(buffer, '\\');
SetDlgItemTextW(hwndDlg, IDC_FPROP_PROG_NAME, p ? ++p : buffer);
}
}
......@@ -538,22 +538,22 @@ static INT_PTR CALLBACK file_properties_proc(HWND hwndDlg, UINT uMsg, WPARAM wPa
/* Update filename if it was changed */
if (GetDlgItemTextW(hwndDlg, IDC_FPROP_PATH, newname, ARRAY_SIZE(newname)) &&
strcmpW(props->filename, newname) &&
strlenW(props->dir) + strlenW(newname) + 2 < ARRAY_SIZE(newpath))
wcscmp(props->filename, newname) &&
lstrlenW(props->dir) + lstrlenW(newname) + 2 < ARRAY_SIZE(newpath))
{
static const WCHAR slash[] = {'\\', 0};
strcpyW(newpath, props->dir);
strcatW(newpath, slash);
strcatW(newpath, newname);
lstrcpyW(newpath, props->dir);
lstrcatW(newpath, slash);
lstrcatW(newpath, newname);
if (!MoveFileW(props->path, newpath))
ERR("failed to move file %s to %s\n", debugstr_w(props->path), debugstr_w(newpath));
else
{
WCHAR *p;
strcpyW(props->path, newpath);
strcpyW(props->dir, newpath);
if ((p = strrchrW(props->dir, '\\')))
lstrcpyW(props->path, newpath);
lstrcpyW(props->dir, newpath);
if ((p = wcsrchr(props->dir, '\\')))
{
*p = 0;
props->filename = p + 1;
......@@ -619,8 +619,8 @@ static void init_file_properties_pages(IDataObject *dataobject, LPFNADDPROPSHEET
if (props->attrib == INVALID_FILE_ATTRIBUTES)
goto error;
strcpyW(props->dir, props->path);
if ((p = strrchrW(props->dir, '\\')))
lstrcpyW(props->dir, props->path);
if ((p = wcsrchr(props->dir, '\\')))
{
*p = 0;
props->filename = p + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment