Partial fix for #10 (#16)

* Fix stdafx include

* Fix basic handling of "Games" folder on Windows10 RS4 (#10)
This does the following:
- Sets the default state to hidden
- Skips the Games folder when searching

This does not:
- Hide the dead menu entry.

I do not currently know how to actively change the user preference setting to forcefully hide it.

* Add basic Visual Studio gitignore

* Add specific entries to gitignore

* Do not set default menu to Win7 on RS4 (#10)
This commit is contained in:
Xenhat
2018-06-20 06:52:53 -04:00
committed by GitHub
parent 27d14a8959
commit 468ee876cc
5 changed files with 393 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
// Classic Shell (c) 2009-2016, Ivo Beltchev
// Confidential information of Ivo Beltchev. Not for disclosure or distribution without prior written consent from the author
#include <stdafx.h>
#include "stdafx.h"
#include "StringSet.h"
#include "StringUtils.h"
#include "Settings.h"
@@ -680,6 +680,51 @@ bool IsWin10RS1( void )
return bIsRS1;
}
typedef LONG NTSTATUS, *PNTSTATUS;
#define STATUS_SUCCESS (0x00000000)
typedef NTSTATUS (WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
// *DO NOT USE DIRECTLY* : Call GetOSVersion() instead.
//
// The functions above return a windows version
// that is rather not user-readable. This code should give
// us a number we can reference with the "public" windows builds
// such as what is returned by 'winver.exe'.
RTL_OSVERSIONINFOW GetRealOSVersion() {
HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
if (hMod) {
RtlGetVersionPtr fxPtr = (RtlGetVersionPtr)::GetProcAddress(hMod, "RtlGetVersion");
if (fxPtr != nullptr) {
RTL_OSVERSIONINFOW rovi = { 0 };
rovi.dwOSVersionInfoSize = sizeof(rovi);
if ( STATUS_SUCCESS == fxPtr(&rovi) ) {
return rovi;
}
}
}
RTL_OSVERSIONINFOW rovi = { 0 };
return rovi;
}
static RTL_OSVERSIONINFOW GetOSVersion()
{
// cache result to avoid calling the dll multiple times.
static RTL_OSVERSIONINFOW ver = GetRealOSVersion();
return ver;
}
static bool IsWin10RS4Helper( void )
{
auto version = GetOSVersion();
return version.dwMajorVersion > 8 && version.dwBuildNumber > 17131;
}
// Returns true if the version is Windows10 RS4 (Spring Creator Update) or later
bool IsWin10RS4( void )
{
static bool bIsRS4=IsWin10RS4Helper();
return bIsRS4;
}
// Wrapper for IShellFolder::ParseDisplayName
HRESULT ShParseDisplayName( const wchar_t *pszName, PIDLIST_ABSOLUTE *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut )
{