MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / get_dokany_version

Function get_dokany_version

cppcryptfs/dokan/cryptdokan.cpp:2715–2754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2713}
2714
2715bool 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

Callers 2

check_dokany_versionFunction · 0.85
OnInitDialogMethod · 0.85

Calls 2

GetProductVersionInfoFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected