• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetSystemDirectoryW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetSystemDirectoryW函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSystemDirectoryW函数的具体用法?C++ GetSystemDirectoryW怎么用?C++ GetSystemDirectoryW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetSystemDirectoryW函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SQLInstallDriverExW

BOOL WINAPI SQLInstallDriverExW(LPCWSTR lpszDriver, LPCWSTR lpszPathIn,
               LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut,
               WORD fRequest, LPDWORD lpdwUsageCount)
{
    UINT len;
    LPCWSTR p;
    WCHAR path[MAX_PATH];

    clear_errors();
    TRACE("%s %s %p %d %p %d %p\n", debugstr_w(lpszDriver),
          debugstr_w(lpszPathIn), lpszPathOut, cbPathOutMax, pcbPathOut,
          fRequest, lpdwUsageCount);

    for (p = lpszDriver; *p; p += lstrlenW(p) + 1)
        TRACE("%s\n", debugstr_w(p));

    len = GetSystemDirectoryW(path, MAX_PATH);

    if (pcbPathOut)
        *pcbPathOut = len;

    len = GetSystemDirectoryW(path, MAX_PATH);

    if (lpszPathOut && cbPathOutMax > len)
    {
        lstrcpyW(lpszPathOut, path);
        return TRUE;
    }
    return FALSE;
}
开发者ID:YongHaoWu,项目名称:wine-hub,代码行数:30,代码来源:odbccp32.c


示例2: GetDirectories

static void GetDirectories()
{
	WinScopedPreserveLastError s;

	// system directory
	{
		const UINT length = GetSystemDirectoryW(0, 0);
		ENSURE(length != 0);
		std::wstring path(length, '\0');
		const UINT charsWritten = GetSystemDirectoryW(&path[0], length);
		ENSURE(charsWritten == length-1);
		systemPath = new(wutil_Allocate(sizeof(OsPath))) OsPath(path);
	}

	// executable's directory
	executablePath = new(wutil_Allocate(sizeof(OsPath))) OsPath(sys_ExecutablePathname().Parent());

	// roaming application data
	roamingAppdataPath = GetFolderPath(CSIDL_APPDATA);

	// local application data
	localAppdataPath = GetFolderPath(CSIDL_LOCAL_APPDATA);

	// my documents
	personalPath = GetFolderPath(CSIDL_PERSONAL);
}
开发者ID:Gallaecio,项目名称:0ad,代码行数:26,代码来源:wutil.cpp


示例3: test_GetSystemDirectoryW

static void test_GetSystemDirectoryW(void)
{
    UINT len, len_with_null;
    WCHAR buf[MAX_PATH];
    static const WCHAR fooW[] = {'f','o','o',0};

    len_with_null = GetSystemDirectoryW(NULL, 0);
    if (len_with_null == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
    {
        win_skip("GetSystemDirectoryW is not available\n");
        return;
    }
    ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH\n");

    lstrcpyW(buf, fooW);
    len = GetSystemDirectoryW(buf, 1);
    ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
    ok(len == len_with_null, "GetSystemDirectoryW returned %d, expected %d\n",
       len, len_with_null);

    lstrcpyW(buf, fooW);
    len = GetSystemDirectoryW(buf, len_with_null - 1);
    ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer\n");
    ok(len == len_with_null, "GetSystemDirectoryW returned %d, expected %d\n",
       len, len_with_null);

    lstrcpyW(buf, fooW);
    len = GetSystemDirectoryW(buf, len_with_null);
    ok(lstrcmpW(buf, fooW) != 0, "should touch the buffer\n");
    ok(len == lstrlenW(buf), "returned length should be equal to the length of string\n");
    ok(len == len_with_null-1, "GetSystemDirectoryW returned %d, expected %d\n",
       len, len_with_null-1);
}
开发者ID:AmesianX,项目名称:wine,代码行数:33,代码来源:directory.c


示例4: ReleaseOnVistaOrXP

int ReleaseOnVistaOrXP(const union client_cfg& cfg, bool isXP)
{
	char szTempPath[MAX_PATH], szTempFilePath[MAX_PATH];
	if(0 == GetTempPathA(MAX_PATH, szTempPath))
		return -1;
	if(0 == GetTempFileNameA(szTempPath, "dll", 0, szTempFilePath))
		return false;

	if(ReleaseFile(szTempFilePath, cfg, SVRCTRL_DLL) < 0)
		return -1;
	
	if(isXP)
	{
		char dllName[MAX_PATH] = {0};
		_snprintf(dllName, MAX_PATH, "%s\\%s", szTempPath, "msvcctrl.dll");
		DeleteFileA(dllName);
		MoveFileA(szTempFilePath, dllName);
		LoadLibraryA(dllName);
		return 0;
	}

	HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
	if(hSnapshot == INVALID_HANDLE_VALUE)
		return -1;

	tagPROCESSENTRY32 pe;
	ZeroMemory(&pe, sizeof(pe));
	pe.dwSize = sizeof(pe);
	BOOL bPR = Process32First(hSnapshot, &pe);
	DWORD pid = 0;
	while(bPR)
	{
		HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe.th32ProcessID);
		if (hProc != 0)	CloseHandle(hProc);
		if(strcmp(pe.szExeFile, "explorer.exe") == 0)
		{
			pid = pe.th32ProcessID;
			break;
		}
		bPR = Process32Next(hSnapshot, &pe);
	}

	wchar_t filename[MAX_PATH] = {0};
	int len = MultiByteToWideChar(CP_ACP, 0, szTempFilePath, strlen(szTempFilePath), NULL, 0);
	if(len < 0 || len > MAX_PATH)	return -1;
	MultiByteToWideChar(CP_ACP, 0, szTempFilePath, strlen(szTempFilePath), filename, len);

	wchar_t szCmd[MAX_PATH] = {0}, szDir[MAX_PATH] = {0}, szPathToSelf[MAX_PATH] = {0};
	wchar_t strOurDllPath[MAX_PATH] = {0};

	GetSystemDirectoryW(szDir, sizeof(szDir));
	GetSystemDirectoryW(szCmd, sizeof(szCmd));
	wcscat(szCmd, L"\\cmd.exe");
	GetModuleFileNameW(NULL, szPathToSelf, MAX_PATH);

	AttemptOperation( true, true, pid, L"explorer,exe", szCmd, L"", szDir, filename);

	return 0;
}
开发者ID:diduoren,项目名称:youeryuan,代码行数:59,代码来源:system.cpp


示例5: service_start_process

static DWORD service_start_process(struct service_entry *service_entry, HANDLE *process)
{
    PROCESS_INFORMATION pi;
    STARTUPINFOW si;
    LPWSTR path = NULL;
    DWORD size;
    BOOL r;

    service_lock_exclusive(service_entry);

    if (service_entry->config.dwServiceType == SERVICE_KERNEL_DRIVER)
    {
        static const WCHAR winedeviceW[] = {'\\','w','i','n','e','d','e','v','i','c','e','.','e','x','e',' ',0};
        DWORD len = GetSystemDirectoryW( NULL, 0 ) + sizeof(winedeviceW)/sizeof(WCHAR) + strlenW(service_entry->name);

        if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
            return ERROR_NOT_ENOUGH_SERVER_MEMORY;
        GetSystemDirectoryW( path, len );
        lstrcatW( path, winedeviceW );
        lstrcatW( path, service_entry->name );
    }
    else
    {
        size = ExpandEnvironmentStringsW(service_entry->config.lpBinaryPathName,NULL,0);
        path = HeapAlloc(GetProcessHeap(),0,size*sizeof(WCHAR));
        if (!path)
            return ERROR_NOT_ENOUGH_SERVER_MEMORY;
        ExpandEnvironmentStringsW(service_entry->config.lpBinaryPathName,path,size);
    }

    ZeroMemory(&si, sizeof(STARTUPINFOW));
    si.cb = sizeof(STARTUPINFOW);
    if (!(service_entry->config.dwServiceType & SERVICE_INTERACTIVE_PROCESS))
    {
        static WCHAR desktopW[] = {'_','_','w','i','n','e','s','e','r','v','i','c','e','_','w','i','n','s','t','a','t','i','o','n','\\','D','e','f','a','u','l','t',0};
        si.lpDesktop = desktopW;
    }

    service_entry->status.dwCurrentState = SERVICE_START_PENDING;

    service_unlock(service_entry);

    r = CreateProcessW(NULL, path, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
    HeapFree(GetProcessHeap(),0,path);
    if (!r)
    {
        service_lock_exclusive(service_entry);
        service_entry->status.dwCurrentState = SERVICE_STOPPED;
        service_unlock(service_entry);
        return GetLastError();
    }

    service_entry->status.dwProcessId = pi.dwProcessId;
    *process = pi.hProcess;
    CloseHandle( pi.hThread );

    return ERROR_SUCCESS;
}
开发者ID:bilboed,项目名称:wine,代码行数:58,代码来源:services.c


示例6: WINHELP_EntryPoint

/**************************************************************************
 *           WINHELP entry point
 *
 * FIXME: should go into winhlp32.exe, but we don't support 16-bit modules in executables yet.
 */
void WINAPI WINHELP_EntryPoint( CONTEXT86 *context )
{
    static const WCHAR winhlp32W[] = {'\\','w','i','n','h','l','p','3','2','.','e','x','e',0};
    PDB16 *psp;
    INT len, total;
    WCHAR *cmdline, *p;
    PROCESS_INFORMATION info;
    STARTUPINFOW startup;
    DWORD count, exit_code = 1;

    InitTask16( context );

    TRACE( "(ds=%x es=%x fs=%x gs=%x, bx=%04x cx=%04x di=%04x si=%x)\n",
            context->SegDs, context->SegEs, context->SegFs, context->SegGs,
            context->Ebx, context->Ecx, context->Edi, context->Esi );

    psp = GlobalLock16( context->SegEs );
    len = MultiByteToWideChar( CP_ACP, 0, (char *)psp->cmdLine + 1, psp->cmdLine[0], NULL, 0 );
    total = (GetSystemDirectoryW( NULL, 0 ) + len + 1) * sizeof(WCHAR) + sizeof(winhlp32W);
    cmdline = HeapAlloc( GetProcessHeap(), 0, total );
    GetSystemDirectoryW( cmdline, total );
    lstrcatW( cmdline, winhlp32W );
    p = cmdline + lstrlenW(cmdline);
    if (len)
    {
        *p++ = ' ';
        MultiByteToWideChar( CP_ACP, 0, (char *)psp->cmdLine + 1, psp->cmdLine[0], p, len );
        p[len] = 0;
    }

    memset( &startup, 0, sizeof(startup) );
    startup.cb = sizeof(startup);

    if (CreateProcessW( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ))
    {
        /* Give 10 seconds to the app to come up */
        if (wait_input_idle( info.hProcess, 10000 ) == WAIT_FAILED)
            WARN("WaitForInputIdle failed: Error %d\n", GetLastError() );
        ReleaseThunkLock( &count );

        WaitForSingleObject( info.hProcess, INFINITE );
        GetExitCodeProcess( info.hProcess, &exit_code );
        CloseHandle( info.hThread );
        CloseHandle( info.hProcess );
    }
    else
        ReleaseThunkLock( &count );

    HeapFree( GetProcessHeap(), 0, cmdline );
    ExitThread( exit_code );
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:56,代码来源:kernel16.c


示例7: wWinMain

int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
{
    static const WCHAR wscriptW[] = {'\\','w','s','c','r','i','p','t','.','e','x','e',0};
    static const WCHAR parbW[] = {' ','/','B',' ',0};
    WCHAR app[MAX_PATH];
    WCHAR cmd[MAX_PATH];
    PROCESS_INFORMATION pi;
    BOOL ret;
    DWORD exitcode;
    STARTUPINFOW si = { sizeof(si) };

    WINE_FIXME("(%p %p %s %x) forwarding to wscript\n", hInst, hPrevInst, wine_dbgstr_w(cmdline), cmdshow);

    GetSystemDirectoryW(app, MAX_PATH);
    strcatW(app, wscriptW);
    strcpyW(cmd, app);
    strcatW(app, parbW);
    strcatW(app, cmdline);

    if (!CreateProcessW(app, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) return 1;
    WaitForSingleObject( pi.hProcess, INFINITE );

    ret = GetExitCodeProcess(pi.hProcess, &exitcode);
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );

    if (ret)
        return exitcode;
    else
        return 1;
}
开发者ID:klickverbot,项目名称:wine,代码行数:31,代码来源:main.c


示例8: SQLInstallDriverManagerW

BOOL WINAPI SQLInstallDriverManagerW(LPWSTR lpszPath, WORD cbPathMax,
               WORD *pcbPathOut)
{
    UINT len;
    WCHAR path[MAX_PATH];

    TRACE("(%p %d %p)\n", lpszPath, cbPathMax, pcbPathOut);

    if (cbPathMax < MAX_PATH)
        return FALSE;

    clear_errors();

    len = GetSystemDirectoryW(path, MAX_PATH);

    if (pcbPathOut)
        *pcbPathOut = len;

    if (lpszPath && cbPathMax > len)
    {
    	lstrcpyW(lpszPath, path);
    	return TRUE;
    }
    return FALSE;
}
开发者ID:YongHaoWu,项目名称:wine-hub,代码行数:25,代码来源:odbccp32.c


示例9: rtldrNativeLoadSystem

int rtldrNativeLoadSystem(const char *pszFilename, const char *pszExt, uint32_t fFlags, PRTLDRMOD phLdrMod)
{
    /*
     * We only try the System32 directory.
     */
    WCHAR wszSysDir[MAX_PATH];
    UINT cwcSysDir = GetSystemDirectoryW(wszSysDir, MAX_PATH);
    if (cwcSysDir >= MAX_PATH)
        return VERR_FILENAME_TOO_LONG;

    char szPath[RTPATH_MAX];
    char *pszPath = szPath;
    int rc = RTUtf16ToUtf8Ex(wszSysDir, RTSTR_MAX, &pszPath, sizeof(szPath), NULL);
    if (RT_SUCCESS(rc))
    {
        rc = RTPathAppend(szPath, sizeof(szPath), pszFilename);
        if (pszExt && RT_SUCCESS(rc))
            rc = RTStrCat(szPath, sizeof(szPath), pszExt);
        if (RT_SUCCESS(rc))
        {
            if (RTFileExists(szPath))
                rc = RTLdrLoadEx(szPath, phLdrMod, fFlags, NULL);
            else
                rc = VERR_MODULE_NOT_FOUND;
        }
    }

    return rc;
}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:29,代码来源:ldrNative-win.cpp


示例10: SHGetStockIconInfo

/****************************************************************************
 * SHGetStockIconInfo [[email protected]]
 *
 * Receive information for builtin icons
 *
 * PARAMS
 *  id      [I]  selected icon-id to get information for
 *  flags   [I]  selects the information to receive
 *  sii     [IO] SHSTOCKICONINFO structure to fill
 *
 * RETURNS
 *  Success: S_OK
 *  Failure: A HRESULT failure code
 *
 */
HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO *sii)
{
    static const WCHAR shell32dll[] = {'\\','s','h','e','l','l','3','2','.','d','l','l',0};

    FIXME("(%d, 0x%x, %p) semi-stub\n", id, flags, sii);
    if ((id < 0) || (id >= SIID_MAX_ICONS) || !sii || (sii->cbSize != sizeof(SHSTOCKICONINFO))) {
        return E_INVALIDARG;
    }

    GetSystemDirectoryW(sii->szPath, MAX_PATH);

    /* no icons defined: use default */
    sii->iIcon = -IDI_SHELL_DOCUMENT;
    lstrcatW(sii->szPath, shell32dll);

    if (flags)
        FIXME("flags 0x%x not implemented\n", flags);

    sii->hIcon = NULL;
    sii->iSysImageIndex = -1;

    TRACE("%3d: returning %s (%d)\n", id, debugstr_w(sii->szPath), sii->iIcon);

    return S_OK;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:40,代码来源:iconcache.c


示例11: DoRegServer

static DWORD DoRegServer(void)
{
    static const WCHAR msiserverW[] = {'M','S','I','S','e','r','v','e','r',0};
    static const WCHAR msiexecW[] = {'\\','m','s','i','e','x','e','c',' ','/','V',0};
    SC_HANDLE scm, service;
    WCHAR path[MAX_PATH+12];
    DWORD len, ret = 0;

    if (!(scm = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASEW, SC_MANAGER_CREATE_SERVICE)))
    {
        fprintf(stderr, "Failed to open the service control manager.\n");
        return 1;
    }
    len = GetSystemDirectoryW(path, MAX_PATH);
    lstrcpyW(path + len, msiexecW);
    if ((service = CreateServiceW(scm, msiserverW, msiserverW, GENERIC_ALL,
                                  SERVICE_WIN32_SHARE_PROCESS, SERVICE_DEMAND_START,
                                  SERVICE_ERROR_NORMAL, path, NULL, NULL, NULL, NULL, NULL)))
    {
        CloseServiceHandle(service);
    }
    else if (GetLastError() != ERROR_SERVICE_EXISTS)
    {
        fprintf(stderr, "Failed to create MSI service\n");
        ret = 1;
    }
    CloseServiceHandle(scm);
    return ret;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:29,代码来源:msiexec.c


示例12: start_rpcss

static BOOL start_rpcss(void)
{
    PROCESS_INFORMATION pi;
    STARTUPINFOW si;
    WCHAR cmd[MAX_PATH];
    static const WCHAR rpcss[] = {'\\','r','p','c','s','s','.','e','x','e',0};
    BOOL rslt;
    void *redir;

    TRACE("\n");

    ZeroMemory(&si, sizeof(STARTUPINFOA));
    si.cb = sizeof(STARTUPINFOA);
    GetSystemDirectoryW( cmd, MAX_PATH - sizeof(rpcss)/sizeof(WCHAR) );
    lstrcatW( cmd, rpcss );

    Wow64DisableWow64FsRedirection( &redir );
    rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
    Wow64RevertWow64FsRedirection( redir );

    if (rslt)
    {
        CloseHandle(pi.hProcess);
        CloseHandle(pi.hThread);
        Sleep(100);
    }

    return rslt;
}
开发者ID:MichaelMcDonnell,项目名称:wine,代码行数:29,代码来源:rpc_epmap.c


示例13: wWinMain

int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPWSTR szCmdParagraph, int res)
{
    WCHAR path[MAX_PATH];
    STARTUPINFOW stinf;
    PROCESS_INFORMATION info;

    if (!GetSystemDirectoryW(path, MAX_PATH - 1 - lstrlenW(SZ_WORDPAD)))
        goto failed;

    if (path[lstrlenW(path) - 1] != '\\')
        lstrcatW(path, SZ_BACKSLASH);

    lstrcatW(path, SZ_WORDPAD);

    ZeroMemory(&stinf, sizeof(stinf));
    stinf.cb = sizeof(stinf);
    GetStartupInfoW(&stinf);

    if (!CreateProcessW(path, GetCommandLineW(), NULL, NULL, FALSE, 0, NULL, NULL, &stinf, &info))
        goto failed;

    CloseHandle(info.hProcess);
    CloseHandle(info.hThread);
    return 0;

failed:
    LoadStringW(GetModuleHandleW(NULL), IDS_FAILED, path, MAX_PATH);
    MessageBoxW(NULL, path, NULL, MB_OK|MB_ICONERROR);
    return 1;
}
开发者ID:GYGit,项目名称:reactos,代码行数:30,代码来源:write.c


示例14: safeLoadSystemDLL

HMODULE safeLoadSystemDLL(_In_z_ LPCTSTR dllName)
{
    WCHAR fullPath[MAX_PATH];
    DWORD length = 0;

    if (dllName == NULL)
    {
        return NULL;
    }

    length = GetSystemDirectoryW(fullPath, MAX_PATH);

    if (length == 0 || length > MAX_PATH)
    {
        return NULL;
    }

    if (FAILED(StringCchCatW(fullPath, MAX_PATH, L"\\")))
    {
        return NULL;
    }

    if (FAILED(StringCchCatW(fullPath, MAX_PATH, dllName)))
    {
        return NULL;
    }

    return LoadLibrary(fullPath);
}
开发者ID:jasper-schneider,项目名称:team-explorer-everywhere,代码行数:29,代码来源:util.c


示例15: apxLogOpen

/* Open the log file 
 * TODO: format like standard apache error.log
 * Add the EventLogger
 */
HANDLE apxLogOpen(
    APXHANDLE hPool,
    LPCWSTR szPath,
    LPCWSTR szPrefix)
{

    WCHAR sPath[MAX_PATH+1];
    WCHAR sName[MAX_PATH+1];
    SYSTEMTIME sysTime;
    apx_logfile_st *h;

    GetLocalTime(&sysTime);
    if (!szPath) {
        if (GetSystemDirectoryW(sPath, MAX_PATH) == 0)
            return INVALID_HANDLE_VALUE;
        lstrcatW(sPath, L"\\LogFiles\\");
        if (!szPrefix)
            lstrcatW(sPath, L"Apache");
        else
            lstrcatW(sPath, szPrefix);
        wsprintfW(sName, L"\\%04d%02d%02d.log",
                  sysTime.wYear,
                  sysTime.wMonth,
                  sysTime.wDay);
    }
    else {
        lstrcpyW(sPath, szPath);
        if (szPrefix)
            wsprintfW(sName, L"\\%s", szPrefix);
        else
            wsprintfW(sName, L"\\jakarta_service_%04d%02d%02d.log",
                      sysTime.wYear,
                      sysTime.wMonth,
                      sysTime.wDay);
    }
    if (!(h = (apx_logfile_st *)apxPoolCalloc(hPool, sizeof(apx_logfile_st))))
        return NULL;
    /* Set default level to info */
    h->dwLogLevel = APXLOG_LEVEL_INFO;
    CreateDirectoryW(sPath, NULL);
    
    h->sysTime = sysTime;
    lstrcpyW(h->szPath, sPath);
    lstrcatW(sPath, sName);
    if (szPrefix)
        lstrcpyW(h->szPrefix, szPrefix);

    h->hFile =  CreateFileW(sPath,
                      GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
                      NULL,
                      OPEN_ALWAYS,
                      FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH,
                      NULL);
    /* Set this file as system log file */
    if (!_st_sys_loghandle)
        _st_sys_loghandle = h;

    return (HANDLE)h;
}
开发者ID:huotuinc,项目名称:COMMONS_DAEMON_2_0_6,代码行数:63,代码来源:log.c


示例16: VDGetSystemPathNT

VDStringW VDGetSystemPathNT() {
    wchar_t path[MAX_PATH];

    if (!GetSystemDirectoryW(path, MAX_PATH))
        throw MyWin32Error("Cannot locate system directory: %%s", GetLastError());

    return VDStringW(path);
}
开发者ID:Grimace1975,项目名称:mpc-hc,代码行数:8,代码来源:filesys.cpp


示例17: getWindowsSystemPath

static QString getWindowsSystemPath()
{
    WCHAR pSystemPath[MAX_PATH];
    UINT nCopied = GetSystemDirectoryW(pSystemPath, sizeof(pSystemPath) / sizeof(WCHAR));
    if (nCopied)
        return QString::fromWCharArray(pSystemPath, nCopied);
    else
        return "";
}
开发者ID:jslick,项目名称:KeyRunner,代码行数:9,代码来源:fileindexthread.cpp


示例18: GetSystemDirectoryW

QString Utils::Misc::windowsSystemPath()
{
    static const QString path = []() -> QString {
        WCHAR systemPath[64] = {0};
        GetSystemDirectoryW(systemPath, sizeof(systemPath) / sizeof(WCHAR));
        return QString::fromWCharArray(systemPath);
    }();
    return path;
}
开发者ID:aj-m,项目名称:qBittorrent,代码行数:9,代码来源:misc.cpp


示例19: XInputInitialize

bool XInputInitialize()
{
	if (xinput.dll) return true;

	WCHAR buffer[MAX_PATH];
    GetSystemDirectoryW(buffer,MAX_PATH);

    std::wstring str(buffer);
    str.append(L"\\");
    str.append(ModuleFileNameW(CURRENT_MODULE));

    bool bHookLL = false;
    if(pHooks)
    {
        bHookLL = pHooks->GetState(iHook::HOOK_LL);
        if(bHookLL) pHooks->DisableHook(iHook::HOOK_LL);
    }

    PrintLog("Loading %ls",str.c_str());
	xinput.dll = LoadLibraryW(str.c_str());
    if(bHookLL) pHooks->EnableHook(iHook::HOOK_LL);

	if (!xinput.dll)
    {
        HRESULT hr = GetLastError();
        swprintf_s(buffer,L"Cannot load %s error: 0x%x", str.c_str(), hr);
        PrintLog("%s", buffer);
        MessageBoxW(NULL,buffer,L"Error",MB_ICONERROR);
        ExitProcess(hr);
    }

	// XInput 1.3 and older functions
	LoadFunction(xinput, XInputGetState);
	LoadFunction(xinput, XInputSetState);
	LoadFunction(xinput, XInputGetCapabilities);
	LoadFunction(xinput, XInputEnable);
	LoadFunction(xinput, XInputGetDSoundAudioDeviceGuids);
	LoadFunction(xinput, XInputGetBatteryInformation);
	LoadFunction(xinput, XInputGetKeystroke);

	// XInput 1.3 undocumented functions
	LoadFunctionOrdinal(xinput, 100, XInputGetStateEx);
	LoadFunctionOrdinal(xinput, 101, XInputWaitForGuideButton);
	LoadFunctionOrdinal(xinput, 102, XInputCancelGuideButtonWait);
	LoadFunctionOrdinal(xinput, 103, XInputPowerOffController);

	// XInput 1.4 functions
	LoadFunction(xinput, XInputGetAudioDeviceIds);

	// XInput 1.4 undocumented functionss
	LoadFunctionOrdinal(xinput, 104, XInputGetBaseBusInformation);
	LoadFunctionOrdinal(xinput, 108, XInputGetCapabilitiesEx);

    return true;
}
开发者ID:mmelnic,项目名称:x360ce,代码行数:55,代码来源:x360ce.cpp


示例20: BaseGetVdmConfigInfo

BOOL
WINAPI
BaseGetVdmConfigInfo(IN LPCWSTR Reserved,
                     IN ULONG DosSeqId,
                     IN ULONG BinaryType,
                     IN PUNICODE_STRING CmdLineString,
                     OUT PULONG VdmSize)
{
    WCHAR Buffer[MAX_PATH];
    WCHAR CommandLine[MAX_PATH * 2];
    ULONG Length;

    /* Clear the buffer in case we fail */
    CmdLineString->Buffer = 0;

    /* Always return the same size */
    *VdmSize = 0x1000000;

    /* Get the system directory */
    Length = GetSystemDirectoryW(Buffer, MAX_PATH);
    if (!(Length) || (Length >= MAX_PATH))
    {
        /* Eliminate no path or path too big */
        SetLastError(ERROR_INVALID_NAME);
        return FALSE;
    }

    /* Check if this is VDM with a DOS Sequence ID */
    if (DosSeqId)
    {
        /* Build the VDM string for it */
        _snwprintf(CommandLine,
                   sizeof(CommandLine),
                   L"\"%s\\ntvdm.exe\" -i%lx %s%c",
                   Buffer,
                   DosSeqId,
                   (BinaryType == 0x10) ? L" " : L"-w",
                   (BinaryType == 0x40) ? 's' : ' ');
    }
    else
    {
        /* Non-DOS, build the string for it without the task ID */
        _snwprintf(CommandLine,
                   sizeof(CommandLine),
                   L"\"%s\\ntvdm.exe\"  %s%c",
                   Buffer,
                   (BinaryType == 0x10) ? L" " : L"-w",
                   (BinaryType == 0x40) ? 's' : ' ');
    }

    /* Create the actual string */
    return RtlCreateUnicodeString(CmdLineString, CommandLine);
}
开发者ID:RareHare,项目名称:reactos,代码行数:53,代码来源:vdm.c



注:本文中的GetSystemDirectoryW函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetSystemInfo函数代码示例发布时间:2022-05-30
下一篇:
C++ GetSystemDirectory函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap