本文整理汇总了C++中RTErrConvertFromWin32函数的典型用法代码示例。如果您正苦于以下问题:C++ RTErrConvertFromWin32函数的具体用法?C++ RTErrConvertFromWin32怎么用?C++ RTErrConvertFromWin32使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTErrConvertFromWin32函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DECLHIDDEN
/**
* Internal worker for RTFileRename and RTFileMove.
*
* @returns iprt status code.
* @param pszSrc The source filename.
* @param pszDst The destination filename.
* @param fFlags The windows MoveFileEx flags.
* @param fFileType The filetype. We use the RTFMODE filetypes here. If it's 0,
* anything goes. If it's RTFS_TYPE_DIRECTORY we'll check that the
* source is a directory. If Its RTFS_TYPE_FILE we'll check that it's
* not a directory (we are NOT checking whether it's a file).
*/
DECLHIDDEN(int) rtPathWin32MoveRename(const char *pszSrc, const char *pszDst, uint32_t fFlags, RTFMODE fFileType)
{
/*
* Convert the strings.
*/
PRTUTF16 pwszSrc;
int rc = RTStrToUtf16(pszSrc, &pwszSrc);
if (RT_SUCCESS(rc))
{
PRTUTF16 pwszDst;
rc = RTStrToUtf16(pszDst, &pwszDst);
if (RT_SUCCESS(rc))
{
/*
* Check object type if requested.
* This is open to race conditions.
*/
if (fFileType)
{
DWORD dwAttr = GetFileAttributesW(pwszSrc);
if (dwAttr == INVALID_FILE_ATTRIBUTES)
rc = RTErrConvertFromWin32(GetLastError());
else if (RTFS_IS_DIRECTORY(fFileType))
rc = dwAttr & FILE_ATTRIBUTE_DIRECTORY ? VINF_SUCCESS : VERR_NOT_A_DIRECTORY;
else
rc = dwAttr & FILE_ATTRIBUTE_DIRECTORY ? VERR_IS_A_DIRECTORY : VINF_SUCCESS;
}
if (RT_SUCCESS(rc))
{
if (MoveFileExW(pwszSrc, pwszDst, fFlags))
rc = VINF_SUCCESS;
else
{
DWORD Err = GetLastError();
rc = RTErrConvertFromWin32(Err);
Log(("MoveFileExW('%s', '%s', %#x, %RTfmode): fails with rc=%Rrc & lasterr=%d\n",
pszSrc, pszDst, fFlags, fFileType, rc, Err));
}
}
RTUtf16Free(pwszDst);
}
RTUtf16Free(pwszSrc);
}
return rc;
}
示例2: suplibOsCreateService
/**
* Creates the service.
*
* @returns VBox status code.
* @retval VWRN_ALREADY_EXISTS if it already exists.
*/
static int suplibOsCreateService(void)
{
/*
* Assume it didn't exist, so we'll create the service.
*/
int rc;
SC_HANDLE hSMgrCreate = OpenSCManager(NULL, NULL, SERVICE_CHANGE_CONFIG);
DWORD dwErr = GetLastError();
AssertMsg(hSMgrCreate, ("OpenSCManager(,,create) failed dwErr=%d\n", dwErr));
if (hSMgrCreate != NULL)
{
char szDriver[RTPATH_MAX];
rc = RTPathExecDir(szDriver, sizeof(szDriver) - sizeof("\\VBoxDrv.sys"));
if (RT_SUCCESS(rc))
{
strcat(szDriver, "\\VBoxDrv.sys");
SC_HANDLE hService = CreateService(hSMgrCreate,
SERVICE_NAME,
"VBox Support Driver",
SERVICE_QUERY_STATUS,
SERVICE_KERNEL_DRIVER,
SERVICE_DEMAND_START,
SERVICE_ERROR_NORMAL,
szDriver,
NULL, NULL, NULL, NULL, NULL);
dwErr = GetLastError();
if (hService)
{
CloseServiceHandle(hService);
rc = VINF_SUCCESS;
}
else if (dwErr == ERROR_SERVICE_EXISTS)
rc = VWRN_ALREADY_EXISTS;
else
{
AssertMsgFailed(("CreateService failed! dwErr=%Rwa szDriver=%s\n", dwErr, szDriver));
rc = RTErrConvertFromWin32(dwErr);
}
}
CloseServiceHandle(hSMgrCreate);
}
else
rc = RTErrConvertFromWin32(GetLastError());
return rc;
}
示例3: rtLocalIpcServerWinAllocSecurityDescriptior
/**
* Builds and allocates the security descriptor required for securing the local pipe.
*
* @return IPRT status code.
* @param ppDesc Where to store the allocated security descriptor on success.
* Must be free'd using LocalFree().
*/
static int rtLocalIpcServerWinAllocSecurityDescriptior(PSECURITY_DESCRIPTOR *ppDesc, bool fServer)
{
/** @todo Stuff this into RTInitOnce? Later. */
PFNCONVERTSTRINGSECURITYDESCRIPTORTOSECURITYDESCRIPTOR
pfnConvertStringSecurityDescriptorToSecurityDescriptor = NULL;
RTLDRMOD hAdvApi32 = NIL_RTLDRMOD;
int rc = RTLdrLoadSystem("Advapi32.dll", true /*fNoUnload*/, &hAdvApi32);
if (RT_SUCCESS(rc))
rc = RTLdrGetSymbol(hAdvApi32, "ConvertStringSecurityDescriptorToSecurityDescriptorW",
(void**)&pfnConvertStringSecurityDescriptorToSecurityDescriptor);
PSECURITY_DESCRIPTOR pSecDesc = NULL;
if (RT_SUCCESS(rc))
{
AssertPtr(pfnConvertStringSecurityDescriptorToSecurityDescriptor);
/*
* We'll create a security descriptor from a SDDL that denies
* access to network clients (this is local IPC after all), it
* makes some further restrictions to prevent non-authenticated
* users from screwing around.
*/
PRTUTF16 pwszSDDL;
rc = RTStrToUtf16(fServer
? RTLOCALIPC_WIN_SDDL_SERVER : RTLOCALIPC_WIN_SDDL_CLIENT, &pwszSDDL);
if (RT_SUCCESS(rc))
{
if (!pfnConvertStringSecurityDescriptorToSecurityDescriptor((LPCTSTR)pwszSDDL,
SDDL_REVISION_1,
&pSecDesc,
NULL))
{
rc = RTErrConvertFromWin32(GetLastError());
}
RTUtf16Free(pwszSDDL);
}
}
else
{
/* Windows OSes < W2K SP2 not supported for now, bail out. */
/** @todo Implement me! */
rc = VERR_NOT_SUPPORTED;
}
if (hAdvApi32 != NIL_RTLDRMOD)
RTLdrClose(hAdvApi32);
if (RT_SUCCESS(rc))
{
AssertPtr(pSecDesc);
*ppDesc = pSecDesc;
}
return rc;
}
示例4: usblibOsCreateService
/**
* Creates the service.
*
* @returns 0 on success.
* @returns < 0 on failure.
*/
int usblibOsCreateService(void)
{
/*
* Assume it didn't exist, so we'll create the service.
*/
SC_HANDLE hSMgrCreate = OpenSCManager(NULL, NULL, SERVICE_CHANGE_CONFIG);
DWORD dwLastError = GetLastError();
int rc = RTErrConvertFromWin32(dwLastError);
AssertMsg(hSMgrCreate, ("OpenSCManager(,,create) failed rc=%d\n", dwLastError));
if (hSMgrCreate)
{
char szDriver[RTPATH_MAX];
int rc = RTPathExecDir(szDriver, sizeof(szDriver) - sizeof("\\VBoxUSBMon.sys"));
if (RT_SUCCESS(rc))
{
strcat(szDriver, "\\VBoxUSBMon.sys");
RTPrintf("Creating USB monitor driver service with path %s ...\n", szDriver);
SC_HANDLE hService = CreateService(hSMgrCreate,
SERVICE_NAME,
"VBox USB Monitor Driver",
SERVICE_QUERY_STATUS,
SERVICE_KERNEL_DRIVER,
SERVICE_DEMAND_START,
SERVICE_ERROR_NORMAL,
szDriver,
NULL, NULL, NULL, NULL, NULL);
DWORD dwLastError = GetLastError();
if (dwLastError == ERROR_SERVICE_EXISTS)
{
RTPrintf("USB monitor driver service already exists, skipping creation.\n");
rc = usblibOsChangeService(szDriver);
}
else
{
AssertMsg(hService, ("CreateService failed! LastError=%Rwa, szDriver=%s\n", dwLastError, szDriver));
rc = RTErrConvertFromWin32(dwLastError);
if (hService != NULL)
CloseServiceHandle(hService);
}
}
CloseServiceHandle(hSMgrCreate);
}
return rc;
}
示例5: RTR3DECL
RTR3DECL(int) RTFileFlush(RTFILE hFile)
{
if (!FlushFileBuffers((HANDLE)RTFileToNative(hFile)))
{
int rc = GetLastError();
Log(("FlushFileBuffers failed with %d\n", rc));
return RTErrConvertFromWin32(rc);
}
return VINF_SUCCESS;
}
示例6: RTDECL
RTDECL(int) RTLocalIpcServerCreate(PRTLOCALIPCSERVER phServer, const char *pszName, uint32_t fFlags)
{
/*
* Basic parameter validation.
*/
AssertPtrReturn(phServer, VERR_INVALID_POINTER);
AssertPtrReturn(pszName, VERR_INVALID_POINTER);
AssertReturn(*pszName, VERR_INVALID_PARAMETER);
AssertReturn(!(fFlags & ~(RTLOCALIPC_FLAGS_VALID_MASK)), VERR_INVALID_PARAMETER);
AssertReturn((fFlags & RTLOCALIPC_FLAGS_MULTI_SESSION), VERR_INVALID_PARAMETER); /** @todo Implement !RTLOCALIPC_FLAGS_MULTI_SESSION */
/*
* Allocate and initialize the instance data.
*/
size_t cchName = strlen(pszName);
size_t cch = RT_OFFSETOF(RTLOCALIPCSERVERINT, szName[cchName + sizeof(RTLOCALIPC_WIN_PREFIX)]);
PRTLOCALIPCSERVERINT pThis = (PRTLOCALIPCSERVERINT)RTMemAlloc(cch);
if (!pThis)
return VERR_NO_MEMORY;
pThis->u32Magic = RTLOCALIPCSERVER_MAGIC;
pThis->cRefs = 1; /* the one we return */
pThis->fCancelled = false;
memcpy(pThis->szName, RTLOCALIPC_WIN_PREFIX, sizeof(RTLOCALIPC_WIN_PREFIX) - 1);
memcpy(&pThis->szName[sizeof(RTLOCALIPC_WIN_PREFIX) - 1], pszName, cchName + 1);
int rc = RTCritSectInit(&pThis->CritSect);
if (RT_SUCCESS(rc))
{
pThis->hEvent = CreateEvent(NULL /*lpEventAttributes*/, TRUE /*bManualReset*/,
FALSE /*bInitialState*/, NULL /*lpName*/);
if (pThis->hEvent != NULL)
{
RT_ZERO(pThis->OverlappedIO);
pThis->OverlappedIO.Internal = STATUS_PENDING;
pThis->OverlappedIO.hEvent = pThis->hEvent;
rc = rtLocalIpcServerWinCreatePipeInstance(&pThis->hNmPipe,
pThis->szName, true /* fFirst */);
if (RT_SUCCESS(rc))
{
*phServer = pThis;
return VINF_SUCCESS;
}
BOOL fRc = CloseHandle(pThis->hEvent);
AssertMsg(fRc, ("%d\n", GetLastError())); NOREF(fRc);
}
else
rc = RTErrConvertFromWin32(GetLastError());
int rc2 = RTCritSectDelete(&pThis->CritSect);
AssertRC(rc2);
}
RTMemFree(pThis);
return rc;
}
示例7: RTDECL
RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem, uint32_t fFlags, RTLOCKVALCLASS hClass, const char *pszNameFmt, ...)
{
AssertReturn(!(fFlags & ~(RTSEMEVENT_FLAGS_NO_LOCK_VAL | RTSEMEVENT_FLAGS_BOOTSTRAP_HACK)), VERR_INVALID_PARAMETER);
Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL));
struct RTSEMEVENTINTERNAL *pThis;
if (!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK))
pThis = (struct RTSEMEVENTINTERNAL *)RTMemAlloc(sizeof(*pThis));
else
pThis = (struct RTSEMEVENTINTERNAL *)rtMemBaseAlloc(sizeof(*pThis));
if (!pThis)
return VERR_NO_MEMORY;
/*
* Create the semaphore.
* (Auto reset, not signaled, private event object.)
*/
pThis->hev = CreateEvent(NULL, FALSE, FALSE, NULL);
if (pThis->hev != NULL) /* not INVALID_HANDLE_VALUE */
{
pThis->u32Magic = RTSEMEVENT_MAGIC;
pThis->fFlags = fFlags;
#ifdef RTSEMEVENT_STRICT
if (!pszNameFmt)
{
static uint32_t volatile s_iSemEventAnon = 0;
RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL),
"RTSemEvent-%u", ASMAtomicIncU32(&s_iSemEventAnon) - 1);
}
else
{
va_list va;
va_start(va, pszNameFmt);
RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL),
pszNameFmt, va);
va_end(va);
}
pThis->fEverHadSignallers = false;
#else
RT_NOREF_PV(hClass); RT_NOREF_PV(pszNameFmt);
#endif
*phEventSem = pThis;
return VINF_SUCCESS;
}
DWORD dwErr = GetLastError();
if (!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK))
RTMemFree(pThis);
else
rtMemBaseFree(pThis);
return RTErrConvertFromWin32(dwErr);
}
示例8: vboxClipboardChanged
static int vboxClipboardChanged(PVBOXCLIPBOARDCONTEXT pCtx)
{
AssertPtr(pCtx);
/* Query list of available formats and report to host. */
int rc = VINF_SUCCESS;
if (FALSE == OpenClipboard(pCtx->hwnd))
{
rc = RTErrConvertFromWin32(GetLastError());
}
else
{
uint32_t u32Formats = 0;
UINT format = 0;
while ((format = EnumClipboardFormats(format)) != 0)
{
LogFlowFunc(("vboxClipboardChanged: format = 0x%08X\n", format));
switch (format)
{
case CF_UNICODETEXT:
case CF_TEXT:
u32Formats |= VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT;
break;
case CF_DIB:
case CF_BITMAP:
u32Formats |= VBOX_SHARED_CLIPBOARD_FMT_BITMAP;
break;
default:
{
if (format >= 0xC000)
{
TCHAR szFormatName[256];
int cActual = GetClipboardFormatName(format, szFormatName, sizeof(szFormatName)/sizeof (TCHAR));
if (cActual)
{
if (strcmp (szFormatName, "HTML Format") == 0)
{
u32Formats |= VBOX_SHARED_CLIPBOARD_FMT_HTML;
}
}
}
break;
}
}
}
CloseClipboard();
rc = VbglR3ClipboardReportFormats(pCtx->u32ClientID, u32Formats);
}
return rc;
}
示例9: suplibOsDeleteService
/**
* Deletes the service.
*
* @returns VBox status code.
*/
int suplibOsDeleteService(void)
{
/*
* Assume it didn't exist, so we'll create the service.
*/
int rc;
SC_HANDLE hSMgr = OpenSCManager(NULL, NULL, SERVICE_CHANGE_CONFIG);
DWORD dwErr = GetLastError();
AssertMsg(hSMgr, ("OpenSCManager(,,delete) failed rc=%d\n", dwErr));
if (hSMgr)
{
SC_HANDLE hService = OpenService(hSMgr, SERVICE_NAME, DELETE);
if (hService)
{
/*
* Delete the service.
*/
if (DeleteService(hService))
rc = VINF_SUCCESS;
else
{
dwErr = GetLastError();
AssertMsgFailed(("DeleteService failed dwErr=%Rwa\n", dwErr));
rc = RTErrConvertFromWin32(dwErr);
}
CloseServiceHandle(hService);
}
else
{
dwErr = GetLastError();
if (dwErr == ERROR_SERVICE_DOES_NOT_EXIST)
rc = VINF_SUCCESS;
else
{
AssertMsgFailed(("OpenService failed dwErr=%Rwa\n", dwErr));
rc = RTErrConvertFromWin32(dwErr);
}
}
CloseServiceHandle(hSMgr);
}
return rc;
}
示例10: vgsvcWinStart
static int vgsvcWinStart(void)
{
int rc = VINF_SUCCESS;
/*
* Create a well-known SID for the "Builtin Users" group and modify the ACE
* for the shared folders miniport redirector DN (whatever DN means).
*/
PSID pBuiltinUsersSID = NULL;
SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_LOCAL_SID_AUTHORITY;
if (AllocateAndInitializeSid(&SIDAuthWorld, 1, SECURITY_LOCAL_RID, 0, 0, 0, 0, 0, 0, 0, &pBuiltinUsersSID))
{
rc = vgsvcWinAddAceToObjectsSecurityDescriptor(TEXT("\\\\.\\VBoxMiniRdrDN"), SE_FILE_OBJECT,
(LPTSTR)pBuiltinUsersSID, TRUSTEE_IS_SID,
FILE_GENERIC_READ | FILE_GENERIC_WRITE, SET_ACCESS, NO_INHERITANCE);
/* If we don't find our "VBoxMiniRdrDN" (for Shared Folders) object above,
don't report an error; it just might be not installed. Otherwise this
would cause the SCM to hang on starting up the service. */
if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND)
rc = VINF_SUCCESS;
FreeSid(pBuiltinUsersSID);
}
else
rc = RTErrConvertFromWin32(GetLastError());
if (RT_SUCCESS(rc))
{
/*
* Start the service.
*/
vgsvcWinSetStatus(SERVICE_START_PENDING, 0);
rc = VGSvcStartServices();
if (RT_SUCCESS(rc))
{
vgsvcWinSetStatus(SERVICE_RUNNING, 0);
VGSvcMainWait();
}
else
{
vgsvcWinSetStatus(SERVICE_STOPPED, 0);
#if 0 /** @todo r=bird: Enable this if SERVICE_CONTROL_STOP isn't triggered automatically */
VGSvcStopServices();
#endif
}
}
else
vgsvcWinSetStatus(SERVICE_STOPPED, 0);
if (RT_FAILURE(rc))
VGSvcError("Service failed to start with rc=%Rrc!\n", rc);
return rc;
}
示例11: DECLCALLBACK
DECLCALLBACK(int) rtldrNativeClose(PRTLDRMODINTERNAL pMod)
{
PRTLDRMODNATIVE pModNative = (PRTLDRMODNATIVE)pMod;
if ( (pModNative->fFlags & RTLDRLOAD_FLAGS_NO_UNLOAD)
|| FreeLibrary((HMODULE)pModNative->hNative))
{
pModNative->hNative = (uintptr_t)INVALID_HANDLE_VALUE;
return VINF_SUCCESS;
}
return RTErrConvertFromWin32(GetLastError());
}
示例12: RTDECL
RTDECL(int) RTTimeSet(PCRTTIMESPEC pTime)
{
FILETIME FileTime;
SYSTEMTIME SysTime;
if (FileTimeToSystemTime(RTTimeSpecGetNtFileTime(pTime, &FileTime), &SysTime))
{
if (SetSystemTime(&SysTime))
return VINF_SUCCESS;
}
return RTErrConvertFromWin32(GetLastError());
}
示例13: vboxClipboardCreateWindow
static int vboxClipboardCreateWindow(PVBOXCLIPBOARDCONTEXT pCtx)
{
AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
int rc = VINF_SUCCESS;
AssertPtr(pCtx->pEnv);
HINSTANCE hInstance = pCtx->pEnv->hInstance;
Assert(hInstance != 0);
/* Register the Window Class. */
WNDCLASSEX wc = { 0 };
wc.cbSize = sizeof(WNDCLASSEX);
if (!GetClassInfoEx(hInstance, s_szClipWndClassName, &wc))
{
wc.style = CS_NOCLOSE;
wc.lpfnWndProc = vboxClipboardWndProc;
wc.hInstance = pCtx->pEnv->hInstance;
wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
wc.lpszClassName = s_szClipWndClassName;
ATOM wndClass = RegisterClassEx(&wc);
if (wndClass == 0)
rc = RTErrConvertFromWin32(GetLastError());
}
if (RT_SUCCESS(rc))
{
const PVBOXCLIPBOARDWINCTX pWinCtx = &pCtx->Win;
/* Create the window. */
pWinCtx->hWnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT | WS_EX_TOPMOST,
s_szClipWndClassName, s_szClipWndClassName,
WS_POPUPWINDOW,
-200, -200, 100, 100, NULL, NULL, hInstance, NULL);
if (pWinCtx->hWnd == NULL)
{
rc = VERR_NOT_SUPPORTED;
}
else
{
SetWindowPos(pWinCtx->hWnd, HWND_TOPMOST, -200, -200, 0, 0,
SWP_NOACTIVATE | SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOREDRAW | SWP_NOSIZE);
VBoxClipboardWinAddToCBChain(pWinCtx);
if (!VBoxClipboardWinIsNewAPI(&pWinCtx->newAPI))
pWinCtx->oldAPI.timerRefresh = SetTimer(pWinCtx->hWnd, 0, 10 * 1000 /* 10s */, NULL);
}
}
LogFlowFuncLeaveRC(rc);
return rc;
}
示例14: RTDECL
RTDECL(int) RTSymlinkDelete(const char *pszSymlink, uint32_t fDelete)
{
/*
* Convert the path.
*/
PRTUTF16 pwszNativeSymlink;
int rc = RTStrToUtf16(pszSymlink, &pwszNativeSymlink);
if (RT_SUCCESS(rc))
{
/*
* We have to use different APIs depending on whether this is a
* directory or file link. This means we're subject to one more race
* than on posix at the moment. We could probably avoid this though,
* if we wanted to go talk with the native API layer below Win32...
*/
DWORD dwAttr = GetFileAttributesW(pwszNativeSymlink);
if (dwAttr != INVALID_FILE_ATTRIBUTES)
{
if (dwAttr & FILE_ATTRIBUTE_REPARSE_POINT)
{
BOOL fRc;
if (dwAttr & FILE_ATTRIBUTE_DIRECTORY)
fRc = RemoveDirectoryW(pwszNativeSymlink);
else
fRc = DeleteFileW(pwszNativeSymlink);
if (fRc)
rc = VINF_SUCCESS;
else
rc = RTErrConvertFromWin32(GetLastError());
}
else
rc = VERR_NOT_SYMLINK;
}
else
rc = RTErrConvertFromWin32(GetLastError());
RTUtf16Free(pwszNativeSymlink);
}
LogFlow(("RTSymlinkDelete(%p={%s}, %#x): returns %Rrc\n", pszSymlink, pszSymlink, fDelete, rc));
return rc;
}
示例15: RTDECL
RTDECL(int) RTPathGetCurrent(char *pszPath, size_t cchPath)
{
int rc;
/*
* GetCurrentDirectory may in some cases omit the drive letter, according
* to MSDN, thus the GetFullPathName call.
*/
RTUTF16 wszCurPath[RTPATH_MAX];
if (GetCurrentDirectoryW(RTPATH_MAX, wszCurPath))
{
RTUTF16 wszFullPath[RTPATH_MAX];
if (GetFullPathNameW(wszCurPath, RTPATH_MAX, wszFullPath, NULL))
rc = RTUtf16ToUtf8Ex(&wszFullPath[0], RTSTR_MAX, &pszPath, cchPath, NULL);
else
rc = RTErrConvertFromWin32(GetLastError());
}
else
rc = RTErrConvertFromWin32(GetLastError());
return rc;
}