mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +00:00
import SHGetNewLinkInfoA/W from wine
svn path=/trunk/; revision=41308
This commit is contained in:
parent
02741d8961
commit
f30d5ea76f
3 changed files with 73 additions and 6 deletions
|
@ -38,9 +38,10 @@
|
||||||
#include "shlobj.h"
|
#include "shlobj.h"
|
||||||
#include "shellapi.h"
|
#include "shellapi.h"
|
||||||
#include "wine/windef16.h"
|
#include "wine/windef16.h"
|
||||||
|
*/
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
*/
|
|
||||||
/*******************************************
|
/*******************************************
|
||||||
* global SHELL32.DLL variables
|
* global SHELL32.DLL variables
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1972,20 +1972,72 @@ BOOL WINAPI SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR szObject, LPCWST
|
||||||
BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy,
|
BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy,
|
||||||
UINT uFlags)
|
UINT uFlags)
|
||||||
{
|
{
|
||||||
FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_a(pszLinkTo), debugstr_a(pszDir),
|
WCHAR wszLinkTo[MAX_PATH];
|
||||||
pszName, pfMustCopy, uFlags);
|
WCHAR wszDir[MAX_PATH];
|
||||||
|
WCHAR wszName[MAX_PATH];
|
||||||
|
BOOL res;
|
||||||
|
|
||||||
return FALSE;
|
MultiByteToWideChar(CP_ACP, 0, pszLinkTo, -1, wszLinkTo, MAX_PATH);
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, pszDir, -1, wszDir, MAX_PATH);
|
||||||
|
|
||||||
|
res = SHGetNewLinkInfoW(wszLinkTo, wszDir, wszName, pfMustCopy, uFlags);
|
||||||
|
|
||||||
|
if (res)
|
||||||
|
WideCharToMultiByte(CP_ACP, 0, wszName, -1, pszName, MAX_PATH, NULL, NULL);
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy,
|
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy,
|
||||||
UINT uFlags)
|
UINT uFlags)
|
||||||
{
|
{
|
||||||
FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
|
const WCHAR *basename;
|
||||||
|
WCHAR *dst_basename;
|
||||||
|
int i=2;
|
||||||
|
static const WCHAR lnkformat[] = {'%','s','.','l','n','k',0};
|
||||||
|
static const WCHAR lnkformatnum[] = {'%','s',' ','(','%','d',')','.','l','n','k',0};
|
||||||
|
|
||||||
|
TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
|
||||||
pszName, pfMustCopy, uFlags);
|
pszName, pfMustCopy, uFlags);
|
||||||
|
|
||||||
return FALSE;
|
*pfMustCopy = FALSE;
|
||||||
|
|
||||||
|
if (uFlags & SHGNLI_PIDL)
|
||||||
|
{
|
||||||
|
FIXME("SHGNLI_PIDL flag unsupported\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uFlags)
|
||||||
|
FIXME("ignoring flags: 0x%08x\n", uFlags);
|
||||||
|
|
||||||
|
/* FIXME: should test if the file is a shortcut or DOS program */
|
||||||
|
if (GetFileAttributesW(pszLinkTo) == INVALID_FILE_ATTRIBUTES)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
basename = strrchrW(pszLinkTo, '\\');
|
||||||
|
if (basename)
|
||||||
|
basename = basename+1;
|
||||||
|
else
|
||||||
|
basename = pszLinkTo;
|
||||||
|
|
||||||
|
lstrcpynW(pszName, pszDir, MAX_PATH);
|
||||||
|
if (!PathAddBackslashW(pszName))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
dst_basename = pszName + strlenW(pszName);
|
||||||
|
|
||||||
|
snprintfW(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);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHStartNetConnectionDialog (SHELL32.@)
|
* SHStartNetConnectionDialog (SHELL32.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -319,6 +319,18 @@ typedef struct _SHNAMEMAPPINGW {
|
||||||
#define SHERB_NOPROGRESSUI 0x2
|
#define SHERB_NOPROGRESSUI 0x2
|
||||||
#define SHERB_NOSOUND 0x4
|
#define SHERB_NOSOUND 0x4
|
||||||
|
|
||||||
|
/******************************************
|
||||||
|
* Links
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SHGNLI_PIDL 0x01
|
||||||
|
#define SHGNLI_PREFIXNAME 0x02
|
||||||
|
#define SHGNLI_NOUNIQUE 0x04
|
||||||
|
#define SHGNLI_NOLNK 0x08
|
||||||
|
|
||||||
|
BOOL WINAPI SHGetNewLinkInfoA(LPCSTR,LPCSTR,LPSTR,BOOL*,UINT);
|
||||||
|
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR,LPCWSTR,LPWSTR,BOOL*,UINT);
|
||||||
|
|
||||||
LPWSTR * WINAPI CommandLineToArgvW(LPCWSTR,int*);
|
LPWSTR * WINAPI CommandLineToArgvW(LPCWSTR,int*);
|
||||||
void WINAPI DragAcceptFiles(HWND,BOOL);
|
void WINAPI DragAcceptFiles(HWND,BOOL);
|
||||||
void WINAPI DragFinish(HDROP);
|
void WINAPI DragFinish(HDROP);
|
||||||
|
@ -379,6 +391,7 @@ typedef LPSHNAMEMAPPINGW LPSHNAMEMAPPING;
|
||||||
#define SHGetNewLinkInfo SHGetNewLinkInfoW
|
#define SHGetNewLinkInfo SHGetNewLinkInfoW
|
||||||
#define SHQueryRecycleBin SHQueryRecycleBinW
|
#define SHQueryRecycleBin SHQueryRecycleBinW
|
||||||
#define SHEmptyRecycleBin SHEmptyRecycleBinW
|
#define SHEmptyRecycleBin SHEmptyRecycleBinW
|
||||||
|
#define SHGetNewLinkInfo SHGetNewLinkInfoW
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAA_V1_SIZE
|
#define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAA_V1_SIZE
|
||||||
|
@ -404,6 +417,7 @@ typedef LPSHNAMEMAPPINGA LPSHNAMEMAPPING;
|
||||||
#define SHGetNewLinkInfo SHGetNewLinkInfoA
|
#define SHGetNewLinkInfo SHGetNewLinkInfoA
|
||||||
#define SHQueryRecycleBin SHQueryRecycleBinA
|
#define SHQueryRecycleBin SHQueryRecycleBinA
|
||||||
#define SHEmptyRecycleBin SHEmptyRecycleBinA
|
#define SHEmptyRecycleBin SHEmptyRecycleBinA
|
||||||
|
#define SHGetNewLinkInfo SHGetNewLinkInfoA
|
||||||
#endif
|
#endif
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue