mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:52:57 +00:00
Added ncftp to rosapps
svn path=/trunk/; revision=2453
This commit is contained in:
parent
289a784eef
commit
86bda6b3d9
118 changed files with 38524 additions and 0 deletions
34
rosapps/net/ncftp/libncftp/util2.cpp
Normal file
34
rosapps/net/ncftp/libncftp/util2.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include "syshdrs.h"
|
||||
|
||||
#if defined(WIN32) || defined(_WINDOWS)
|
||||
|
||||
extern "C" void
|
||||
GetSpecialDir(char *dst, size_t size, int whichDir)
|
||||
{
|
||||
LPITEMIDLIST idl;
|
||||
LPMALLOC shl;
|
||||
char path[MAX_PATH + 1];
|
||||
HRESULT hResult;
|
||||
|
||||
memset(dst, 0, size);
|
||||
hResult = SHGetMalloc(&shl);
|
||||
if (SUCCEEDED(hResult)) {
|
||||
hResult = SHGetSpecialFolderLocation(
|
||||
NULL,
|
||||
CSIDL_PERSONAL,
|
||||
&idl
|
||||
);
|
||||
|
||||
if (SUCCEEDED(hResult)) {
|
||||
if(SHGetPathFromIDList(idl, path)) {
|
||||
(void) strncpy(dst, path, size - 1);
|
||||
dst[size - 1] = '\0';
|
||||
}
|
||||
shl->Free(idl);
|
||||
}
|
||||
shl->Release();
|
||||
}
|
||||
} // GetSpecialDir
|
||||
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue