| 2713 | } |
| 2714 | |
| 2715 | bool get_dokany_version(wstring& ver, vector<int>& v) |
| 2716 | { |
| 2717 | // DokanVersion() is useless because it returns 100 |
| 2718 | |
| 2719 | v.clear(); |
| 2720 | |
| 2721 | HMODULE hDok = GetModuleHandle(L"dokan2.dll"); |
| 2722 | if (!hDok) |
| 2723 | return false; |
| 2724 | WCHAR dokPath[MAX_PATH+1]; |
| 2725 | dokPath[0] = '\0'; |
| 2726 | |
| 2727 | |
| 2728 | |
| 2729 | wstring name; |
| 2730 | wstring copyright; |
| 2731 | |
| 2732 | if (!GetProductVersionInfo(name, ver, copyright, hDok)) { |
| 2733 | return false; |
| 2734 | } |
| 2735 | |
| 2736 | vector<wstring> strings; |
| 2737 | wistringstream f(ver); |
| 2738 | wchar_t buf[32]; |
| 2739 | while (f.getline(buf, sizeof(buf) / sizeof(buf[0]) - 1, L'.')) { |
| 2740 | strings.push_back(buf); |
| 2741 | } |
| 2742 | |
| 2743 | if (strings.size() != 4) { |
| 2744 | return false; |
| 2745 | } |
| 2746 | |
| 2747 | v.push_back(_wtoi(strings[0].c_str())); |
| 2748 | v.push_back(_wtoi(strings[1].c_str())); |
| 2749 | v.push_back(_wtoi(strings[2].c_str())); |
| 2750 | v.push_back(_wtoi(strings[3].c_str())); |
| 2751 | |
| 2752 | return true; |
| 2753 | |
| 2754 | } |
| 2755 | |
| 2756 | // return false if won't work, returns true with no message if all ok, |
| 2757 | // returns true with message if there will maybe be a problem |
no test coverage detected