这篇教程C++ GetWindowsDirectoryW函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetWindowsDirectoryW函数的典型用法代码示例。如果您正苦于以下问题:C++ GetWindowsDirectoryW函数的具体用法?C++ GetWindowsDirectoryW怎么用?C++ GetWindowsDirectoryW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetWindowsDirectoryW函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: search_for_infstatic HINF search_for_inf(LPCVOID InfSpec, DWORD SearchControl){ HINF hInf = INVALID_HANDLE_VALUE; WCHAR inf_path[MAX_PATH]; static const WCHAR infW[] = {'//','i','n','f','//',0}; static const WCHAR system32W[] = {'//','s','y','s','t','e','m','3','2','//',0}; if (SearchControl == INFINFO_REVERSE_DEFAULT_SEARCH) { GetWindowsDirectoryW(inf_path, MAX_PATH); lstrcatW(inf_path, system32W); lstrcatW(inf_path, InfSpec); hInf = SetupOpenInfFileW(inf_path, NULL, INF_STYLE_OLDNT | INF_STYLE_WIN4, NULL); if (hInf != INVALID_HANDLE_VALUE) return hInf; GetWindowsDirectoryW(inf_path, MAX_PATH); lstrcpyW(inf_path, infW); lstrcatW(inf_path, InfSpec); return SetupOpenInfFileW(inf_path, NULL, INF_STYLE_OLDNT | INF_STYLE_WIN4, NULL); } return INVALID_HANDLE_VALUE;}
开发者ID:GYGit,项目名称:reactos,代码行数:29,
示例2: test_GetWindowsDirectoryWstatic void test_GetWindowsDirectoryW(void){ UINT len, len_with_null; WCHAR buf[MAX_PATH]; static const WCHAR fooW[] = {'f','o','o',0}; len_with_null = GetWindowsDirectoryW(NULL, 0); if (len_with_null == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { win_skip("GetWindowsDirectoryW is not implemented/n"); return; } ok(len_with_null <= MAX_PATH, "should fit into MAX_PATH/n"); lstrcpyW(buf, fooW); len = GetWindowsDirectoryW(buf, 1); ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer/n"); ok(len == len_with_null, "GetWindowsDirectoryW returned %d, expected %d/n", len, len_with_null); lstrcpyW(buf, fooW); len = GetWindowsDirectoryW(buf, len_with_null - 1); ok(lstrcmpW(buf, fooW) == 0, "should not touch the buffer/n"); ok(len == len_with_null, "GetWindowsDirectoryW returned %d, expected %d/n", len, len_with_null); lstrcpyW(buf, fooW); len = GetWindowsDirectoryW(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, "GetWindowsDirectoryW returned %d, expected %d/n", len, len_with_null-1);}
开发者ID:AmesianX,项目名称:wine,代码行数:33,
示例3: GetWindowsDirectoryWchar *win32_get_font_dir(const char *font_file){ wchar_t wdir[MAX_PATH]; if (S_OK != SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, wdir)) { int lenght = GetWindowsDirectoryW(wdir, MAX_PATH); if (lenght == 0 || lenght > (MAX_PATH - 8)) { BD_DEBUG(DBG_FILE, "Font directory path too long!/n"); return NULL; } if (!wcscat(wdir, L"//fonts")) { BD_DEBUG(DBG_FILE, "Could not construct font directory path!/n"); return NULL; } } int len = WideCharToMultiByte (CP_UTF8, 0, wdir, -1, NULL, 0, NULL, NULL); char *path = malloc(len + strlen(font_file) + 2); if (path) { WideCharToMultiByte(CP_UTF8, 0, wdir, -1, path, len, NULL, NULL); path[len - 1] = '//'; strcpy(path + len, font_file); } return path;}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:25,
示例4: bCheckIfDualBootingWithWin31BOOL bCheckIfDualBootingWithWin31(){ WCHAR Buffer[32]; WCHAR awcWindowsDir[MAX_PATH]; DWORD dwRet; UINT cwchWinPath = GetWindowsDirectoryW(awcWindowsDir, MAX_PATH);// the cwchWinPath value does not include the terminating zero if (awcWindowsDir[cwchWinPath - 1] == L'//') { cwchWinPath -= 1; } awcWindowsDir[cwchWinPath] = L'/0'; // make sure to zero terminated lstrcatW(awcWindowsDir, L"//system32//"); lstrcatW(awcWindowsDir, WINNT_GUI_FILE_W); dwRet = GetPrivateProfileStringW( WINNT_DATA_W, WINNT_D_WIN31UPGRADE_W, WINNT_A_NO_W, Buffer, sizeof(Buffer)/sizeof(WCHAR), awcWindowsDir ); #if DBG DbgPrint("/n dwRet = %ld, win31upgrade = %ws/n/n", dwRet, Buffer); #endif return (BOOL)(dwRet ? (!lstrcmpiW(Buffer,WINNT_A_YES)) : 0);}
开发者ID:Gaikokujin,项目名称:WinNT4,代码行数:33,
示例5: SetupUninstallOEMInfW |