void sysGetEnumValue(char*filename) { wchar_t pszFileName[1024]; memset(pszFileName, 0, sizeof(pszFileName)); int len = strlen(filename); assert(len < 1024); MultiByteToWideChar(CP_OEMCP, 0, filename, len, pszFileName, sizeof(pszFileName)); if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE))) { EnumerateProperties(pszFileName); CoUninitialize(); } }
VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) { return EnumerateProperties(1, &device_profile_api_LayerProps, pCount, pProperties); }
int wmain(int argc, wchar_t* argv[]) { if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE))) { PCWSTR pszAppName = CONSUME_NEXT_ARG(argv, argc); PCWSTR pszOp = CONSUME_NEXT_ARG(argv, argc); if (pszOp && ((pszOp[0] == L'-') || (pszOp[0] == L'/'))) { /* skip - or / */ pszOp++; if (!_wcsicmp(pszOp, L"?")) { Usage(pszAppName); } else if (!_wcsicmp(pszOp, L"get")) { PCWSTR pszPropertyName = CONSUME_NEXT_ARG(argv, argc); if (pszPropertyName) { PCWSTR pszFileName = CONSUME_NEXT_ARG(argv, argc); if (pszFileName) { GetPropertyValue(pszFileName, pszPropertyName); } else { wprintf(L"No file name specified.\n"); } } else { wprintf(L"No property canonical name specified.\n"); } } else if (!_wcsicmp(pszOp, L"enum")) { PCWSTR pszFileName = CONSUME_NEXT_ARG(argv, argc); if (pszFileName) { EnumerateProperties(pszFileName); } else { wprintf(L"No file name specified.\n"); } } else if (!_wcsicmp(pszOp, L"set")) { PCWSTR pszPropertyName = CONSUME_NEXT_ARG(argv, argc); if (pszPropertyName) { PCWSTR pszPropertyValue = CONSUME_NEXT_ARG(argv, argc); if (pszPropertyValue) { PCWSTR pszFileName = CONSUME_NEXT_ARG(argv, argc); if (pszFileName) { SetPropertyValue(pszFileName, pszPropertyName, pszPropertyValue); } else { wprintf(L"No file name specified.\n"); } } else { wprintf(L"No property value specified.\n"); } } else { wprintf(L"No property canonical name specified.\n"); } } else if (!_wcsicmp(pszOp, L"info")) { PCWSTR pszPropertyName = CONSUME_NEXT_ARG(argv, argc); if (pszPropertyName) { GetPropertyDescription(pszPropertyName); } else { wprintf(L"No property canonical name specified.\n"); } } else { wprintf(L"Unrecognized operation specified: -%s\n", pszOp); Usage(pszAppName); } } else { wprintf(L"No operation specified.\n"); Usage(pszAppName); } CoUninitialize(); } return 0; }