├── .editorconfig ├── .gitignore ├── .gitmodules ├── AuthUX.sln ├── AuthUX.vcxproj ├── AuthUX.vcxproj.filters ├── LICENSE ├── README.md ├── installer ├── build_installer.cmd ├── header.bmp ├── installer-x64.nsi ├── installer.ico ├── l10n │ ├── English.nsh │ ├── French.nsh │ ├── Italian.nsh │ ├── Japanese.nsh │ └── Korean.nsh └── welcome.bmp ├── packages.config ├── resource.h ├── resources ├── 1000.bmp ├── 1001.bmp ├── 1002.bmp ├── 1003.bmp ├── 1004.bmp ├── 1005.bmp ├── 1006.bmp ├── 1007.bmp ├── 11000.bmp ├── 11001.bmp ├── 11002.bmp ├── 11003.bmp ├── 12201.bmp ├── 12202.bmp ├── 12203.bmp ├── 12204.bmp ├── 12205.bmp ├── 12206.bmp ├── 12207.bmp ├── 12208.bmp ├── 12209.bmp ├── 12210.bmp ├── 12211.bmp ├── 12212.bmp ├── 12213.bmp ├── 12214.bmp ├── 12215.bmp ├── 12216.bmp ├── 12217.bmp ├── 12218.bmp ├── 12219.bmp ├── 12220.bmp ├── 12221.bmp ├── 12222.bmp ├── 12223.bmp ├── 12224.bmp ├── 12225.bmp ├── 12226.bmp ├── 12227.bmp ├── 12228.bmp ├── 12229.bmp ├── 12230.bmp ├── 12231.bmp ├── 12232.bmp ├── 12233.bmp ├── 12234.bmp ├── 12235.bmp ├── 12236.bmp ├── 12237.bmp ├── 12238.bmp ├── 12259.bmp ├── 12260.bmp ├── 12261.bmp ├── 12262.bmp ├── 12263.bmp ├── 12264.bmp ├── 12265.bmp ├── 12266.bmp ├── 12267.bmp ├── 12268.bmp ├── 12269.bmp ├── 12270.bmp ├── 12271.bmp ├── 12272.bmp ├── 12273.bmp ├── 12274.bmp ├── 12275.bmp ├── 12276.bmp ├── 12277.bmp ├── 12278.bmp ├── 12279.bmp ├── 12280.bmp ├── 12281.bmp ├── 12282.bmp ├── 12283.bmp ├── 12284.bmp ├── 12285.bmp ├── 12286.bmp ├── 12287.bmp ├── 12288.bmp ├── 12289.bmp ├── 12290.bmp ├── 12291.bmp ├── 12292.bmp ├── 12293.bmp ├── 12294.bmp ├── 12295.bmp ├── 12296.bmp ├── 12298.bmp ├── 12299.bmp ├── 12300.bmp ├── 12300.jpg ├── 12301.bmp ├── 12302.bmp ├── 12303.bmp ├── 12304.bmp ├── 12305.bmp ├── 12306.bmp ├── 12307.bmp ├── 12309.bmp ├── 12310.bmp ├── 12311.bmp ├── 12312.bmp ├── 12313.bmp ├── 12314.bmp ├── 12315.bmp ├── 12316.bmp ├── 12317.bmp ├── 12318.bmp ├── 12320.bmp ├── 12321.bmp ├── 12322.bmp ├── 12323.bmp ├── 12324.bmp ├── 14002.jpg ├── 14003.jpg ├── 5031.jpg ├── 5032.jpg ├── 5033.jpg ├── 5034.jpg ├── 5035.jpg ├── 5036.jpg ├── 5037.jpg ├── 5038.jpg ├── 5039.jpg ├── 5040.jpg ├── 5041.jpg ├── 5042.jpg ├── 5043.jpg ├── 5044.jpg ├── 5045.jpg ├── 5046.jpg ├── 5047.jpg ├── 5048.jpg ├── 5049.jpg ├── 5050.jpg ├── 5051.jpg ├── 5052.jpg ├── 5053.jpg ├── 5054.jpg ├── 5055.jpg ├── 5056.jpg ├── Bitmap1120.bmp ├── Bitmap120.bmp ├── Bitmap2120.bmp ├── Bitmap5000.bmp ├── Bitmap5001.bmp ├── Bitmap5002.bmp ├── Bitmap5003.bmp ├── Bitmap5004.bmp ├── authui.xml ├── authui2.xml ├── authui3.xml └── usertile1.bmp ├── sdk └── inc │ ├── AgileGitPtr.h │ ├── AssertMacros.h │ ├── ContainerPolicies.h │ ├── GitPtr.h │ ├── InternalAsync.h │ ├── MarshaledInterface.h │ ├── NativeString.h │ ├── NotificationDispatcher.cpp │ ├── NotificationDispatcher.h │ ├── RefCountedObject.h │ ├── ResultUtils.h │ ├── SimpleArray.h │ ├── logonguids.cpp │ ├── logonguids.h │ ├── logoninterfaces.h │ ├── memsafe.h │ ├── version.h │ ├── wicutil.cpp │ ├── wicutil.h │ ├── windowscollections.h │ └── xhashmap.h └── shell └── auth └── authux └── consolelogon ├── dll ├── ConsoleLogon.def ├── consolelogon.rc ├── dllmain.cpp ├── pch.cpp └── pch.h └── lib ├── DefaultSelector.cpp ├── DefaultSelector.h ├── EventDispatcher.cpp ├── EventDispatcher.h ├── OptionalDependencyProvider.cpp ├── advisablebutton.cpp ├── advisablebutton.h ├── animationstrip.cpp ├── animationstrip.h ├── authux.cpp ├── authuxlock.cpp ├── authuxlockaction.cpp ├── authuxlockaction.h ├── backgroundfetcher.cpp ├── backgroundfetcher.h ├── combobox.cpp ├── combobox.h ├── consolebsdrstub.cpp ├── consoleuimanager.cpp ├── consoleuimanager.h ├── duiutil.h ├── fieldcontainer.cpp ├── fieldcontainer.h ├── labeledcheckbox.cpp ├── labeledcheckbox.h ├── logonframe.cpp ├── logonframe.h ├── logonnativehwndhost.cpp ├── logonnativehwndhost.h ├── logonviewmanager.cpp ├── logonviewmanager.h ├── optionaldependencyprovider.h ├── restrictededit.cpp ├── restrictededit.h ├── userlist.cpp ├── userlist.h ├── usertileelement.cpp ├── usertileelement.h ├── zoomableelement.cpp └── zoomableelement.h /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = tab 6 | end_of_line = crlf 7 | 8 | [*.{h,c,cpp}] 9 | insert_final_newline = true 10 | 11 | [*.vcxproj] 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | 352 | .idea/ 353 | installer/build/** -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dui70"] 2 | path = dui70 3 | url = https://github.com/Olive6841/dui70.git 4 | -------------------------------------------------------------------------------- /AuthUX.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | Source Files 74 | 75 | 76 | Source Files 77 | 78 | 79 | Source Files 80 | 81 | 82 | Source Files 83 | 84 | 85 | Source Files 86 | 87 | 88 | Source Files 89 | 90 | 91 | Source Files 92 | 93 | 94 | Source Files 95 | 96 | 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | Header Files 106 | 107 | 108 | Header Files 109 | 110 | 111 | Header Files 112 | 113 | 114 | Header Files 115 | 116 | 117 | Header Files 118 | 119 | 120 | Header Files 121 | 122 | 123 | Header Files 124 | 125 | 126 | Header Files 127 | 128 | 129 | Header Files 130 | 131 | 132 | Header Files 133 | 134 | 135 | Header Files 136 | 137 | 138 | Header Files 139 | 140 | 141 | Header Files 142 | 143 | 144 | Header Files 145 | 146 | 147 | Header Files 148 | 149 | 150 | Header Files 151 | 152 | 153 | Header Files 154 | 155 | 156 | Header Files 157 | 158 | 159 | Header Files 160 | 161 | 162 | Header Files 163 | 164 | 165 | Header Files 166 | 167 | 168 | Header Files 169 | 170 | 171 | Header Files 172 | 173 | 174 | Header Files 175 | 176 | 177 | Header Files 178 | 179 | 180 | Header Files 181 | 182 | 183 | Header Files 184 | 185 | 186 | Header Files 187 | 188 | 189 | Header Files 190 | 191 | 192 | Header Files 193 | 194 | 195 | Header Files 196 | 197 | 198 | Header Files 199 | 200 | 201 | Header Files 202 | 203 | 204 | Header Files 205 | 206 | 207 | Header Files 208 | 209 | 210 | Header Files 211 | 212 | 213 | Header Files 214 | 215 | 216 | 217 | 218 | Resource Files 219 | 220 | 221 | 222 | 223 | Source Files 224 | 225 | 226 | 227 | 228 | 229 | 230 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AuthUX 2 | 3 | **AuthUX** is a project based on [the ConsoleLogon decompilation](//github.com/explorer7-team/ConsoleLogon) which aims to replicate the Windows 7 logon screen. 4 | 5 | > [!WARNING] 6 | > **THIS PROJECT IS IN EARLY DEVELOPMENT AND MIGHT BE UNSTABLE. Use at your own risk. We are not liable for any damages that may or may not occur.** 7 | 8 | ## Manual Installation 9 | 10 | > [!WARNING] 11 | > **To ensure a stable experience, you should ensure that you install a version of AuthUX compiled for your version of Windows.** 12 | 13 | In order to install AuthUX, you need to write to protected registry keys which you ordinarily do not have permission to write to. An easy way to do this is to [download RunTI](https://github.com/aubymori/RunTI) and use it to run a Command Prompt (`cmd.exe`) window as the special internal TrustedInstaller user account. The keys which you must write to are: 14 | 15 | - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX\DllPath` 16 | - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost\DllPath` 17 | 18 | If you ran a TrustedInstaller `cmd.exe` instance as per the above recommendation, then the following commands will override those keys for you. Note that these commands presume the location of your AuthUX binaries to be `%SystemRoot%\System32\AuthUX.dll` (so in other words, you should move the files to System32; they will not conflict with anything): 19 | 20 | ```cmd 21 | reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX /v DllPath /t REG_SZ /d %SystemRoot%\System32\AuthUX.dll /f 22 | reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost /v DllPath /t REG_SZ /d %SystemRoot%\System32\AuthUX.dll /f 23 | ``` 24 | 25 | If these steps have been followed properly, then the logon screen will immediately start using AuthUX. 26 | 27 | > [!NOTE] 28 | > **An easy and safe way you can test whether or not AuthUX is working is by pressing CTRL+ALT+DEL on your keyboard to display the security options screen.** If an error occurred during setup, then the security options screen will likely fail to display and you will be taken back to the desktop, where you should immediately revert the values. [See the Uninstallation section of this document for more information.](#uninstallation) 29 | 30 | ## Manual Uninstallation 31 | 32 | In order to restore the official Windows 10 logon screen, you need to revert the above registry key paths as outlined in the [Installation section](#installation). 33 | 34 | The default values are displayed in the below table: 35 | 36 | | **Windows.Internal.UI.Logon.Controller.LogonUX** | `%SystemRoot%\system32\Windows.UI.Logon.dll` | 37 | |---------------------------------------------------------|----------------------------------------------| 38 | | **Windows.Internal.UI.Logon.Controller.LockScreenHost** | `%SystemRoot%\system32\logoncontroller.dll` | 39 | 40 | You can use the following commands to restore these default values, once again by opening a TrustedInstaller `cmd.exe` window via [RunTI](https://github.com/aubymori/RunTI): 41 | 42 | ```cmd 43 | reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX /v DllPath /t REG_SZ /d %SystemRoot%\system32\Windows.UI.Logon.dll /f 44 | reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost /v DllPath /t REG_SZ /d %SystemRoot%\system32\logoncontroller.dll /f 45 | ``` 46 | 47 | Following this modification, the logon screen will immediately revert to the vanilla experience. 48 | 49 | ## Building 50 | 51 | **You need the Windows SDK for your target version. It is recommended to install a modern version of Visual Studio, such as Visual Studio 2022.** 52 | 53 | > [!WARNING] 54 | > Note: You might encounter issues on earlier versions of the MSVC toolset. Version 14.42 is tested and known to work. 55 | > 56 | > Additionally, you may encounter issues with the Windows Implementation Library (WIL) NuGet packages. If this is the case, try to uninstall and reinstall the packages. 57 | 58 | This repository relies on Git submodules for the DirectUI library (dui70). In order to retrieve these files which are necessary for building, you must clone with submodules or fetch them. 59 | 60 | To clone the repository with submodules, run: 61 | 62 | ```cmd 63 | git clone --recurse-submodules https://github.com/explorer7-team/AuthUI.git 64 | ``` 65 | 66 | To fetch submodules after cloning the repository, run: 67 | 68 | ```cmd 69 | git submodule update --init --recursive 70 | ``` 71 | 72 | Once you have cloned the repository, you must configure the build version in [`sdk/inc/version.h`](/sdk/inc/version.h). Change the line which defines `CONSOLELOGON_FOR` to one of the predefined constants. For example, the default value is: 73 | 74 | ```cpp 75 | #ifndef CONSOLELOGON_FOR 76 | #define CONSOLELOGON_FOR CONSOLELOGON_FOR_VB 77 | #endif 78 | ``` 79 | 80 | which configures the build for the Windows 10 Vibranium (VB) development semester, which corresponds to all builds in the 1904x build range, or 2004 through 22H2. 81 | 82 | The following table should aid you in determining which value to use: 83 | 84 | | **Semester Name** | **Abbreviation** | **Build Number** | **Version Number** | **Operating System Family** | 85 | |-------------------|------------------|-----------------------------------|------------------------------|-----------------------------------------------------------------| 86 | | \*_Redstone 2_ | _RS2_ | _15063_ | _1703_ | _Windows 10 (Creators Update)_ | 87 | | \*_Redstone 3_ | _RS3_ | _16299_ | _1709_ | _Windows 10 (Fall Creators Update)_ | 88 | | \*_Redstone 4_ | _RS4_ | _17134_ | _1803_ | _Windows 10_ | 89 | | Redstone 5 | RS5 | 17763 | 1809 | Windows 10 | 90 | | - | 19H1 | 18362, 18363 | 1903, 1909 | Windows 10 | 91 | | Vibranium | VB | 19041, 19042, 19043, 19044, 19045 | 2004, 20H2, 21H1, 21H2, 22H2 | Windows 10 | 92 | | Manganese | MN | 19551~19624 | 2004 | Windows 10 Insider Preview, Windows Server 2022 Insider Preview | 93 | | Iron | FE | 20348 | 21H2 | Windows Server 2022 | 94 | | Cobalt | CO | 22000 | 21H2 | Windows 11 | 95 | | Nickel | NI | 22621, 22631 | 22H2 | Windows 11 | 96 | | Zinc | ZN | 25246~25393 | 23H2 | Windows 11 Insider Preview | 97 | | Germanium | GE | 26100, 26120, 26200 | 24H2 | Windows 11 | 98 | 99 | *Italicised entries are not currently supported. The minimum supported is currently RS5.* 100 | 101 | Once that's all configured, you should just be able to compile the project by just building the solution. You should get a resulting `AuthUX.dll` file, [which you can use to install with the same installation instructions as above.](#installation) 102 | -------------------------------------------------------------------------------- /installer/build_installer.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | md build >NUL 3 | makensis installer-x64.nsi -------------------------------------------------------------------------------- /installer/header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/installer/header.bmp -------------------------------------------------------------------------------- /installer/installer-x64.nsi: -------------------------------------------------------------------------------- 1 | !include MUI2.nsh 2 | !include LogicLib.nsh 3 | !include x64.nsh 4 | !include WinVer.nsh 5 | 6 | # The install path is hardcoded. 7 | # We need both a x64 and x86 OpenWith.exe and putting both 8 | # in Program Files won't work. Having two directory choices 9 | # would also be a mess. 10 | 11 | Unicode true 12 | Name "AuthUX" 13 | Outfile "build\AuthUX-setup-x64.exe" 14 | RequestExecutionLevel admin 15 | ManifestSupportedOS all 16 | 17 | !define MUI_ICON "installer.ico" 18 | !define MUI_UNICON "installer.ico" 19 | !define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp" 20 | !define MUI_UNWELCOMEFINISHPAGE_BITMAP "welcome.bmp" 21 | !define MUI_HEADERIMAGE 22 | !define MUI_HEADERIMAGE_BITMAP "header.bmp" 23 | !define MUI_UNHEADERIMAGE_BITMAP "header.bmp" 24 | !define MUI_ABORTWARNING 25 | !define MUI_UNABORTWARNING 26 | !define MUI_FINISHPAGE_NOAUTOCLOSE 27 | !define MUI_UNFINISHPAGE_NOAUTOCLOSE 28 | 29 | !insertmacro MUI_PAGE_WELCOME 30 | !insertmacro MUI_PAGE_LICENSE "..\LICENSE" 31 | !insertmacro MUI_PAGE_COMPONENTS 32 | !insertmacro MUI_PAGE_DIRECTORY 33 | !insertmacro MUI_PAGE_INSTFILES 34 | !insertmacro MUI_PAGE_FINISH 35 | 36 | !insertmacro MUI_UNPAGE_WELCOME 37 | !insertmacro MUI_UNPAGE_CONFIRM 38 | !insertmacro MUI_UNPAGE_INSTFILES 39 | !insertmacro MUI_UNPAGE_FINISH 40 | 41 | !macro LANG_LOAD LANGLOAD 42 | !insertmacro MUI_LANGUAGE "${LANGLOAD}" 43 | !include "l10n\${LANGLOAD}.nsh" 44 | !undef LANG 45 | !macroend 46 | 47 | !macro LANG_STRING NAME VALUE 48 | LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}" 49 | !macroend 50 | 51 | !insertmacro LANG_LOAD "English" 52 | !insertmacro LANG_LOAD "French" 53 | !insertmacro LANG_LOAD "Italian" 54 | !insertmacro LANG_LOAD "Korean" 55 | !insertmacro LANG_LOAD "Japanese" 56 | 57 | Section "AuthUX" AuthUX 58 | SectionIn RO 59 | # Make sure install directories are clean 60 | RMDir /r "$INSTDIR\" 61 | 62 | # Install x86-64 files 63 | SetOutPath "$INSTDIR\" 64 | WriteUninstaller "$INSTDIR\uninstall.exe" 65 | 66 | ${If} ${AtLeastBuild} 17763 67 | ${AndIf} ${AtMostBuild} 18361 68 | File "..\x64\Release.RS5\AuthUX.dll" 69 | ${ElseIf} ${AtLeastBuild} 18362 70 | ${AndIf} ${AtMostBuild} 19040 71 | File "..\x64\Release.19H1\AuthUX.dll" 72 | ${ElseIf} ${AtLeastBuild} 19041 73 | ${AndIf} ${AtMostBuild} 19045 74 | File "..\x64\Release.VB\AuthUX.dll" 75 | ${ElseIf} ${AtLeastBuild} 20348 76 | ${AndIf} ${AtMostBuild} 21999 77 | File "..\x64\Release.FE\AuthUX.dll" 78 | ${ElseIf} ${AtLeastBuild} 22000 79 | ${AndIf} ${AtMostBuild} 22620 80 | File "..\x64\Release.CO\AuthUX.dll" 81 | ${ElseIf} ${AtLeastBuild} 22621 82 | ${AndIf} ${AtMostBuild} 22630 83 | File "..\x64\Release.NI\AuthUX.dll" 84 | ${ElseIf} ${AtLeastBuild} 22631 85 | ${AndIf} ${AtMostBuild} 26099 86 | File "..\x64\Release.ZN\AuthUX.dll" 87 | ${ElseIf} ${AtLeastBuild} 26100 88 | ${AndIf} ${AtMostBuild} 26201 89 | File "..\x64\Release.GE\AuthUX.dll" 90 | ${EndIf} 91 | 92 | # Create Uninstall entry 93 | SetRegView 64 94 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AuthUX" \ 95 | "DisplayName" "AuthUX" 96 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AuthUX" \ 97 | "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" 98 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AuthUX" \ 99 | "Publisher" "explorer7-team" 100 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AuthUX" \ 101 | "DisplayVersion" "0.0.1" 102 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AuthUX" \ 103 | "NoModify" 1 104 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AuthUX" \ 105 | "NoRepair" 1 106 | 107 | # Make LogonController use our server 108 | ReadEnvStr $0 "USERNAME" 109 | AccessControl::SetRegKeyOwner HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX" $0 110 | AccessControl::GrantOnRegKey HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX" $0 FullAccess 111 | WriteRegExpandStr HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX" \ 112 | "DllPath" "$INSTDIR\AuthUX.dll" 113 | 114 | AccessControl::SetRegKeyOwner HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost" $0 115 | AccessControl::GrantOnRegKey HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost" $0 FullAccess 116 | WriteRegExpandStr HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost" \ 117 | "DllPath" "$INSTDIR\AuthUX.dll" 118 | SectionEnd 119 | 120 | Section "Uninstall" 121 | # Delete files 122 | RMDir /r "$INSTDIR" 123 | 124 | # Revert to default LogonController server. 125 | SetRegView 64 126 | ReadEnvStr $0 "USERNAME" 127 | AccessControl::SetRegKeyOwner HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX" $0 128 | AccessControl::GrantOnRegKey HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX" $0 FullAccess 129 | WriteRegExpandStr HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LogonUX" \ 130 | "DllPath" "%SystemRoot%\system32\Windows.UI.Logon.dll" 131 | 132 | AccessControl::SetRegKeyOwner HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost" $0 133 | AccessControl::GrantOnRegKey HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost" $0 FullAccess 134 | WriteRegExpandStr HKLM "SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Internal.UI.Logon.Controller.LockScreenHost" \ 135 | "DllPath" "%SystemRoot%\system32\logoncontroller.dll" 136 | 137 | # Delete uninstall entry 138 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AuthUX" 139 | SectionEnd 140 | 141 | Function .onInit 142 | # NSIS produces an x86-32 installer. Deny installation if 143 | # we're not on a x86-64 system running WOW64. 144 | ${IfNot} ${RunningX64} 145 | MessageBox MB_OK|MB_ICONSTOP "$(STRING_NOT_X64)" 146 | Quit 147 | ${EndIf} 148 | 149 | # Need at least Windows 10 1809 and anything below Germanium (build 26100). 150 | ${IfNot} ${AtLeastBuild} 17763 151 | ${OrIfNot} ${AtMostBuild} 26201 152 | MessageBox MB_OK|MB_ICONSTOP "$(STRING_NOT_SUP)" 153 | Quit 154 | ${EndIf} 155 | 156 | SectionSetSize ${AuthUX} 4800 157 | 158 | StrCpy $INSTDIR "$PROGRAMFILES64\AuthUX" 159 | FunctionEnd 160 | -------------------------------------------------------------------------------- /installer/installer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/installer/installer.ico -------------------------------------------------------------------------------- /installer/l10n/English.nsh: -------------------------------------------------------------------------------- 1 | !define LANG "English" 2 | !insertmacro LANG_STRING STRING_NOT_X64 "AuthUX does not support 32-bit systems." 3 | !insertmacro LANG_STRING STRING_NOT_SUP "AuthUX requires a Windows version between Windows 10 version 1809 and Windows 11 version 24H2." 4 | !insertmacro LANG_STRING STRING_LANGS "Languages" -------------------------------------------------------------------------------- /installer/l10n/French.nsh: -------------------------------------------------------------------------------- 1 | !define LANG "Français" 2 | !insertmacro LANG_STRING STRING_NOT_X64 "AuthUX ne supporte pas les systèmes d'exploitation 32 bits." 3 | !insertmacro LANG_STRING STRING_NOT_SUP "AuthUX nécessite une version de Windows entre Windows 10 version 1809 et Windows 11 version 24H2." 4 | !insertmacro LANG_STRING STRING_LANGS "Langues" 5 | -------------------------------------------------------------------------------- /installer/l10n/Italian.nsh: -------------------------------------------------------------------------------- 1 | !define LANG "Italian" 2 | !insertmacro LANG_STRING STRING_NOT_X64 "AuthUX non supporta i sistemi a 32-bit." 3 | !insertmacro LANG_STRING STRING_NOT_SUP "AuthUX richiede una versione di Windows compresa tra Windows 10 versione 1809 e Windows 11 versione 24H2." 4 | !insertmacro LANG_STRING STRING_LANGS "Lingue" 5 | -------------------------------------------------------------------------------- /installer/l10n/Japanese.nsh: -------------------------------------------------------------------------------- 1 | !define LANG "Japanese" 2 | !insertmacro LANG_STRING STRING_NOT_X64 "AuthUX は32ビットシステムをサポートされていません。" 3 | !insertmacro LANG_STRING STRING_NOT_SUP "AuthUX は Windows 10 バーション 1809 から Windows 11 バーション 24H2 までの Windows バーションが必要です。" 4 | !insertmacro LANG_STRING STRING_LANGS "言語" -------------------------------------------------------------------------------- /installer/l10n/Korean.nsh: -------------------------------------------------------------------------------- 1 | !define LANG "Korean" 2 | !insertmacro LANG_STRING STRING_NOT_X64 "AuthUX는 32비트 시스템을 지원하지 않습니다." 3 | !insertmacro LANG_STRING STRING_NOT_SUP "AuthUX는 Windows 10 버전 1809와 Windows 11 버전 24H2 사이의 Windows 버전이 필요합니다." 4 | !insertmacro LANG_STRING STRING_LANGS "언어" 5 | -------------------------------------------------------------------------------- /installer/welcome.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/installer/welcome.bmp -------------------------------------------------------------------------------- /packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define IDS_CTRLALTDEL 100 4 | #define IDS_SELECTUSER 101 5 | #define IDS_SELECTSIGNINOPT 102 6 | #define IDS_ENTERCREDS 103 7 | #define IDS_SELECTOPT 104 8 | #define IDS_USER 105 9 | #define IDS_OK 106 10 | #define IDS_CANCEL 107 11 | #define IDS_YES 108 12 | #define IDS_NO 109 13 | #define IDS_LOCK 110 14 | #define IDS_SIGNOUT 111 15 | #define IDS_CHANGEPASSWD 112 16 | #define IDS_TASKMGR 113 17 | #define IDS_SWITCHUSER 114 18 | #define IDS_COMBOBOXFORMAT 125 19 | #define IDS_X 126 20 | #define IDS_UNDERSCORE 127 21 | #define IDS_WINSECURITY 128 22 | #define IDS_ENTERNEWCREDS 129 23 | #define IDS_SIGNIN 130 24 | 25 | #define UIFILE_LOGON 70 26 | #define UIFILE_LOGON2 71 27 | #define UIFILE_LOGON3 72 28 | 29 | #define IDB_BRAND 122 30 | #define IDB_BRAND2 1122 31 | #define IDB_BRAND3 2122 32 | #define IDB_SPINNER1 5000 33 | #define IDB_SPINNER2 5001 34 | #define IDB_SPINNER3 5002 35 | #define IDB_SPINNER4 5003 36 | #define IDB_SPINNER5 5004 37 | #define IDB_BG 5031 38 | #define IDB_BG2 5032 39 | #define IDB_BG3 5033 40 | #define IDB_BG4 5034 41 | #define IDB_BG5 5035 42 | #define IDB_BG6 5036 43 | #define IDB_BG7 5037 44 | #define IDB_BG8 5038 45 | #define IDB_BG9 5039 46 | #define IDB_BG10 5040 47 | #define IDB_BG11 5041 48 | #define IDB_BG12 5042 49 | #define IDB_BG13 5043 50 | #define IDB_BG14 5044 51 | #define IDB_BG15 5045 52 | #define IDB_BG16 5046 53 | #define IDB_BG17 5047 54 | #define IDB_BG18 5048 55 | #define IDB_BG19 5049 56 | #define IDB_BG20 5050 57 | #define IDB_BG21 5051 58 | #define IDB_BG22 5052 59 | #define IDB_BG23 5053 60 | #define IDB_BG24 5054 61 | #define IDB_BG25 5055 62 | #define IDB_BG26 5056 63 | 64 | #define IDB_EDITDISABLED 11000 65 | #define IDB_EDITACTIVE 11001 66 | #define IDB_EDITHOVER 11002 67 | #define IDB_EDIT 11003 68 | 69 | #define IDB_SBTHUMBV 12201 70 | #define IDB_SBTHUMBVHOVER 12202 71 | #define IDB_SBTHUMBVACTIVE 12203 72 | 73 | #define IDB_SBLINEUPV 12204 74 | #define IDB_SBLINEUPVHOVER 12205 75 | #define IDB_SBLINEUPVACTIVE 12206 76 | 77 | #define IDB_SBLINEDOWNV 12207 78 | #define IDB_SBLINEDOWNVHOVER 12208 79 | #define IDB_SBLINEDOWNVACTIVE 12209 80 | 81 | #define IDB_SBGLYPHV 12210 82 | #define IDB_SBGLYPHVACTIVE 12211 83 | #define IDB_SBGLYPHVHOVER 12212 84 | 85 | #define IDB_EASEOFACCESS 12213 86 | #define IDB_KEYBOARD 12214 87 | 88 | #define IDB_SHUTDOWN 12215 89 | #define IDB_SHUTDOWNUPDATE 12216 90 | #define IDB_SHUTDOWNDROPDOWNGLYPH 12217 91 | 92 | #define IDB_USERTILEHOVER 12218 93 | #define IDB_USERTILEFOCUS 12219 94 | #define IDB_USERTILEFOCUSACTIVE 12220 95 | #define IDB_USERTILE 12222 96 | #define IDB_USERTILEHOVERHIGHDPI 12233 97 | #define IDB_USERTILEFOCUSHIGHDPI 12234 98 | #define IDB_USERTILEFOCUSACTIVEHIGHDPI 12235 99 | #define IDB_USERTILEHIGHDPI 12237 100 | 101 | #define IDB_USERTILELARGE 12223 102 | #define IDB_USERTILELARGEHIGHDPI 12238 103 | 104 | #define IDB_COMMANDLINK 12227 105 | #define IDB_COMMANDLINKFOCUS 12224 106 | #define IDB_COMMANDLINKHOVER 12225 107 | #define IDB_COMMANDLINKACTIVE 12226 108 | 109 | #define IDB_COMMANDLINKBGFOCUS 12228 110 | #define IDB_COMMANDLINKBGHOVER 12229 111 | #define IDB_COMMANDLINKBGACTIVE 12230 112 | 113 | #define IDB_GENERICBUTTON 12263 114 | #define IDB_GENERICBUTTONFOCUS 12259 115 | #define IDB_GENERICBUTTONHOVER 12260 116 | #define IDB_GENERICBUTTONFOCUSHOVER 12261 117 | #define IDB_GENERICBUTTONACTIVE 12262 118 | 119 | #define IDB_SUBMITVISTAHOVER 12274 120 | #define IDB_SUBMITVISTAACTIVE 12275 121 | #define IDB_SUBMITVISTA 12276 122 | #define IDB_SUBMITVISTAHOVERHIGHDPI 12277 123 | #define IDB_SUBMITVISTAACTIVEHIGHDPI 12278 124 | #define IDB_SUBMITVISTAHIGHDPI 12279 125 | 126 | #define IDB_SUBMITHOVER 12286 127 | #define IDB_SUBMITACTIVE 12287 128 | #define IDB_SUBMIT 12282 129 | #define IDB_SUBMITALT 12288 130 | #define IDB_SUBMITHOVERHIGHDPI 12289 131 | #define IDB_SUBMITACTIVEHIGHDPI 12290 132 | #define IDB_SUBMITHIGHDPI 12291 133 | 134 | #define IDB_SHUTDOWNBUTTON 12296 135 | #define IDB_SHUTDOWNBUTTONFOCUS 12293 136 | #define IDB_SHTUDOWNBUTTONHOVER 12294 137 | #define IDB_SHUTDOWNBUTTONFOCUSHOVER 12292 138 | #define IDB_SHUTDOWNBUTTONACTIVE 12295 139 | 140 | #define IDB_SHUTDOWNDROPDOWNBUTTON 12302 141 | #define IDB_SHUTDOWNDROPDOWNBUTTONFOCUS 12299 142 | #define IDB_SHTUDOWNDROPDOWNBUTTONHOVER 12300 143 | #define IDB_SHUTDOWNDROPDOWNBUTTONFOCUSHOVER 12298 144 | #define IDB_SHUTDOWNDROPDOWNBUTTONACTIVE 12301 145 | 146 | #define IDB_PLAPICON 12232 147 | 148 | #define IDB_DEFAULTPFP 6969 149 | #define IDB_CREDPROVIMAGE 4242424 150 | -------------------------------------------------------------------------------- /resources/1000.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/1000.bmp -------------------------------------------------------------------------------- /resources/1001.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/1001.bmp -------------------------------------------------------------------------------- /resources/1002.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/1002.bmp -------------------------------------------------------------------------------- /resources/1003.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/1003.bmp -------------------------------------------------------------------------------- /resources/1004.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/1004.bmp -------------------------------------------------------------------------------- /resources/1005.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/1005.bmp -------------------------------------------------------------------------------- /resources/1006.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/1006.bmp -------------------------------------------------------------------------------- /resources/1007.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/1007.bmp -------------------------------------------------------------------------------- /resources/11000.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/11000.bmp -------------------------------------------------------------------------------- /resources/11001.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/11001.bmp -------------------------------------------------------------------------------- /resources/11002.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/11002.bmp -------------------------------------------------------------------------------- /resources/11003.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/11003.bmp -------------------------------------------------------------------------------- /resources/12201.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12201.bmp -------------------------------------------------------------------------------- /resources/12202.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12202.bmp -------------------------------------------------------------------------------- /resources/12203.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12203.bmp -------------------------------------------------------------------------------- /resources/12204.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12204.bmp -------------------------------------------------------------------------------- /resources/12205.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12205.bmp -------------------------------------------------------------------------------- /resources/12206.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12206.bmp -------------------------------------------------------------------------------- /resources/12207.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12207.bmp -------------------------------------------------------------------------------- /resources/12208.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12208.bmp -------------------------------------------------------------------------------- /resources/12209.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12209.bmp -------------------------------------------------------------------------------- /resources/12210.bmp: -------------------------------------------------------------------------------- 1 | BMF6(  -------------------------------------------------------------------------------- /resources/12211.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12211.bmp -------------------------------------------------------------------------------- /resources/12212.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12212.bmp -------------------------------------------------------------------------------- /resources/12213.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12213.bmp -------------------------------------------------------------------------------- /resources/12214.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12214.bmp -------------------------------------------------------------------------------- /resources/12215.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12215.bmp -------------------------------------------------------------------------------- /resources/12216.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12216.bmp -------------------------------------------------------------------------------- /resources/12217.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12217.bmp -------------------------------------------------------------------------------- /resources/12218.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12218.bmp -------------------------------------------------------------------------------- /resources/12219.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12219.bmp -------------------------------------------------------------------------------- /resources/12220.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12220.bmp -------------------------------------------------------------------------------- /resources/12221.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12221.bmp -------------------------------------------------------------------------------- /resources/12222.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12222.bmp -------------------------------------------------------------------------------- /resources/12223.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12223.bmp -------------------------------------------------------------------------------- /resources/12224.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12224.bmp -------------------------------------------------------------------------------- /resources/12225.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12225.bmp -------------------------------------------------------------------------------- /resources/12226.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12226.bmp -------------------------------------------------------------------------------- /resources/12227.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12227.bmp -------------------------------------------------------------------------------- /resources/12228.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12228.bmp -------------------------------------------------------------------------------- /resources/12229.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12229.bmp -------------------------------------------------------------------------------- /resources/12230.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12230.bmp -------------------------------------------------------------------------------- /resources/12231.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12231.bmp -------------------------------------------------------------------------------- /resources/12232.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12232.bmp -------------------------------------------------------------------------------- /resources/12233.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12233.bmp -------------------------------------------------------------------------------- /resources/12234.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12234.bmp -------------------------------------------------------------------------------- /resources/12235.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12235.bmp -------------------------------------------------------------------------------- /resources/12236.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12236.bmp -------------------------------------------------------------------------------- /resources/12237.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12237.bmp -------------------------------------------------------------------------------- /resources/12238.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12238.bmp -------------------------------------------------------------------------------- /resources/12259.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12259.bmp -------------------------------------------------------------------------------- /resources/12260.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12260.bmp -------------------------------------------------------------------------------- /resources/12261.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12261.bmp -------------------------------------------------------------------------------- /resources/12262.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12262.bmp -------------------------------------------------------------------------------- /resources/12263.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12263.bmp -------------------------------------------------------------------------------- /resources/12264.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12264.bmp -------------------------------------------------------------------------------- /resources/12265.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12265.bmp -------------------------------------------------------------------------------- /resources/12266.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12266.bmp -------------------------------------------------------------------------------- /resources/12267.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12267.bmp -------------------------------------------------------------------------------- /resources/12268.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12268.bmp -------------------------------------------------------------------------------- /resources/12269.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12269.bmp -------------------------------------------------------------------------------- /resources/12270.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12270.bmp -------------------------------------------------------------------------------- /resources/12271.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12271.bmp -------------------------------------------------------------------------------- /resources/12272.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12272.bmp -------------------------------------------------------------------------------- /resources/12273.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12273.bmp -------------------------------------------------------------------------------- /resources/12274.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12274.bmp -------------------------------------------------------------------------------- /resources/12275.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12275.bmp -------------------------------------------------------------------------------- /resources/12276.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12276.bmp -------------------------------------------------------------------------------- /resources/12277.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12277.bmp -------------------------------------------------------------------------------- /resources/12278.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12278.bmp -------------------------------------------------------------------------------- /resources/12279.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12279.bmp -------------------------------------------------------------------------------- /resources/12280.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12280.bmp -------------------------------------------------------------------------------- /resources/12281.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12281.bmp -------------------------------------------------------------------------------- /resources/12282.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12282.bmp -------------------------------------------------------------------------------- /resources/12283.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12283.bmp -------------------------------------------------------------------------------- /resources/12284.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12284.bmp -------------------------------------------------------------------------------- /resources/12285.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12285.bmp -------------------------------------------------------------------------------- /resources/12286.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12286.bmp -------------------------------------------------------------------------------- /resources/12287.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12287.bmp -------------------------------------------------------------------------------- /resources/12288.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12288.bmp -------------------------------------------------------------------------------- /resources/12289.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12289.bmp -------------------------------------------------------------------------------- /resources/12290.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12290.bmp -------------------------------------------------------------------------------- /resources/12291.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12291.bmp -------------------------------------------------------------------------------- /resources/12292.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12292.bmp -------------------------------------------------------------------------------- /resources/12293.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12293.bmp -------------------------------------------------------------------------------- /resources/12294.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12294.bmp -------------------------------------------------------------------------------- /resources/12295.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12295.bmp -------------------------------------------------------------------------------- /resources/12296.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12296.bmp -------------------------------------------------------------------------------- /resources/12298.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12298.bmp -------------------------------------------------------------------------------- /resources/12299.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12299.bmp -------------------------------------------------------------------------------- /resources/12300.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12300.bmp -------------------------------------------------------------------------------- /resources/12300.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12300.jpg -------------------------------------------------------------------------------- /resources/12301.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12301.bmp -------------------------------------------------------------------------------- /resources/12302.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12302.bmp -------------------------------------------------------------------------------- /resources/12303.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12303.bmp -------------------------------------------------------------------------------- /resources/12304.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12304.bmp -------------------------------------------------------------------------------- /resources/12305.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12305.bmp -------------------------------------------------------------------------------- /resources/12306.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12306.bmp -------------------------------------------------------------------------------- /resources/12307.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12307.bmp -------------------------------------------------------------------------------- /resources/12309.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12309.bmp -------------------------------------------------------------------------------- /resources/12310.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12310.bmp -------------------------------------------------------------------------------- /resources/12311.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12311.bmp -------------------------------------------------------------------------------- /resources/12312.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12312.bmp -------------------------------------------------------------------------------- /resources/12313.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12313.bmp -------------------------------------------------------------------------------- /resources/12314.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12314.bmp -------------------------------------------------------------------------------- /resources/12315.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12315.bmp -------------------------------------------------------------------------------- /resources/12316.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12316.bmp -------------------------------------------------------------------------------- /resources/12317.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12317.bmp -------------------------------------------------------------------------------- /resources/12318.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12318.bmp -------------------------------------------------------------------------------- /resources/12320.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12320.bmp -------------------------------------------------------------------------------- /resources/12321.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12321.bmp -------------------------------------------------------------------------------- /resources/12322.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12322.bmp -------------------------------------------------------------------------------- /resources/12323.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12323.bmp -------------------------------------------------------------------------------- /resources/12324.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/12324.bmp -------------------------------------------------------------------------------- /resources/14002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/14002.jpg -------------------------------------------------------------------------------- /resources/14003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/14003.jpg -------------------------------------------------------------------------------- /resources/5031.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5031.jpg -------------------------------------------------------------------------------- /resources/5032.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5032.jpg -------------------------------------------------------------------------------- /resources/5033.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5033.jpg -------------------------------------------------------------------------------- /resources/5034.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5034.jpg -------------------------------------------------------------------------------- /resources/5035.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5035.jpg -------------------------------------------------------------------------------- /resources/5036.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5036.jpg -------------------------------------------------------------------------------- /resources/5037.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5037.jpg -------------------------------------------------------------------------------- /resources/5038.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5038.jpg -------------------------------------------------------------------------------- /resources/5039.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5039.jpg -------------------------------------------------------------------------------- /resources/5040.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5040.jpg -------------------------------------------------------------------------------- /resources/5041.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5041.jpg -------------------------------------------------------------------------------- /resources/5042.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5042.jpg -------------------------------------------------------------------------------- /resources/5043.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5043.jpg -------------------------------------------------------------------------------- /resources/5044.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5044.jpg -------------------------------------------------------------------------------- /resources/5045.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5045.jpg -------------------------------------------------------------------------------- /resources/5046.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5046.jpg -------------------------------------------------------------------------------- /resources/5047.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5047.jpg -------------------------------------------------------------------------------- /resources/5048.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5048.jpg -------------------------------------------------------------------------------- /resources/5049.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5049.jpg -------------------------------------------------------------------------------- /resources/5050.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5050.jpg -------------------------------------------------------------------------------- /resources/5051.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5051.jpg -------------------------------------------------------------------------------- /resources/5052.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5052.jpg -------------------------------------------------------------------------------- /resources/5053.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5053.jpg -------------------------------------------------------------------------------- /resources/5054.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5054.jpg -------------------------------------------------------------------------------- /resources/5055.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5055.jpg -------------------------------------------------------------------------------- /resources/5056.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/5056.jpg -------------------------------------------------------------------------------- /resources/Bitmap1120.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/Bitmap1120.bmp -------------------------------------------------------------------------------- /resources/Bitmap120.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/Bitmap120.bmp -------------------------------------------------------------------------------- /resources/Bitmap2120.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/Bitmap2120.bmp -------------------------------------------------------------------------------- /resources/Bitmap5000.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/Bitmap5000.bmp -------------------------------------------------------------------------------- /resources/Bitmap5001.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/Bitmap5001.bmp -------------------------------------------------------------------------------- /resources/Bitmap5002.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/Bitmap5002.bmp -------------------------------------------------------------------------------- /resources/Bitmap5003.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/Bitmap5003.bmp -------------------------------------------------------------------------------- /resources/Bitmap5004.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/Bitmap5004.bmp -------------------------------------------------------------------------------- /resources/usertile1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/explorer7-team/AuthUX/e05fda9e431ce5715e2e05093febc45cf8146d5c/resources/usertile1.bmp -------------------------------------------------------------------------------- /sdk/inc/AgileGitPtr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | class AgileGitPtr 8 | { 9 | public: 10 | HRESULT Initialize(AgileReferenceOptions aro, REFIID riid, IUnknown* punk) 11 | { 12 | HRESULT hr = S_OK; 13 | Microsoft::WRL::ComPtr newRef; 14 | if (punk) 15 | hr = RoGetAgileReference(aro, riid, punk, newRef.ReleaseAndGetAddressOf()); 16 | newRef.Swap(m_agileRef); 17 | return hr; 18 | } 19 | 20 | bool IsInitialized() const 21 | { 22 | return m_agileRef.Get() != nullptr; 23 | } 24 | 25 | HRESULT CopyLocal(REFIID riid, void** ppv) const 26 | { 27 | if (!IsInitialized()) 28 | { 29 | *ppv = nullptr; 30 | return E_INVALIDARG; 31 | } 32 | return m_agileRef.CopyTo(riid, (IUnknown**)ppv); 33 | } 34 | 35 | template 36 | HRESULT CopyLocal(Microsoft::WRL::Details::ComPtrRef> ptr) const 37 | { 38 | return CopyLocal(__uuidof(T), ptr); 39 | } 40 | 41 | HRESULT Revoke() 42 | { 43 | m_agileRef.Swap(nullptr); // @Note: Yes, null ComPtr construction here, and then swapping. Could've been .Reset() but this is what they wrote. 44 | return S_OK; 45 | } 46 | 47 | Microsoft::WRL::AgileRef m_agileRef; 48 | }; 49 | -------------------------------------------------------------------------------- /sdk/inc/AssertMacros.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | // Common ASSERT macro definitions 5 | 6 | #pragma once 7 | 8 | // We are deprecating the use ntassert.h, however, we still use other external dependency headers that 9 | // include this. Which means it gets included for all our stuff too. Undef anything that might have been 10 | // included from ntassert.h so that we can catch (at least most) uses. 11 | #undef _DBGRAISEASSERTIONFAILURE_ 12 | #undef BREAK_DEBUG_BASE 13 | #undef ASSERT_BREAKPOINT 14 | #undef NT_ANALYSIS_ASSUME 15 | #undef NT_ASSERT_ACTION 16 | #undef NT_ASSERTMSG_ACTION 17 | #undef NT_ASSERTMSGW_ACTION 18 | #undef NT_ASSERT_ASSUME 19 | #undef NT_ASSERTMSG_ASSUME 20 | #undef NT_ASSERTMSGW_ASSUME 21 | #undef NT_ASSERT_NOASSUME 22 | #undef NT_ASSERTMSG_NOASSUME 23 | #undef NT_ASSERTMSGW_NOASSUME 24 | #undef NT_VERIFY 25 | #undef NT_VERIFYMSG 26 | #undef NT_VERIFYMSGW 27 | #undef NT_FRE_ASSERT 28 | #undef NT_FRE_ASSERTMSG 29 | #undef NT_FRE_ASSERTMSGW 30 | #undef NT_ASSERT 31 | #undef NT_ASSERTMSG 32 | #undef NT_ASSERTMSGW 33 | #undef WIN_ASSERT 34 | #undef WIN_ASSERTMSG 35 | #undef WIN_ASSERTMSGW 36 | #undef WIN_VERIFY 37 | #undef WIN_VERIFYMSG 38 | #undef WIN_VERIFYMSGW 39 | 40 | // Unfortunately, we also include several external dependency includes that reference NT_ASSERTxxx macros 41 | // but don't include ntassert.h, just assumming that it is being included elsewhere. Known violators of this 42 | // are: 43 | // dxaml\external\private\inc\internal\onecoreuapshell\inc\PropVariant.h 44 | // dxaml\external\private\inc\internal\minwin\priv_sdk\inc\telemetry\MicrosoftTelemetryAssert.h 45 | // 46 | // Another issue is that NT_ASSERTxxx macros are written in a manner that they can be used in expressions (hence 47 | // included in other assert macros like the telemetry asserts). Our Asserts are not written that way, so we can't 48 | // just delegate to them. 49 | #if DBG 50 | #if defined(_PREFAST_) 51 | #define NT_ASSERT(cond) (_Analysis_assume_(!!(cond))) 52 | #else // defined(_PREFAST_) 53 | #define NT_ASSERT(cond) (!(cond) ? DbgRaiseAssertionFailure() : (void) 0) 54 | #endif // defined(_PREFAST_) 55 | #define NT_ASSERTMSG(msg,cond) NT_ASSERT(cond) 56 | #define NT_VERIFY(cond) NT_ASSERT(cond) 57 | #else // if DBG 58 | #define NT_ASSERT(cond) ((void) 0) 59 | #define NT_ASSERTMSG(msg,cond) ((void) 0) 60 | #define NT_VERIFY(cond) ((!!cond) ? TRUE : FALSE) 61 | #endif // if DBG 62 | 63 | 64 | #if DBG 65 | 66 | #define XCPW(x) L##x 67 | 68 | // Following the condition, these accept a format string and susbtitutions in 69 | // the same way as wprintf. It doesn't look like the format string is currently 70 | // functional though, so avoid using it. 71 | 72 | // The __annotation and DbgRaiseAssertionFailure() (in FAIL_ASSERT_HERE()) 73 | // must be inline to the function "calling" ASSERT(), to let WER/Watson know what function is failing an 74 | // assert. 75 | // These macros incorrectly apply _Analysis_assume_ to their conditions. Since in FRE builds 76 | // they are not evaluated this is actually disabling some static analysis. 77 | 78 | #define VERIFY(cond, ...) ASSERT(cond, _VA_ARGS_) 79 | #define VERIFYHR(hr, ...) ASSERTSUCCEEDED(hr, _VA_ARGS_) 80 | 81 | #if !defined(EXP_CLANG) 82 | #define VERIFY_COND(expr, cond, ...) ASSERT(expr ## cond, _VA_ARGS_) 83 | #else 84 | // Debug version of this macro is not portable as it relies on MSVC, non-conformant way of macro expansion. 85 | #define VERIFY_COND(expr, cond, ...) (expr) 86 | #endif // EXP_CLANG 87 | 88 | // We need to disable warning 4127 (Constant expression in controlling statement) 89 | // as sometimes the expression in the IF or the WHILE is actually a constant 90 | 91 | #define ASSERT(cond, ...) \ 92 | do { \ 93 | _Analysis_assume_(!!(cond)); \ 94 | __pragma(warning(suppress:4127)) \ 95 | if(!(cond)) \ 96 | { \ 97 | FAIL_ASSERT_HERE(XCPW(#cond)); \ 98 | } \ 99 | } \ 100 | __pragma(warning(suppress:4127)) \ 101 | while(0) 102 | 103 | #define ASSERTFN(fn, ...) \ 104 | do { \ 105 | _Analysis_assume_(!(fn)); \ 106 | __pragma(warning(suppress:4127)) \ 107 | if((fn)) \ 108 | { \ 109 | FAIL_ASSERT_HERE((XCPW(#fn) L" == 0")); \ 110 | } \ 111 | } \ 112 | __pragma(warning(suppress:4127)) \ 113 | while(0) 114 | 115 | 116 | #define ASSERTSUCCEEDED(hr, ...) \ 117 | do { \ 118 | _Analysis_assume_(SUCCEEDED(hr)); \ 119 | __pragma(warning(suppress:4127)) \ 120 | if(!SUCCEEDED(hr)) \ 121 | { \ 122 | FAIL_ASSERT_HERE((L"SUCCEEDED(" XCPW(#hr) L")")); \ 123 | } \ 124 | } \ 125 | __pragma(warning(suppress:4127)) \ 126 | while(0) 127 | 128 | #else // #if DBG 129 | 130 | // _Analysis_assume_ resolves to nothing if we are not running under prefast, so 131 | // so the comma operator is not valid. 132 | #if defined(_PREFAST_) 133 | #define VERIFY(cond, ...) (_Analysis_assume_(!!cond), ((cond) ? TRUE : FALSE)) 134 | #define VERIFYHR(hr, ...) (_Analysis_assume_(SUCCEEDED(hr)), (SUCCEEDED(hr) ? TRUE : FALSE)) 135 | #define ASSERT(cond, ...) (_Analysis_assume_(!!(cond))) 136 | #else 137 | #define VERIFY(cond, ...) (!!(cond) ? TRUE : FALSE) 138 | #define VERIFYHR(hr, ...) (SUCCEEDED(hr) ? TRUE : FALSE) 139 | #define ASSERT(cond, ...) ((void) 0) 140 | #endif // end #if _PREFAST 141 | 142 | #define VERIFY_COND(expr, cond, ...) (expr) 143 | 144 | #define ASSERTFN(fn, ...) 145 | #define ASSERTSUCCEEDED(hr, ...) 146 | 147 | #endif // end #if DBG 148 | 149 | // FAIL_ASSERT_HERE must be defined after the assert macros, so that it can be 150 | // overridden in some compile units. For example, core XAML overrides this to 151 | // FAILFAST unless under a debugger (see minerror.h). 152 | #define FAIL_ASSERT_HERE(x) \ 153 | do { \ 154 | __annotation(L"Debug", L"AssertFail", (x)); \ 155 | DbgRaiseAssertionFailure(); \ 156 | } \ 157 | __pragma(warning(suppress:4127)) \ 158 | while(0) 159 | 160 | 161 | -------------------------------------------------------------------------------- /sdk/inc/ContainerPolicies.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | template 8 | class CTContainer_PolicyUnOwned 9 | { 10 | public: 11 | static void Destroy(T* p) {} 12 | }; 13 | 14 | template 15 | class CTContainer_PolicyRelease 16 | { 17 | public: 18 | static void Destroy(T* p) 19 | { 20 | if (p) 21 | p->Release(); 22 | } 23 | }; 24 | 25 | class CTContainer_PolicyNewMem 26 | { 27 | public: 28 | template 29 | static void Destroy(T* p) 30 | { 31 | delete p; 32 | } 33 | }; 34 | 35 | class CTContainer_PolicyCoTaskMem 36 | { 37 | public: 38 | static void Destroy(void* p) 39 | { 40 | CoTaskMemFree(p); 41 | } 42 | }; 43 | 44 | class CTContainer_PolicyLocalMem 45 | { 46 | public: 47 | static void Destroy(void* p) 48 | { 49 | DestroyMem(p); 50 | } 51 | 52 | static BOOL DestroyMem(void* p) 53 | { 54 | return !LocalFree(p); 55 | } 56 | }; 57 | 58 | template 59 | class CTPolicyCoTaskMem : CTContainer_PolicyCoTaskMem 60 | { 61 | public: 62 | static void Destroy(void* p) 63 | { 64 | CTContainer_PolicyCoTaskMem::Destroy(p); 65 | } 66 | 67 | static HRESULT ReallocArray(T* pv, size_t cItems, T** ppv) 68 | { 69 | return CoReallocArray(pv, cItems, ppv); 70 | } 71 | }; 72 | 73 | template 74 | class CTPolicyLocalMem : CTContainer_PolicyLocalMem 75 | { 76 | public: 77 | static void Destroy(void* p) 78 | { 79 | DestroyMem(p); 80 | } 81 | 82 | static HRESULT ReallocArray(T* pv, size_t cItems, T** ppv) 83 | { 84 | return LocalReallocArray(pv, cItems, ppv); 85 | } 86 | }; 87 | -------------------------------------------------------------------------------- /sdk/inc/GitPtr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | template 6 | class GitPtrSupportsAgile 7 | { 8 | public: 9 | GitPtrSupportsAgile() 10 | { 11 | } 12 | 13 | GitPtrSupportsAgile(const GitPtrSupportsAgile&) = default; 14 | GitPtrSupportsAgile(GitPtrSupportsAgile&&) noexcept = default; 15 | 16 | GitPtrSupportsAgile& operator=(const GitPtrSupportsAgile&) = default; 17 | GitPtrSupportsAgile& operator=(GitPtrSupportsAgile&&) noexcept = default; 18 | 19 | template 20 | HRESULT Initialize(TInterface* ptr) 21 | { 22 | Revoke(); 23 | HRESULT hr = S_OK; 24 | if (ptr) 25 | { 26 | Microsoft::WRL::ComPtr spAgileReference; 27 | hr = RoGetAgileReference(AGILEREFERENCE_DEFAULT, __uuidof(TInterface), ptr, &spAgileReference); 28 | if (SUCCEEDED(hr)) 29 | { 30 | _spAgileReference.Swap(spAgileReference); 31 | } 32 | } 33 | return hr; 34 | } 35 | 36 | bool IsInitialized() const 37 | { 38 | return _spAgileReference.Get() != nullptr; 39 | } 40 | 41 | HRESULT CopyLocal(REFIID riid, void** ptr) 42 | { 43 | HRESULT hr; 44 | Microsoft::WRL::ComPtr spAgileReference = _spAgileReference; 45 | if (spAgileReference.Get()) 46 | { 47 | hr = spAgileReference->Resolve(riid, ptr); 48 | } 49 | else 50 | { 51 | hr = E_INVALIDARG; 52 | *ptr = nullptr; 53 | } 54 | return hr; 55 | } 56 | 57 | template 58 | HRESULT CopyLocal(TDest** ptr) 59 | { 60 | return CopyLocal(__uuidof(TDest), reinterpret_cast(ptr)); 61 | } 62 | 63 | HRESULT Revoke() 64 | { 65 | _spAgileReference.Reset(); 66 | return S_OK; 67 | } 68 | 69 | protected: 70 | Microsoft::WRL::ComPtr _spAgileReference; 71 | }; 72 | -------------------------------------------------------------------------------- /sdk/inc/MarshaledInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include "AgileGitPtr.h" 9 | 10 | enum MARSHAL_KIND 11 | { 12 | MK_WEAK = 1, 13 | MK_STRONG = 2 14 | }; 15 | 16 | class CMarshaledInterface 17 | { 18 | public: 19 | CMarshaledInterface() 20 | { 21 | } 22 | 23 | template 24 | CMarshaledInterface(I* pI, MARSHAL_KIND mk) 25 | { 26 | Marshal(__uuidof(I), pI, mk); 27 | } 28 | 29 | CMarshaledInterface(const CMarshaledInterface& other) 30 | : m_marshal(other.m_marshal) 31 | { 32 | } 33 | 34 | CMarshaledInterface(CMarshaledInterface&& other) noexcept 35 | : m_marshal(std::move(other.m_marshal)) 36 | { 37 | } 38 | 39 | CMarshaledInterface& operator=(const CMarshaledInterface& other) 40 | { 41 | m_marshal = other.m_marshal; 42 | return *this; 43 | } 44 | 45 | CMarshaledInterface& operator=(CMarshaledInterface&& other) noexcept 46 | { 47 | m_marshal = std::move(other.m_marshal); 48 | return *this; 49 | } 50 | 51 | HRESULT Marshal(REFIID riid, IUnknown* punk, MARSHAL_KIND mk) 52 | { 53 | return MakeAndInitialize(&m_marshal, riid, punk, mk); 54 | } 55 | 56 | HRESULT Unmarshal(REFIID riid, void** ppv) 57 | { 58 | return _Unmarshal(riid, ppv, false); 59 | } 60 | 61 | HRESULT UnmarshalAndRelease(REFIID riid, void** ppv) 62 | { 63 | return _Unmarshal(riid, ppv, true); 64 | } 65 | 66 | void Release() 67 | { 68 | m_marshal.Reset(); 69 | } 70 | 71 | bool HasStream() const 72 | { 73 | return m_marshal.Get() != nullptr; 74 | } 75 | 76 | HRESULT AttachStream(IStream*, MSHLFLAGS); 77 | 78 | private: 79 | HRESULT _Unmarshal(REFIID riid, void** ppv, bool fRelease) 80 | { 81 | *ppv = nullptr; 82 | HRESULT hr = E_FAIL; 83 | if (m_marshal.Get()) 84 | { 85 | Microsoft::WRL::ComPtr spMarshal; 86 | if (!fRelease && m_marshal->CanUnmarshalMultipleTimes()) 87 | { 88 | spMarshal = m_marshal; 89 | } 90 | else 91 | { 92 | spMarshal.Attach(m_marshal.Detach()); 93 | } 94 | hr = spMarshal->Unmarshal(riid, ppv); 95 | } 96 | return hr; 97 | } 98 | 99 | class CMarshalStream : public Microsoft::WRL::RuntimeClass, IUnknown> 100 | { 101 | public: 102 | HRESULT RuntimeClassInitialize(IStream*); 103 | 104 | HRESULT RuntimeClassInitialize(REFIID riid, IUnknown* punk, MARSHAL_KIND mk) 105 | { 106 | m_marshalThreadId = GetCurrentThreadId(); 107 | m_marshalingKind = mk; 108 | 109 | if (CanUnmarshalMultipleTimes()) 110 | { 111 | return m_agileRef.Initialize(AGILEREFERENCE_DEFAULT, riid, punk); 112 | } 113 | else 114 | { 115 | return CoMarshalInterThreadInterfaceInStream(riid, punk, m_stream.ReleaseAndGetAddressOf()); 116 | } 117 | } 118 | 119 | ~CMarshalStream() override 120 | { 121 | if (m_stream.Get()) 122 | { 123 | if (m_marshalThreadId == GetCurrentThreadId()) 124 | { 125 | CoReleaseMarshalData(m_stream.Get()); 126 | m_stream.Reset(); 127 | } 128 | else 129 | { 130 | Microsoft::WRL::ComPtr spUnknown; 131 | CoGetInterfaceAndReleaseStream(m_stream.Detach(), IID_PPV_ARGS(&spUnknown)); 132 | } 133 | } 134 | } 135 | 136 | bool CanUnmarshalMultipleTimes() const 137 | { 138 | return m_marshalingKind == MK_STRONG; 139 | } 140 | 141 | HRESULT Unmarshal(REFIID riid, void** ppv) 142 | { 143 | *ppv = nullptr; 144 | 145 | if (CanUnmarshalMultipleTimes()) 146 | { 147 | return m_agileRef.CopyLocal(riid, ppv); 148 | } 149 | else 150 | { 151 | return CoGetInterfaceAndReleaseStream(m_stream.Detach(), riid, ppv); 152 | } 153 | } 154 | 155 | private: 156 | Microsoft::WRL::ComPtr m_stream; 157 | MARSHAL_KIND m_marshalingKind = MK_STRONG; 158 | AgileGitPtr m_agileRef; 159 | DWORD m_marshalThreadId = 0; 160 | }; 161 | 162 | Microsoft::WRL::ComPtr m_marshal; 163 | }; 164 | -------------------------------------------------------------------------------- /sdk/inc/NotificationDispatcher.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "NotificationDispatcher.h" 4 | 5 | #include "ResultUtils.h" 6 | 7 | using namespace Microsoft::WRL; 8 | 9 | typedef HWND (*SHCreateWorkerWindowW_t)(WNDPROC, HWND, DWORD, DWORD, HMENU, LONG_PTR); // 188 10 | HWND SHCreateWorkerWindowW(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle, DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra) 11 | { 12 | static SHCreateWorkerWindowW_t fn = nullptr; 13 | if (!fn) 14 | { 15 | HMODULE h = GetModuleHandleW(L"shcore.dll"); 16 | if (h) 17 | fn = (SHCreateWorkerWindowW_t)GetProcAddress(h, MAKEINTRESOURCEA(188)); 18 | } 19 | return fn ? fn(wndProc, hWndParent, dwExStyle, dwStyle, hMenu, wnd_extra) : (SetLastError(ERROR_PROC_NOT_FOUND), nullptr); 20 | } 21 | 22 | CNotificationDispatcherBase::CNotificationDispatcherBase() 23 | : _hwndMsgWindow(nullptr) 24 | , _fProcessNotifications(true) 25 | { 26 | } 27 | 28 | HRESULT CNotificationDispatcherBase::QueueNotification(IDispatchNotification* pNotification) 29 | { 30 | Wrappers::SRWLock::SyncLockExclusive lock = _srwLock.LockExclusive(); 31 | HRESULT hr = S_OK; 32 | 33 | if (_fProcessNotifications && _hwndMsgWindow) 34 | { 35 | hr = _srgPendingNotifications.Add(pNotification); 36 | if (SUCCEEDED(hr)) 37 | { 38 | PostMessageW(_hwndMsgWindow, 0x400, 0, 0); 39 | } 40 | } 41 | 42 | return hr; 43 | } 44 | 45 | void CNotificationDispatcherBase::StartProcessingNotifications() 46 | { 47 | Wrappers::SRWLock::SyncLockExclusive lock = _srwLock.LockExclusive(); 48 | _fProcessNotifications = true; 49 | } 50 | 51 | void CNotificationDispatcherBase::StopProcessingNotifications() 52 | { 53 | Wrappers::SRWLock::SyncLockExclusive lock = _srwLock.LockExclusive(); 54 | _fProcessNotifications = false; 55 | } 56 | 57 | HRESULT CNotificationDispatcherBase::RemoveBackReferences() 58 | { 59 | StopProcessingNotifications(); 60 | 61 | HWND hwndToDestroy = _hwndMsgWindow; 62 | { 63 | Wrappers::SRWLock::SyncLockExclusive lock = _srwLock.LockExclusive(); 64 | _hwndMsgWindow = nullptr; 65 | } 66 | if (hwndToDestroy) 67 | { 68 | DestroyWindow(hwndToDestroy); 69 | } 70 | 71 | return S_OK; 72 | } 73 | 74 | HRESULT CNotificationDispatcherBase::Initialize() 75 | { 76 | _hwndMsgWindow = SHCreateWorkerWindowW(s_WndProc, nullptr, 0, 0, nullptr, (LONG_PTR)this); 77 | return ResultFromWin32Bool(_hwndMsgWindow != nullptr); 78 | } 79 | 80 | bool CNotificationDispatcherBase::CanProcessWork() 81 | { 82 | return true; 83 | } 84 | 85 | CNotificationDispatcherBase::~CNotificationDispatcherBase() 86 | { 87 | } 88 | 89 | LRESULT CNotificationDispatcherBase::s_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 90 | { 91 | CNotificationDispatcherBase* pThis = (CNotificationDispatcherBase*)GetWindowLongPtrW(hwnd, 0); 92 | if (pThis && uMsg == 0x400 && hwnd == pThis->_hwndMsgWindow) 93 | { 94 | bool fHaveWork = true; 95 | while (fHaveWork && pThis->CanProcessWork()) 96 | { 97 | ComPtr spNotification; 98 | bool fProcessNotification = pThis->_fProcessNotifications; 99 | 100 | { 101 | Wrappers::SRWLock::SyncLockExclusive lock = pThis->_srwLock.LockExclusive(); 102 | if (pThis->_srgPendingNotifications._celem) 103 | { 104 | spNotification = pThis->_srgPendingNotifications._parray[0]; 105 | pThis->_srgPendingNotifications.RemoveAt(0); 106 | } 107 | else 108 | { 109 | fHaveWork = false; 110 | } 111 | } 112 | 113 | if (spNotification && fProcessNotification) 114 | { 115 | spNotification->Dispatch(); 116 | } 117 | } 118 | } 119 | 120 | return DefWindowProcW(hwnd, uMsg, wParam, lParam); 121 | } 122 | 123 | CNotificationDispatcher::CNotificationDispatcher() 124 | { 125 | } 126 | 127 | HRESULT CNotificationDispatcher::RuntimeClassInitialize() 128 | { 129 | return Initialize(); 130 | } 131 | 132 | HRESULT CNotificationDispatcher::GetForCurrentThread(INotificationDispatcher** ppDispatcher) 133 | { 134 | return E_NOTIMPL; // Function body unknown 135 | } 136 | -------------------------------------------------------------------------------- /sdk/inc/NotificationDispatcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include "SimpleArray.h" 9 | 10 | MIDL_INTERFACE("0dab9293-7fd8-4284-8559-d22bcbb2376e") 11 | IDispatchNotification : IUnknown 12 | { 13 | virtual void STDMETHODCALLTYPE Dispatch() PURE; 14 | }; 15 | 16 | MIDL_INTERFACE("961dafb3-fd25-4136-a1cc-523ee58e8ee8") 17 | INotificationDispatcher : IUnknown 18 | { 19 | virtual HRESULT STDMETHODCALLTYPE QueueNotification(IDispatchNotification*) PURE; 20 | virtual void STDMETHODCALLTYPE StartProcessingNotifications() PURE; 21 | virtual void STDMETHODCALLTYPE StopProcessingNotifications() PURE; 22 | }; 23 | 24 | class CNotificationDispatcherBase 25 | : public Microsoft::WRL::Implements 26 | , IObjectWithBackReferences 27 | , INotificationDispatcher 28 | > 29 | { 30 | public: 31 | CNotificationDispatcherBase(); 32 | 33 | //~ Begin INotificationDispatcher Interface 34 | STDMETHODIMP QueueNotification(IDispatchNotification* pNotification) override; 35 | STDMETHODIMP_(void) StartProcessingNotifications() override; 36 | STDMETHODIMP_(void) StopProcessingNotifications() override; 37 | //~ End INotificationDispatcher Interface 38 | 39 | //~ Begin IObjectWithBackReferences Interface 40 | STDMETHODIMP RemoveBackReferences() override; 41 | //~ End IObjectWithBackReferences Interface 42 | 43 | protected: 44 | HRESULT Initialize(); 45 | 46 | virtual bool CanProcessWork(); 47 | 48 | ~CNotificationDispatcherBase(); 49 | 50 | HWND _hwndMsgWindow; 51 | Microsoft::WRL::Wrappers::SRWLock _srwLock; 52 | bool _fProcessNotifications; 53 | 54 | private: 55 | static LRESULT CALLBACK s_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 56 | 57 | CCoSimpleArray> _srgPendingNotifications; 58 | }; 59 | 60 | class CNotificationDispatcher final 61 | : public Microsoft::WRL::RuntimeClass 62 | , CNotificationDispatcherBase 63 | , Microsoft::WRL::FtmBase 64 | > 65 | { 66 | public: 67 | CNotificationDispatcher(); 68 | 69 | // ReSharper disable once CppHidingFunction 70 | HRESULT RuntimeClassInitialize(); 71 | 72 | static HRESULT GetForCurrentThread(INotificationDispatcher** ppDispatcher); 73 | }; 74 | 75 | template 76 | FORCEINLINE HRESULT MakeNotificationDispatcher(I** ppDispatcher) 77 | { 78 | *ppDispatcher = nullptr; 79 | 80 | Microsoft::WRL::ComPtr spUnkDispatcher; 81 | HRESULT hr = MakeAndInitialize(&spUnkDispatcher); 82 | if (SUCCEEDED(hr)) 83 | { 84 | hr = spUnkDispatcher.CopyTo(ppDispatcher); 85 | } 86 | 87 | return hr; 88 | } 89 | 90 | template 91 | FORCEINLINE HRESULT MakeNotificationDispatcher(Microsoft::WRL::Details::ComPtrRef> ppvObject) 92 | { 93 | return MakeNotificationDispatcher(ppvObject.ReleaseAndGetAddressOf()); 94 | } 95 | 96 | template 97 | class CDispatchNotification final 98 | : public Microsoft::WRL::RuntimeClass 99 | , IDispatchNotification 100 | > 101 | { 102 | public: 103 | CDispatchNotification(const T& func) 104 | : _func(func) 105 | { 106 | } 107 | 108 | STDMETHODIMP_(void) Dispatch() override 109 | { 110 | _func(); 111 | } 112 | 113 | private: 114 | T _func; 115 | }; 116 | 117 | template 118 | HRESULT BeginInvoke(INotificationDispatcher* pDispatcher, const T& func) 119 | { 120 | Microsoft::WRL::ComPtr spDispatchNotification = Make>(func); 121 | HRESULT hr = spDispatchNotification.Get() ? S_OK : E_OUTOFMEMORY; 122 | if (SUCCEEDED(hr)) 123 | { 124 | hr = pDispatcher->QueueNotification(spDispatchNotification.Get()); 125 | } 126 | 127 | return hr; 128 | } 129 | -------------------------------------------------------------------------------- /sdk/inc/RefCountedObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | template 8 | class CRefCountedObject : public IUnknown, public T 9 | { 10 | public: 11 | template 12 | CRefCountedObject(TArgs&& ...args) 13 | : T(std::forward(args)...) 14 | , _cRef(0) 15 | { 16 | } 17 | 18 | virtual ~CRefCountedObject() 19 | { 20 | } 21 | 22 | STDMETHODIMP QueryInterface(REFIID riid, void** ppvObject) override 23 | { 24 | *ppvObject = nullptr; 25 | return E_NOTIMPL; 26 | } 27 | 28 | STDMETHODIMP_(ULONG) AddRef() override 29 | { 30 | return InterlockedIncrement(&_cRef); 31 | } 32 | 33 | STDMETHODIMP_(ULONG) Release() override 34 | { 35 | ULONG refCount = InterlockedDecrement(&_cRef); 36 | if (refCount == 0) 37 | delete this; 38 | return refCount; 39 | } 40 | 41 | ULONG _cRef; 42 | }; 43 | 44 | template 45 | Microsoft::WRL::ComPtr> CreateRefCountedObj(TArgs&& ...args) 46 | { 47 | return new(std::nothrow) CRefCountedObject(std::forward(args)...); 48 | } 49 | -------------------------------------------------------------------------------- /sdk/inc/ResultUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | inline HRESULT ResultFromWin32(__in DWORD dwErr) 6 | { 7 | return HRESULT_FROM_WIN32(dwErr); 8 | } 9 | 10 | inline HRESULT ResultFromLastError() 11 | { 12 | return ResultFromWin32(GetLastError()); 13 | } 14 | 15 | inline HRESULT ResultFromKnownLastError() 16 | { 17 | HRESULT hr = ResultFromLastError(); 18 | return (SUCCEEDED(hr) ? E_FAIL : hr); 19 | } 20 | 21 | inline HRESULT ResultFromWin32Bool(BOOL b) 22 | { 23 | return b ? S_OK : ResultFromKnownLastError(); 24 | } 25 | 26 | inline HRESULT ResultFromWin32Count(UINT cchResult, UINT cchBuffer) 27 | { 28 | return cchResult && cchResult <= cchBuffer ? S_OK : ResultFromWin32(ERROR_INSUFFICIENT_BUFFER); 29 | } 30 | -------------------------------------------------------------------------------- /sdk/inc/logonguids.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include 3 | #include "logonguids.h" 4 | -------------------------------------------------------------------------------- /sdk/inc/logonguids.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | DEFINE_GUID(CLSID_UserTileStore, 0x09C5DD34, 0x009D, 0x40FA, 0xBC, 0xB9, 0x01, 0x65, 0xAD, 0x0C, 0x15, 0xD4); 5 | 6 | DEFINE_GUID(CLSID_PasswordCredentialProvider, 0x60B78E88, 0xEAD8, 0x445C, 0x9C, 0xFD, 0x0B, 0x87, 0xF7, 0x4E, 0xA6, 0xCD); 7 | DEFINE_GUID(CLSID_CWLIDCredentialProvider, 0xF8A0B131, 0x5F68, 0x486C, 0x80, 0x40, 0x7E, 0x8F, 0xC3, 0xC8, 0x5B, 0xB6); 8 | DEFINE_GUID(CLSID_PicturePasswordCredentialProvider, 0x2135F72A, 0x90B5, 0x4ED3, 0xA7, 0xF1, 0x8B, 0xB7, 0x05, 0xAC, 0x27, 0x6A); 9 | 10 | DEFINE_GUID(POLID_HideFastUserSwitching, 0x572FD217, 0xF7FF, 0x479C, 0x8D, 0x96, 0xBC, 0x93, 0x8D, 0x68, 0x67, 0xF5); 11 | DEFINE_GUID(CLSID_AuthUIShutdownChoices, 0x14CE31DC, 0xABC2, 0x484C, 0xB0, 0x61, 0xCF, 0x34, 0x16, 0xAE, 0xD8, 0xFF); 12 | -------------------------------------------------------------------------------- /sdk/inc/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define CONSOLELOGON_FOR_rs2 0 4 | #define CONSOLELOGON_FOR_rs3 1 5 | #define CONSOLELOGON_FOR_rs4 2 6 | #define CONSOLELOGON_FOR_rs5 3 7 | #define CONSOLELOGON_FOR_19h1 4 8 | #define CONSOLELOGON_FOR_VB 5 9 | #define CONSOLELOGON_FOR_MN 6 10 | #define CONSOLELOGON_FOR_FE 7 11 | #define CONSOLELOGON_FOR_CO 8 12 | #define CONSOLELOGON_FOR_NI 9 13 | #define CONSOLELOGON_FOR_ZN 10 14 | #define CONSOLELOGON_FOR_GE 11 15 | 16 | #ifndef CONSOLELOGON_FOR 17 | //#define CONSOLELOGON_FOR CONSOLELOGON_FOR_NI 18 | //#define CONSOLELOGON_FOR CONSOLELOGON_FOR_VB 19 | //#define CONSOLELOGON_FOR CONSOLELOGON_FOR_VB 20 | #endif 21 | -------------------------------------------------------------------------------- /sdk/inc/wicutil.h: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "wincodec.h" 3 | #include 4 | 5 | enum LOAD_IMAGE_WITH_WIC_OPTION 6 | { 7 | LIWW_NONE, 8 | LIWW_ORIENTATE, 9 | LIWW_ORIENTATE_AND_CACHE, 10 | }; 11 | 12 | bool WICIsOrientationSupported(IWICBitmapDecoder* pDecoder); 13 | 14 | HRESULT WICGetTransformOptionFromMetadata(IWICMetadataQueryReader* pQueryReader, WICBitmapTransformOptions* pOptions); 15 | 16 | HRESULT WICCreateCachedOrientedBitmapSource( 17 | IWICImagingFactory* pFactory, 18 | IWICBitmapSource* pSourceBitmap, 19 | IWICMetadataQueryReader* pQueryReader, 20 | IWICBitmapSource** ppOutputBitmap); 21 | 22 | HRESULT WICCreateOrientedBitmapSource( 23 | IWICImagingFactory* pFactory, IWICBitmapSource* pSourceBitmap, IWICMetadataQueryReader* pQueryReader, 24 | IWICBitmapSource** ppOrientedBitmap); 25 | 26 | HRESULT WICOrientateFrame( 27 | IWICImagingFactory* pFactory, IWICBitmapDecoder* pDecoder, IWICBitmapFrameDecode* pFrameDecode, bool fCacheBitmap, 28 | IWICBitmapSource** ppOutputBitmap); 29 | 30 | HRESULT LoadImageWithWIC( 31 | IWICImagingFactory* pWICImagingFactory, IStream* pStream, LOAD_IMAGE_WITH_WIC_OPTION option, 32 | IWICBitmapSource** ppWICBitmapSource, IWICBitmapFrameDecode** ppWICBitmapFrameDecode, GUID* pguidContainerFormat); 33 | 34 | HRESULT LoadImageWithWIC( 35 | IWICImagingFactory* pWICImagingFactory, LPCWSTR pszPath, LOAD_IMAGE_WITH_WIC_OPTION option, 36 | IWICBitmapSource** ppWICBitmapSource, IWICBitmapFrameDecode** ppWICBitmapFrameDecode, GUID* pguidContainerFormat); 37 | 38 | HRESULT ConvertWICBitmapPixelFormat( 39 | IWICImagingFactory* pWICImagingFactory, IWICBitmapSource* pWICBitmapSource, GUID guidPixelFormatSource, 40 | WICBitmapDitherType bitmapDitherType, IWICBitmapSource** ppWICBitmapSource); 41 | 42 | HRESULT Convert32bppWICBitmapSourceToHBITMAP(IWICBitmapSource* pWICBitmapSource, HBITMAP* phbmBitmap); 43 | 44 | HRESULT ConvertWICBitmapToHBITMAP( 45 | IWICImagingFactory* pWICImagingFactory, IWICBitmapSource* pWICBitmapSource, HBITMAP* phbmImage); 46 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/dll/ConsoleLogon.def: -------------------------------------------------------------------------------- 1 | LIBRARY 2 | 3 | EXPORTS 4 | DllGetActivationFactory PRIVATE 5 | DllGetClassObject PRIVATE 6 | DllCanUnloadNow PRIVATE -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/dll/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Microsoft::WRL; 6 | 7 | #pragma region "Pattern search stuff" 8 | 9 | inline void SectionBeginAndSize(HMODULE hhh, const char* pszSectionName, PBYTE* beginSection, DWORD* sizeSection) 10 | { 11 | *beginSection = nullptr; 12 | *sizeSection = 0; 13 | 14 | PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)hhh; 15 | if (dosHeader->e_magic == IMAGE_DOS_SIGNATURE) 16 | { 17 | PIMAGE_NT_HEADERS64 ntHeader = (PIMAGE_NT_HEADERS64)((BYTE*)dosHeader + dosHeader->e_lfanew); 18 | if (ntHeader->Signature == IMAGE_NT_SIGNATURE) 19 | { 20 | PIMAGE_SECTION_HEADER firstSection = IMAGE_FIRST_SECTION(ntHeader); 21 | for (unsigned int i = 0; i < ntHeader->FileHeader.NumberOfSections; ++i) 22 | { 23 | PIMAGE_SECTION_HEADER section = firstSection + i; 24 | if (!strcmp((const char*)section->Name, pszSectionName)) 25 | { 26 | *beginSection = (PBYTE)dosHeader + section->VirtualAddress; 27 | *sizeSection = section->SizeOfRawData; 28 | break; 29 | } 30 | } 31 | } 32 | } 33 | } 34 | 35 | inline void TextSectionBeginAndSize(HMODULE hhh, PBYTE* beginSection, DWORD* sizeSection) 36 | { 37 | SectionBeginAndSize(hhh, ".text", beginSection, sizeSection); 38 | } 39 | 40 | inline BOOL MaskCompare(PVOID pBuffer, LPCSTR lpPattern, LPCSTR lpMask) 41 | { 42 | for (PBYTE value = (PBYTE)pBuffer; *lpMask; ++lpPattern, ++lpMask, ++value) 43 | { 44 | if (*lpMask == 'x' && *(LPCBYTE)lpPattern != *value) 45 | return FALSE; 46 | } 47 | 48 | return TRUE; 49 | } 50 | 51 | inline __declspec(noinline) PVOID FindPatternHelper(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask) 52 | { 53 | for (SIZE_T index = 0; index < dwSize; ++index) 54 | { 55 | PBYTE pAddress = (PBYTE)pBase + index; 56 | 57 | if (MaskCompare(pAddress, lpPattern, lpMask)) 58 | return pAddress; 59 | } 60 | 61 | return nullptr; 62 | } 63 | 64 | inline PVOID FindPattern(PVOID pBase, SIZE_T dwSize, LPCSTR lpPattern, LPCSTR lpMask) 65 | { 66 | dwSize -= strlen(lpMask); 67 | return FindPatternHelper(pBase, dwSize, lpPattern, lpMask); 68 | } 69 | 70 | #pragma endregion "Pattern search stuff" 71 | 72 | namespace Windows::Internal::ComTaskPool 73 | { 74 | volatile DWORD s_dwUniqueCallingContext = 0x80000000; 75 | volatile DWORD* p_s_dwThreadIdReuse; // Used in the actual code 76 | } 77 | 78 | DWORD WINAPI CUSTOM_SHTaskPoolGetUniqueContext() 79 | { 80 | return InterlockedIncrement(&Windows::Internal::ComTaskPool::s_dwUniqueCallingContext); 81 | } 82 | 83 | void WINAPI CUSTOM_SHTaskPoolAllowThreadReuse() 84 | { 85 | if (Windows::Internal::ComTaskPool::p_s_dwThreadIdReuse) 86 | *Windows::Internal::ComTaskPool::p_s_dwThreadIdReuse = GetCurrentThreadId(); 87 | } 88 | 89 | void TaskPool_InitFunctions() 90 | { 91 | HMODULE hShcore = LoadLibraryW(L"shcore.dll"); 92 | SHTaskPoolQueueTask = (decltype(SHTaskPoolQueueTask))GetProcAddress(hShcore, "SHTaskPoolQueueTask"); 93 | SHTaskPoolGetUniqueContext = (decltype(SHTaskPoolGetUniqueContext))GetProcAddress(hShcore, "SHTaskPoolGetUniqueContext"); 94 | SHTaskPoolAllowThreadReuse = (decltype(SHTaskPoolAllowThreadReuse))GetProcAddress(hShcore, "SHTaskPoolAllowThreadReuse"); 95 | 96 | PBYTE textBegin; 97 | DWORD textSize; 98 | TextSectionBeginAndSize(hShcore, &textBegin, &textSize); 99 | 100 | if (!SHTaskPoolQueueTask) 101 | { 102 | // HRESULT Windows::Internal::ComTaskPool::RunTask( 103 | // Windows::Internal::TaskApartment apartment, 104 | // Windows::Internal::TaskOptions options, 105 | // DWORD dwCallingContext, 106 | // DWORD dwMillisecondsFromNow, 107 | // Windows::Internal::IComPoolTask* pTask, 108 | // IUnknown** ppDelayedTask) 109 | // 44 8B C0 8B 0F 48 89 5C 24 ?? E8 ?? ?? ?? ?? 110 | // ^^^^^^^^^^^ 111 | // Ref: Windows::Internal::ComTaskPoolHandler::Start() 112 | // Arguments dwMillisecondsFromNow and ppDelayedTask are optimized out; always 0 and nullptr respectively 113 | #if defined(_M_X64) 114 | PBYTE matchRunTask = (PBYTE)FindPattern( 115 | textBegin, 116 | textSize, 117 | "\x44\x8B\xC0\x8B\x0F\x48\x89\x5C\x24\x00\xE8", 118 | "xxxxxxxxx?x" 119 | ); 120 | if (matchRunTask) 121 | { 122 | matchRunTask += 10; 123 | matchRunTask += 5 + *(int*)(matchRunTask + 1); 124 | } 125 | #else 126 | PBYTE matchRunTask = nullptr; 127 | #endif 128 | if (matchRunTask) 129 | { 130 | SHTaskPoolQueueTask = (decltype(SHTaskPoolQueueTask))matchRunTask; 131 | printf("Windows::Internal::ComTaskPool::RunTask() = shcore.dll+%" PRIXPTR "\n", (PBYTE)SHTaskPoolQueueTask - (PBYTE)hShcore); 132 | } 133 | FAIL_FAST_IF_NULL(SHTaskPoolQueueTask); 134 | } 135 | 136 | if (!SHTaskPoolGetUniqueContext) 137 | { 138 | SHTaskPoolGetUniqueContext = CUSTOM_SHTaskPoolGetUniqueContext; 139 | } 140 | } 141 | 142 | #if !defined(__WRL_CLASSIC_COM__) 143 | STDAPI DllGetActivationFactory(_In_ HSTRING activatibleClassId, _COM_Outptr_ IActivationFactory** factory) 144 | { 145 | return Module::GetModule().GetActivationFactory(activatibleClassId, factory); 146 | } 147 | #endif 148 | 149 | #if !defined(__WRL_WINRT_STRICT__) 150 | STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, _COM_Outptr_ void** ppv) 151 | { 152 | return Module::GetModule().GetClassObject(rclsid, riid, ppv); 153 | } 154 | #endif 155 | 156 | STDAPI DllCanUnloadNow() 157 | { 158 | return Module::GetModule().Terminate() ? S_OK : S_FALSE; 159 | } 160 | 161 | STDAPI_(BOOL) DllMain(_In_opt_ HINSTANCE hInstance, DWORD dwReason, _In_opt_ void* __formal) 162 | { 163 | if (dwReason == DLL_PROCESS_ATTACH) 164 | { 165 | DisableThreadLibraryCalls(hInstance); 166 | TaskPool_InitFunctions(); 167 | } 168 | return TRUE; 169 | } 170 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/dll/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/dll/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include "InternalAsync.h" 13 | #include "logoninterfaces.h" 14 | #include "NativeString.h" 15 | #include "RefCountedObject.h" 16 | #include "ResultUtils.h" 17 | #include "SimpleArray.h" 18 | 19 | #include "resource.h" 20 | #include "version.h" 21 | 22 | EXTERN_C IMAGE_DOS_HEADER __ImageBase; 23 | #define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase) 24 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/DefaultSelector.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "DefaultSelector.h" 4 | 5 | #include 6 | 7 | #include "duiutil.h" 8 | #include "logonguids.h" 9 | #include "windowscollections.h" 10 | 11 | using namespace Microsoft::WRL; 12 | 13 | HRESULT DefaultSelector::RuntimeClassInitialize(LC::IUserSettingManager* userSettingManager, LC::LogonUIRequestReason reason) 14 | { 15 | m_userSettingManager = userSettingManager; 16 | m_reason = reason; 17 | 18 | ComPtr> preferredProviders; 19 | RETURN_IF_FAILED(Windows::Foundation::Collections::Internal::AgileVector::Make(&preferredProviders)); // 29 20 | RETURN_IF_FAILED(preferredProviders->Vector::Append(CLSID_PasswordCredentialProvider)); // 30 21 | RETURN_IF_FAILED(preferredProviders->Vector::Append(CLSID_CWLIDCredentialProvider)); // 31 22 | RETURN_IF_FAILED(preferredProviders->Vector::GetView(&m_preferredProviders)); // 32 23 | 24 | ComPtr> excludedProviders; 25 | RETURN_IF_FAILED(Windows::Foundation::Collections::Internal::AgileVector::Make(&excludedProviders)); // 35 26 | RETURN_IF_FAILED(excludedProviders->Vector::Append(CLSID_PicturePasswordCredentialProvider)); // 36 27 | RETURN_IF_FAILED(excludedProviders->Vector::GetView(&m_excludedProviders)); // 37 28 | 29 | return S_OK; 30 | } 31 | 32 | HRESULT DefaultSelector::get_UseLastLoggedOnProvider(BOOLEAN* value) 33 | { 34 | *value = TRUE; 35 | return S_OK; 36 | } 37 | #if CONSOLELOGON_FOR >= CONSOLELOGON_FOR_19h1 38 | HRESULT DefaultSelector::get_PreferredProvidersDup(WFC::IVectorView** ppValue) 39 | { 40 | RETURN_IF_FAILED(m_preferredProviders.CopyTo(ppValue)); // 51 41 | return S_OK; 42 | } 43 | #endif 44 | HRESULT DefaultSelector::get_PreferredProviders(WFC::IVectorView** ppValue) 45 | { 46 | RETURN_IF_FAILED(m_preferredProviders.CopyTo(ppValue)); // 51 47 | return S_OK; 48 | } 49 | 50 | HRESULT DefaultSelector::get_ExcludedProviders(WFC::IVectorView** ppValue) 51 | { 52 | RETURN_IF_FAILED(m_excludedProviders.CopyTo(ppValue)); // 58 53 | return S_OK; 54 | } 55 | 56 | HRESULT DefaultSelector::get_DefaultUserSid(HSTRING* value) 57 | { 58 | RETURN_IF_FAILED(m_userSettingManager->get_UserSid(value)); // 64 59 | return S_OK; 60 | } 61 | 62 | HRESULT DefaultSelector::AllowAutoSubmitOnSelection(LCPD::IUser* user, BOOLEAN* value) 63 | { 64 | *value = TRUE; 65 | 66 | BOOL forceAutoLogon = FALSE; 67 | bool isForceAutoLogon = SUCCEEDED(SHRegGetBOOLWithREGSAM( 68 | HKEY_LOCAL_MACHINE, 69 | L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", 70 | L"ForceAutoLogon", 0, &forceAutoLogon)) && forceAutoLogon; 71 | 72 | bool isChangePassword = m_reason == LC::LogonUIRequestReason_LogonUIChange; 73 | 74 | BOOLEAN isFirstLogonAfterSignOutOrSwitchUser = FALSE; 75 | m_userSettingManager->get_IsFirstLogonAfterSignOutOrSwitchUser(&isFirstLogonAfterSignOutOrSwitchUser); 76 | 77 | BOOLEAN isUserLoggedOn = 0; 78 | RETURN_IF_FAILED(user->get_IsLoggedIn(&isUserLoggedOn)); // 77 79 | 80 | bool isLoggedOnUserPresentUnlockOrLogon = 81 | (m_reason == LC::LogonUIRequestReason_LogonUIUnlock || m_reason == LC::LogonUIRequestReason_LogonUILogon) && isUserLoggedOn; 82 | bool isRemoteSessionUserNotLoggedOn = GetSystemMetrics(SM_REMOTESESSION) && !isUserLoggedOn; 83 | 84 | *value = isForceAutoLogon 85 | || isChangePassword 86 | || (!isFirstLogonAfterSignOutOrSwitchUser && !isLoggedOnUserPresentUnlockOrLogon) 87 | || isRemoteSessionUserNotLoggedOn; 88 | return S_OK; 89 | } 90 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/DefaultSelector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | 5 | class DefaultSelector final 6 | : public Microsoft::WRL::RuntimeClass 7 | , LCPD::ICredProvDefaultSelector 8 | , Microsoft::WRL::FtmBase 9 | > 10 | { 11 | public: 12 | HRESULT RuntimeClassInitialize(LC::IUserSettingManager* userSettingManager, LC::LogonUIRequestReason reason); 13 | 14 | //~ Begin LCPD::ICredProvDefaultSelector Interface 15 | STDMETHODIMP get_UseLastLoggedOnProvider(BOOLEAN* value) override; 16 | #if CONSOLELOGON_FOR >= CONSOLELOGON_FOR_19h1 17 | STDMETHODIMP get_PreferredProvidersDup(WFC::IVectorView** ppValue) override; 18 | #endif 19 | STDMETHODIMP get_PreferredProviders(WFC::IVectorView** ppValue) override; 20 | STDMETHODIMP get_ExcludedProviders(WFC::IVectorView** ppValue) override; 21 | STDMETHODIMP get_DefaultUserSid(HSTRING* value) override; 22 | STDMETHODIMP AllowAutoSubmitOnSelection(LCPD::IUser* user, BOOLEAN* value) override; 23 | //~ End LCPD::ICredProvDefaultSelector Interface 24 | 25 | private: 26 | Microsoft::WRL::ComPtr> m_preferredProviders; 27 | Microsoft::WRL::ComPtr> m_excludedProviders; 28 | Microsoft::WRL::ComPtr m_userSettingManager; 29 | LC::LogonUIRequestReason m_reason; 30 | }; 31 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/EventDispatcher.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "EventDispatcher.h" 4 | 5 | using namespace Microsoft::WRL; 6 | 7 | HRESULT EventDispatcher::RuntimeClassInitialize(INotificationDispatcher* dispatcher) 8 | { 9 | m_dispatcher = dispatcher; 10 | return S_OK; 11 | } 12 | 13 | HRESULT EventDispatcher::DispatchEvent(LCPD::IDispatchEvent* dispatchEvent) 14 | { 15 | ComPtr dispatchEventRef = dispatchEvent; 16 | HRESULT hr = BeginInvoke(this->m_dispatcher.Get(), [dispatchEventRef]() -> void 17 | { 18 | dispatchEventRef->Dispatch(); 19 | }); 20 | RETURN_IF_FAILED(hr); // 28 21 | return S_OK; 22 | } 23 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/EventDispatcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | 5 | #include "NotificationDispatcher.h" 6 | 7 | class EventDispatcher final 8 | : public Microsoft::WRL::RuntimeClass 9 | , LCPD::IUIThreadEventDispatcher 10 | , Microsoft::WRL::FtmBase 11 | > 12 | { 13 | public: 14 | HRESULT RuntimeClassInitialize(INotificationDispatcher* dispatcher); 15 | 16 | //~ Begin LCPD::IUIThreadEventDispatcher Interface 17 | STDMETHODIMP DispatchEvent(LCPD::IDispatchEvent* dispatchEvent) override; 18 | //~ End LCPD::IUIThreadEventDispatcher Interface 19 | 20 | private: 21 | Microsoft::WRL::ComPtr m_dispatcher; 22 | }; 23 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/OptionalDependencyProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "optionaldependencyprovider.h" 4 | 5 | #include "DefaultSelector.h" 6 | 7 | using namespace Microsoft::WRL; 8 | 9 | class CredUXTelemetryProvider final 10 | : public Microsoft::WRL::RuntimeClass 11 | , LCPD::ITelemetryDataProvider 12 | , Microsoft::WRL::FtmBase 13 | > 14 | { 15 | public: 16 | CredUXTelemetryProvider(); 17 | ~CredUXTelemetryProvider(); 18 | 19 | HRESULT RuntimeClassInitialize(LC::LogonUIRequestReason reason); 20 | 21 | virtual HRESULT STDMETHODCALLTYPE GetUserAccountKind(HSTRING str, LCPD::UserAccountKind* kind) override; 22 | virtual HRESULT STDMETHODCALLTYPE get_CurrentLogonUIRequestReason(DWORD* reason) override; 23 | 24 | LC::LogonUIRequestReason m_reason; 25 | }; 26 | 27 | CredUXTelemetryProvider::CredUXTelemetryProvider() 28 | : m_reason(LC::LogonUIRequestReason_LogonUILogon) 29 | { 30 | } 31 | 32 | CredUXTelemetryProvider::~CredUXTelemetryProvider() 33 | { 34 | } 35 | 36 | HRESULT CredUXTelemetryProvider::RuntimeClassInitialize(LC::LogonUIRequestReason reason) 37 | { 38 | m_reason = reason; 39 | return S_OK; 40 | } 41 | 42 | HRESULT CredUXTelemetryProvider::GetUserAccountKind(HSTRING str, LCPD::UserAccountKind* kind) 43 | { 44 | if (!str) 45 | return S_OK; 46 | 47 | //TODO: add proper thing 48 | *kind = LCPD::UserAccountKind_Local; 49 | 50 | return S_OK; 51 | } 52 | 53 | HRESULT CredUXTelemetryProvider::get_CurrentLogonUIRequestReason(DWORD* reason) 54 | { 55 | *reason = m_reason; 56 | return S_OK; 57 | } 58 | 59 | HRESULT OptionalDependencyProvider::RuntimeClassInitialize( 60 | LC::LogonUIRequestReason reason, IInspectable* autoLogonManager, LC::IUserSettingManager* userSettingManager, 61 | LCPD::IDisplayStateProvider* displayStateProvider) 62 | { 63 | m_autoLogonManager = autoLogonManager; 64 | m_displayStateProvider = displayStateProvider; 65 | RETURN_IF_FAILED(MakeAndInitialize(&m_defaultSelector, userSettingManager, reason)); // 16 66 | //@Mod 67 | //RETURN_IF_FAILED(MakeAndInitialize(&m_telemetryProvider, reason)); 68 | RETURN_IF_FAILED(userSettingManager->get_TelemetryDataProvider(&m_telemetryProvider)); // 17 69 | return S_OK; 70 | } 71 | 72 | HRESULT OptionalDependencyProvider::GetOptionalDependency(LCPD::OptionalDependencyKind kind, IInspectable** value) 73 | { 74 | *value = nullptr; 75 | 76 | switch (kind) 77 | { 78 | case LCPD::OptionalDependencyKind_AutoLogonManager: 79 | RETURN_IF_FAILED(m_autoLogonManager.CopyTo(value)); // 27 80 | break; 81 | case LCPD::OptionalDependencyKind_DefaultSelector: 82 | RETURN_IF_FAILED(m_defaultSelector.CopyTo(value)); // 30 83 | break; 84 | case LCPD::OptionalDependencyKind_DisplayState: 85 | RETURN_IF_FAILED(m_displayStateProvider.CopyTo(value)); // 33 86 | break; 87 | case LCPD::OptionalDependencyKind_TelemetryData: 88 | RETURN_IF_FAILED(m_telemetryProvider.CopyTo(value)); // 36 89 | break; 90 | } 91 | 92 | return S_OK; 93 | } 94 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/advisablebutton.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "advisablebutton.h" 3 | 4 | #include "usertileelement.h" 5 | 6 | CAdvisableButton::CAdvisableButton() : m_index(-1) 7 | , m_owningElement(nullptr) 8 | , m_token(0) 9 | { 10 | } 11 | 12 | CAdvisableButton::~CAdvisableButton() 13 | { 14 | } 15 | 16 | HRESULT CAdvisableButton::Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, 17 | DirectUI::Element** ppElement) 18 | { 19 | return DirectUI::CreateAndInit(3, pParent, pdwDeferCookie, ppElement); 20 | } 21 | 22 | HRESULT CAdvisableButton::Advise(LCPD::ICredentialField* dataSource) 23 | { 24 | m_FieldInfo = dataSource; 25 | 26 | RETURN_IF_FAILED(m_FieldInfo->add_FieldChanged(this, &m_token)); // 19 27 | return S_OK; 28 | } 29 | 30 | HRESULT CAdvisableButton::UnAdvise() 31 | { 32 | if (m_FieldInfo) 33 | { 34 | RETURN_IF_FAILED(m_FieldInfo->remove_FieldChanged(m_token)); // 25 35 | 36 | m_FieldInfo.Reset(); 37 | } 38 | 39 | return S_OK; 40 | } 41 | 42 | void CAdvisableButton::OnDestroy() 43 | { 44 | Button::OnDestroy(); 45 | UnAdvise(); 46 | } 47 | 48 | void CAdvisableButton::OnEvent(DirectUI::Event* pEvent) 49 | { 50 | if (pEvent->nStage == DirectUI::GMF_DIRECT) 51 | { 52 | if (pEvent->uidType == DirectUI::Button::Click() || pEvent->uidType == DirectUI::Button::Context()) 53 | { 54 | Microsoft::WRL::ComPtr commandLinkField; 55 | if (m_FieldInfo.Get() && SUCCEEDED(m_FieldInfo->QueryInterface(IID_PPV_ARGS(&commandLinkField)))) 56 | { 57 | LOG_IF_FAILED(commandLinkField->Invoke()); 58 | } 59 | else 60 | { 61 | LOG_HR_MSG(E_FAIL,"m_FieldInfo->QueryInterface failed"); 62 | } 63 | } 64 | } 65 | 66 | Button::OnEvent(pEvent); 67 | } 68 | 69 | HRESULT CAdvisableButton::Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) 70 | { 71 | LOG_HR_MSG(E_FAIL,"CAdvisableButton::Invoke\n"); 72 | if (m_owningElement && m_owningElement->m_containersArray[m_index]) 73 | { 74 | CFieldWrapper* fieldData; 75 | m_owningElement->fieldsArray.GetAt(m_index,fieldData); 76 | 77 | bool bShouldUpdateString = false; 78 | 79 | if (args == LCPD::CredentialFieldChangeKind_State) 80 | { 81 | bool bOldVisibility = GetVisible(); 82 | m_owningElement->SetFieldVisibility(m_index,m_FieldInfo); 83 | if (bOldVisibility != GetVisible()) 84 | bShouldUpdateString = true; 85 | } 86 | else if (args == LCPD::CredentialFieldChangeKind_SetString) 87 | { 88 | //m_owningElement->SetFieldVisibility(m_owningElement->m_containersArray[m_index],fieldData); 89 | bShouldUpdateString = true; 90 | } 91 | if (bShouldUpdateString) 92 | { 93 | Microsoft::WRL::Wrappers::HString label; 94 | Microsoft::WRL::ComPtr commandLinkField; 95 | if (SUCCEEDED(m_FieldInfo->QueryInterface(IID_PPV_ARGS(&commandLinkField)))) 96 | { 97 | RETURN_IF_FAILED(commandLinkField->get_Content(label.ReleaseAndGetAddressOf())); 98 | bool bStyledAsButton = false; 99 | #if CONSOLELOGON_FOR >= CONSOLELOGON_FOR_19h1 100 | RETURN_IF_FAILED(commandLinkField->get_IsStyledAsButton(&bStyledAsButton)); 101 | #endif 102 | 103 | LOG_HR_MSG(E_FAIL,"bStyledAsButton %i", bStyledAsButton ? 1 : 0); 104 | } 105 | else 106 | RETURN_IF_FAILED(m_FieldInfo->get_Label(label.ReleaseAndGetAddressOf())); 107 | 108 | if (label.Length() > 0) 109 | { 110 | RETURN_IF_FAILED(SetContentString(label.GetRawBuffer(nullptr))); 111 | RETURN_IF_FAILED(SetAccName(label.GetRawBuffer(nullptr))); 112 | } 113 | } 114 | //m_owningElement->SetFieldInitialVisibility(m_owningElement->m_containersArray[m_index],fieldData); 115 | //LOG_HR_MSG(E_FAIL,"CAdvisableButton::Invoke SetFieldInitialVisibility\n"); 116 | } 117 | 118 | return S_OK; 119 | } 120 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/advisablebutton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "DirectUI/DirectUI.h" 4 | 5 | class CAdvisableButton : public DirectUI::Button 6 | , public Microsoft::WRL::RuntimeClass 7 | , WF::ITypedEventHandler 8 | > 9 | { 10 | public: 11 | 12 | CAdvisableButton(); 13 | CAdvisableButton(const CAdvisableButton& other) = delete; 14 | ~CAdvisableButton() override; 15 | 16 | CAdvisableButton& operator=(const CAdvisableButton&) = delete; 17 | 18 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 19 | 20 | HRESULT Advise(LCPD::ICredentialField* dataSource); 21 | HRESULT UnAdvise(); 22 | 23 | virtual void OnDestroy() override; 24 | void OnEvent(DirectUI::Event* pEvent) override; 25 | 26 | //~ Begin WF::ITypedEventHandler Interface 27 | STDMETHODIMP Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) override; 28 | //~ End WF::ITypedEventHandler Interface 29 | 30 | int m_index; 31 | class CDUIUserTileElement* m_owningElement; 32 | 33 | private: 34 | EventRegistrationToken m_token; 35 | Microsoft::WRL::ComPtr m_FieldInfo; 36 | }; 37 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/animationstrip.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "animationstrip.h" 3 | 4 | DirectUI::IClassInfo* CDUIAnimationStrip::Class = nullptr; 5 | 6 | CDUIAnimationStrip::~CDUIAnimationStrip() 7 | { 8 | if (m_imageList) 9 | ImageList_Destroy(m_imageList); 10 | 11 | DirectUI::Element::~Element(); 12 | } 13 | 14 | DirectUI::IClassInfo* CDUIAnimationStrip::GetClassInfoW() 15 | { 16 | return Class; 17 | } 18 | 19 | DirectUI::IClassInfo* CDUIAnimationStrip::GetClassInfoPtr() 20 | { 21 | return Class; 22 | } 23 | 24 | HRESULT CDUIAnimationStrip::Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, 25 | DirectUI::Element** ppElement) 26 | { 27 | return DirectUI::CreateAndInit(0, pParent, pdwDeferCookie, ppElement); 28 | } 29 | 30 | HRESULT CDUIAnimationStrip::Register() 31 | { 32 | return DirectUI::ClassInfo::RegisterGlobal(HINST_THISCOMPONENT, L"DUIAnimationStrip", nullptr, 0); 33 | } 34 | 35 | void CDUIAnimationStrip::OnPropertyChanged(const DirectUI::PropertyInfo* ppi, int iIndex, DirectUI::Value* pvOld, 36 | DirectUI::Value* pvNew) 37 | { 38 | if (m_imageList 39 | && ppi == DirectUI::Element::VisibleProp() 40 | && ppi->pData->_iIndex == iIndex) 41 | { 42 | if (pvNew->GetBool()) 43 | { 44 | Start(); 45 | } 46 | else if (m_action) 47 | { 48 | DeleteHandle(m_action); 49 | m_action = nullptr; 50 | } 51 | } 52 | DirectUI::Element::OnPropertyChanged(ppi, iIndex, pvOld, pvNew); 53 | } 54 | 55 | int g_fHighDPIAware = 0; 56 | int g_fHighDPI = 0; 57 | int g_iLPX = -1; 58 | int g_iLPY = -1; 59 | void InitDPI() 60 | { 61 | int v0 = IsProcessDPIAware(); 62 | if (g_iLPX == -1 || g_fHighDPIAware != v0) 63 | { 64 | g_fHighDPIAware = v0; 65 | HDC DC = GetDC(0LL); 66 | if (DC) 67 | { 68 | g_iLPX = GetDeviceCaps(DC, 88); 69 | int DeviceCaps = GetDeviceCaps(DC, 90); 70 | bool v2 = g_iLPX != 96; 71 | g_fHighDPI = v2; 72 | g_iLPY = DeviceCaps; 73 | ReleaseDC(nullptr, DC); 74 | } 75 | } 76 | } 77 | 78 | void __fastcall SHLogicalToPhysicalDPI(int* a1, int* a2) 79 | { 80 | InitDPI(); 81 | if (a1) 82 | *a1 = MulDiv(*a1, g_iLPX, 96); 83 | if (a2) 84 | *a2 = MulDiv(*a2, g_iLPY, 96); 85 | } 86 | 87 | void CDUIAnimationStrip::Paint(HDC hDC, const RECT* prcBounds, const RECT* prcInvalid, RECT* prcSkipBorder, 88 | RECT* prcSkipContent) 89 | { 90 | if (!m_imageList) 91 | { 92 | int resID; 93 | 94 | int cx_1 = 20; 95 | SHLogicalToPhysicalDPI(&cx_1, nullptr); 96 | int cx = cx_1; 97 | if (cx_1 == 20) 98 | { 99 | resID = IDB_SPINNER3; 100 | } 101 | else if (cx_1 == 25) 102 | { 103 | resID = IDB_SPINNER4; 104 | } 105 | else 106 | { 107 | resID = IDB_SPINNER5; 108 | if (cx_1 != 30) 109 | cx = 30; 110 | cx_1 = cx; 111 | } 112 | LoadFromResource(HINST_THISCOMPONENT, resID, cx); 113 | } 114 | if (m_imageList) 115 | { 116 | LONG bottom = 0; 117 | LONG right = 0; 118 | LONG left = 0; 119 | LONG top = 0; 120 | if (HasPadding()) 121 | { 122 | DirectUI::Value* Value = DirectUI::Element::GetValue(PaddingProp, 2, nullptr); 123 | RECT rect = *Value->GetRect(); 124 | Value->Release(); 125 | 126 | bottom = rect.bottom; 127 | right = rect.right; 128 | top = rect.top; 129 | left = rect.left; 130 | } 131 | 132 | int dx = prcBounds->right - prcBounds->left - right - left; 133 | int dy = prcBounds->bottom - prcBounds->top - bottom - top; 134 | if (dx > 0 && dy > 0) 135 | ImageList_DrawEx( 136 | m_imageList, 137 | m_index, 138 | hDC, 139 | left + prcBounds->left, 140 | prcBounds->top + top, 141 | dx, 142 | dy, 143 | 0xFFFFFFFF, 144 | 0xFFFFFFFF, 145 | 0x2020u); 146 | } 147 | } 148 | 149 | HRESULT CDUIAnimationStrip::Start() 150 | { 151 | int AnimationsEnabled = 1; 152 | 153 | SystemParametersInfoW(SPI_GETCLIENTAREAANIMATION, 0, &AnimationsEnabled, 0); 154 | if (AnimationsEnabled && !m_action && m_imageList) 155 | { 156 | GMA_ACTION v3; 157 | v3.cRepeat = -1; 158 | v3.cbSize = 40; 159 | v3.flDelay = 0.0; 160 | v3.flDuration = 10000.0f; 161 | v3.flPeriod = 0.0; 162 | v3.dwPause = 33; 163 | v3.pvData = this; 164 | v3.pfnProc = RawActionProc; 165 | m_action = CreateAction(&v3); 166 | } 167 | return m_action == nullptr ? E_FAIL : 0; 168 | } 169 | 170 | HRESULT CDUIAnimationStrip::LoadFromResource(HINSTANCE hInstance, int resID, int cX) 171 | { 172 | if (hInstance && resID && cX > 0) 173 | { 174 | if (m_imageList) 175 | ImageList_Destroy(m_imageList); 176 | 177 | m_imageList = ImageList_LoadImageW(hInstance, MAKEINTRESOURCEW(resID), cX, 0, 0xFF000000, 0, 0x2000u); 178 | if (m_imageList) 179 | { 180 | m_imageCount = ImageList_GetImageCount(m_imageList); 181 | Start(); 182 | return S_OK; 183 | } 184 | return E_OUTOFMEMORY; 185 | } 186 | return E_INVALIDARG; 187 | } 188 | 189 | void CDUIAnimationStrip::OnHosted(DirectUI::Element* peNewRoot) 190 | { 191 | DirectUI::Element::OnHosted(peNewRoot); 192 | if (GetVisible()) 193 | Start(); 194 | else if (m_action) 195 | { 196 | DeleteHandle(m_action); 197 | m_action = nullptr; 198 | } 199 | } 200 | 201 | void CDUIAnimationStrip::OnDestroy() 202 | { 203 | if (m_action) 204 | { 205 | DeleteHandle(m_action); 206 | m_action = nullptr; 207 | } 208 | DirectUI::Element::OnDestroy(); 209 | } 210 | 211 | void CDUIAnimationStrip::RawActionProc(GMA_ACTIONINFO* a1) 212 | { 213 | CDUIAnimationStrip* animStrip = (CDUIAnimationStrip*)a1->pvData; 214 | if (!a1->fFinished) 215 | { 216 | if (animStrip->m_imageList) 217 | { 218 | HGADGET gadget = animStrip->GetDisplayNode(); 219 | animStrip->m_index = (animStrip->m_index + 1) % animStrip->m_imageCount; 220 | InvalidateGadget(gadget); 221 | } 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/animationstrip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | 5 | #include "DirectUI/DirectUI.h" 6 | 7 | class CDUIAnimationStrip : public DirectUI::Element 8 | { 9 | public: 10 | 11 | ~CDUIAnimationStrip() override; 12 | 13 | static DirectUI::IClassInfo* Class; 14 | DirectUI::IClassInfo* GetClassInfoW() override; 15 | static DirectUI::IClassInfo* GetClassInfoPtr(); 16 | 17 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 18 | 19 | static HRESULT Register(); 20 | 21 | void OnPropertyChanged(const DirectUI::PropertyInfo* ppi, int iIndex, DirectUI::Value* pvOld, DirectUI::Value* pvNew) override; 22 | void Paint(HDC hDC, const RECT* prcBounds, const RECT* prcInvalid, RECT* prcSkipBorder, RECT* prcSkipContent) override; 23 | HRESULT Start(); 24 | HRESULT LoadFromResource(HINSTANCE a2, int resID, int cX); 25 | void OnHosted(DirectUI::Element* a2) override; 26 | void OnDestroy() override; 27 | 28 | static void RawActionProc(GMA_ACTIONINFO* a1); 29 | 30 | HANDLE m_action; 31 | HIMAGELIST m_imageList; 32 | DWORD m_imageCount; 33 | int m_index; 34 | }; 35 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/authuxlock.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "authuxlockaction.h" 4 | #include "duiutil.h" 5 | #include "logonframe.h" 6 | 7 | using namespace Microsoft::WRL; 8 | 9 | using namespace ABI::Windows::Foundation; 10 | using namespace Windows::Internal::UI::Logon::Controller; 11 | using namespace Windows::Internal::UI::Logon::CredProvData; 12 | 13 | //extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Internal_UI_Logon_Controller_ConsoleLockScreen[] = L"Windows.Internal.UI.Logon.Controller.ConsoleLockScreen"; 14 | extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Internal_UI_Logon_Controller_ConsoleLockScreen[] = L"Windows.Internal.UI.Logon.Controller.LockScreenHost"; 15 | 16 | class AuthUXLock final 17 | : public RuntimeClass 18 | , ILockScreenHost 19 | , FtmBase 20 | > 21 | { 22 | InspectableClass(RuntimeClass_Windows_Internal_UI_Logon_Controller_ConsoleLockScreen, FullTrust); 23 | 24 | public: 25 | AuthUXLock(); 26 | ~AuthUXLock() override; 27 | 28 | STDMETHODIMP ShowWebDialogAsync(HSTRING a1, void** a2) override; 29 | STDMETHODIMP LockAsync(LockOptions options, HSTRING domainName, HSTRING userName, HSTRING friendlyName, HSTRING unk, bool* setWin32kForegroundHardening, IUnlockTrigger** ppAction) override; 30 | STDMETHODIMP Reset() override; 31 | STDMETHODIMP PreShutdown() override; 32 | }; 33 | 34 | AuthUXLock::AuthUXLock() 35 | { 36 | } 37 | 38 | AuthUXLock::~AuthUXLock() 39 | { 40 | } 41 | 42 | HRESULT AuthUXLock::ShowWebDialogAsync(HSTRING a1, void** a2) 43 | { 44 | return S_OK; 45 | } 46 | 47 | HRESULT AuthUXLock::LockAsync(LockOptions options, HSTRING domainName, HSTRING userName, HSTRING friendlyName, HSTRING unk, 48 | bool* setWin32kForegroundHardening, IUnlockTrigger** ppAction) 49 | { 50 | *ppAction = nullptr; 51 | *setWin32kForegroundHardening = false; 52 | 53 | BOOL disableCAD = TRUE; 54 | RETURN_IF_FAILED(SHRegGetBOOLWithREGSAM(HKEY_LOCAL_MACHINE,L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",L"DisableCAD",0,&disableCAD)); 55 | RETURN_HR_IF(E_NOTIMPL, disableCAD == TRUE); 56 | 57 | RETURN_HR_IF(E_NOTIMPL, (options & LockOptions_SecureDesktop) == 0); 58 | 59 | RETURN_IF_FAILED(MakeAndInitialize(ppAction,domainName,userName,friendlyName)); // 36 60 | 61 | 62 | return S_OK; 63 | } 64 | 65 | HRESULT AuthUXLock::Reset() 66 | { 67 | return S_OK; 68 | } 69 | 70 | HRESULT AuthUXLock::PreShutdown() 71 | { 72 | return S_OK; 73 | } 74 | 75 | ActivatableClass(AuthUXLock); 76 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/authuxlockaction.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "authuxlockaction.h" 3 | 4 | const __declspec(selectany) _Null_terminated_ WCHAR ConsoleLockAsyncAction[] = L"Windows.Foundation.IAsyncAction Windows.Internal.UI.Logon.Controller.ConsoleLockAction"; 5 | 6 | AuthUXLockAction::AuthUXLockAction() 7 | { 8 | } 9 | 10 | AuthUXLockAction::~AuthUXLockAction() 11 | { 12 | } 13 | 14 | HRESULT AuthUXLockAction::RuntimeClassInitialize(HSTRING domainName, HSTRING userName, HSTRING friendlyName) 15 | { 16 | RETURN_IF_FAILED(m_domainName.Set(domainName)); // 16 17 | RETURN_IF_FAILED(m_userName.Set(userName)); // 17 18 | RETURN_IF_FAILED(m_friendlyName.Set(friendlyName)); // 18 19 | RETURN_IF_FAILED(Start()); // 19 20 | //RETURN_IF_FAILED(TriggerUnlock()); // 19 21 | 22 | return S_OK; 23 | } 24 | 25 | HRESULT AuthUXLockAction::TriggerUnlock() 26 | { 27 | RETURN_IF_FAILED(FireCompletion()); //26 28 | 29 | return S_OK; 30 | } 31 | 32 | HRESULT AuthUXLockAction::SyncBackstop() 33 | { 34 | return S_OK; 35 | } 36 | 37 | HRESULT AuthUXLockAction::CheckCompletion() 38 | { 39 | return S_OK; 40 | } 41 | 42 | HRESULT AuthUXLockAction::get_VisualOwner(LC::LockDisplayOwner* value) 43 | { 44 | *value = LC::LockDisplayOwner_LogonUX; 45 | return S_OK; 46 | } 47 | 48 | HRESULT AuthUXLockAction::get_DomainName(HSTRING* value) 49 | { 50 | *value = nullptr; 51 | if (m_domainName.IsEmpty()) 52 | return S_OK; 53 | 54 | RETURN_IF_FAILED(m_domainName.CopyTo(value)); // 47 55 | 56 | return S_OK; 57 | } 58 | 59 | HRESULT AuthUXLockAction::get_UserName(HSTRING* value) 60 | { 61 | *value = nullptr; 62 | if (m_userName.IsEmpty()) 63 | return S_OK; 64 | 65 | RETURN_IF_FAILED(m_userName.CopyTo(value)); // 57 66 | 67 | return S_OK; 68 | } 69 | 70 | HRESULT AuthUXLockAction::get_FriendlyName(HSTRING* value) 71 | { 72 | *value = nullptr; 73 | if (m_friendlyName.IsEmpty()) 74 | return S_OK; 75 | 76 | RETURN_IF_FAILED(m_friendlyName.CopyTo(value)); // 67 77 | 78 | return S_OK; 79 | } 80 | 81 | HRESULT AuthUXLockAction::get_RequireSecureGesture(bool* value) 82 | { 83 | *value = true; 84 | return S_OK; 85 | } 86 | 87 | HRESULT AuthUXLockAction::get_ShowSpeedBump(bool* value) 88 | { 89 | *value = false; 90 | return S_OK; 91 | } 92 | 93 | HRESULT AuthUXLockAction::get_RequireSecureGestureString(HSTRING* value) 94 | { 95 | *value = nullptr; 96 | return S_OK; 97 | } 98 | 99 | HRESULT AuthUXLockAction::get_SpeedBumpString(HSTRING* value) 100 | { 101 | *value = nullptr; 102 | return S_OK; 103 | } 104 | 105 | HRESULT AuthUXLockAction::get_IsLostMode(bool* value) 106 | { 107 | *value = false; 108 | return S_OK; 109 | } 110 | 111 | HRESULT AuthUXLockAction::get_LostModeMessage(HSTRING* value) 112 | { 113 | *value = nullptr; 114 | return S_OK; 115 | } 116 | 117 | HRESULT AuthUXLockAction::add_UserActivity(WF::ITypedEventHandler* handler, 118 | EventRegistrationToken* token) 119 | { 120 | token->value = 0; 121 | RETURN_IF_FAILED(m_userActivityEvent.Add(handler,token)); // 99 122 | 123 | return S_OK; 124 | } 125 | 126 | HRESULT AuthUXLockAction::remove_UserActivity(EventRegistrationToken token) 127 | { 128 | RETURN_IF_FAILED(m_userActivityEvent.Remove(token)); // 105 129 | return S_OK; 130 | } 131 | 132 | HRESULT AuthUXLockAction::put_Completed(WF::IAsyncOperationCompletedHandler* pRequestHandler) 133 | { 134 | RETURN_IF_FAILED(PutOnComplete(pRequestHandler)); // 112 135 | return S_OK; 136 | } 137 | 138 | HRESULT AuthUXLockAction::get_Completed(WF::IAsyncOperationCompletedHandler** ppRequestHandler) 139 | { 140 | *ppRequestHandler = nullptr; 141 | RETURN_IF_FAILED(GetOnComplete(ppRequestHandler)); // 119 142 | 143 | return S_OK; 144 | } 145 | 146 | HRESULT AuthUXLockAction::GetResults(HSTRING* results) 147 | { 148 | return S_OK; 149 | } 150 | 151 | HRESULT AuthUXLockAction::OnStart() 152 | { 153 | return S_OK; 154 | } 155 | 156 | void AuthUXLockAction::OnClose() 157 | { 158 | } 159 | 160 | void AuthUXLockAction::OnCancel() 161 | { 162 | FireCompletion(); 163 | } 164 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/authuxlockaction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "InternalAsync.h" 4 | 5 | extern const __declspec(selectany) _Null_terminated_ WCHAR ConsoleLockAsyncAction[]; 6 | 7 | class AuthUXLockAction 8 | : public Microsoft::WRL::RuntimeClass 9 | ,LC::IUnlockTrigger 10 | ,LC::ILockInfo 11 | ,WF::IAsyncOperation 12 | ,WI::AsyncBaseFTM 13 | , Microsoft::WRL::SingleResult 14 | , Microsoft::WRL::AsyncOptions> 15 | > 16 | { 17 | public: 18 | AuthUXLockAction(); 19 | ~AuthUXLockAction() override; 20 | 21 | HRESULT STDMETHODCALLTYPE RuntimeClassInitialize(HSTRING domainName, HSTRING userName, HSTRING friendlyName); 22 | HRESULT STDMETHODCALLTYPE TriggerUnlock() override; 23 | HRESULT STDMETHODCALLTYPE SyncBackstop() override; 24 | HRESULT STDMETHODCALLTYPE CheckCompletion() override; 25 | HRESULT STDMETHODCALLTYPE get_VisualOwner(LC::LockDisplayOwner* value) override; 26 | HRESULT STDMETHODCALLTYPE get_DomainName(HSTRING* value) override; 27 | HRESULT STDMETHODCALLTYPE get_UserName(HSTRING* value) override; 28 | HRESULT STDMETHODCALLTYPE get_FriendlyName(HSTRING* value) override; 29 | HRESULT STDMETHODCALLTYPE get_RequireSecureGesture(bool* value) override; 30 | HRESULT STDMETHODCALLTYPE get_ShowSpeedBump(bool* value) override; 31 | HRESULT STDMETHODCALLTYPE get_RequireSecureGestureString(HSTRING* value) override; 32 | HRESULT STDMETHODCALLTYPE get_SpeedBumpString(HSTRING* value) override; 33 | HRESULT STDMETHODCALLTYPE get_IsLostMode(bool* value) override; 34 | HRESULT STDMETHODCALLTYPE get_LostModeMessage(HSTRING* value) override; 35 | HRESULT STDMETHODCALLTYPE add_UserActivity(WF::ITypedEventHandler* handler, EventRegistrationToken* token) override; 36 | HRESULT STDMETHODCALLTYPE remove_UserActivity(EventRegistrationToken token) override; 37 | HRESULT STDMETHODCALLTYPE put_Completed(WF::IAsyncOperationCompletedHandler* pRequestHandler) override; 38 | HRESULT STDMETHODCALLTYPE get_Completed(WF::IAsyncOperationCompletedHandler** ppRequestHandler) override; 39 | HRESULT STDMETHODCALLTYPE GetResults(HSTRING* results) override; 40 | HRESULT OnStart() override; 41 | void OnClose() override; 42 | void OnCancel() override; 43 | private: 44 | Microsoft::WRL::Wrappers::HString m_domainName; 45 | Microsoft::WRL::Wrappers::HString m_userName; 46 | Microsoft::WRL::Wrappers::HString m_friendlyName; 47 | Microsoft::WRL::EventSource> m_userActivityEvent; 48 | }; 49 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/backgroundfetcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | class CBackground 5 | { 6 | public: 7 | 8 | static HRESULT GetButtonSet(UINT* buttonSet); 9 | static HRESULT GetBackground(HBITMAP* bitmap); 10 | 11 | private: 12 | static bool _UseOEMBackground(); 13 | }; 14 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/combobox.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "combobox.h" 3 | 4 | #include "usertileelement.h" 5 | 6 | DirectUI::IClassInfo* CDUIComboBox::Class = nullptr; 7 | 8 | CDUIComboBox::CDUIComboBox() : m_selection(-1) 9 | { 10 | 11 | } 12 | 13 | CDUIComboBox::~CDUIComboBox() 14 | { 15 | for (size_t i = 0; i < m_stringArray.GetSize(); ++i) 16 | { 17 | DirectUI::HFree((void*)m_stringArray[i]); 18 | } 19 | 20 | DirectUI::Combobox::~Combobox(); 21 | } 22 | 23 | DirectUI::IClassInfo* CDUIComboBox::GetClassInfoW() 24 | { 25 | return Class; 26 | } 27 | 28 | DirectUI::IClassInfo* CDUIComboBox::GetClassInfoPtr() 29 | { 30 | return Class; 31 | } 32 | 33 | HRESULT CDUIComboBox::Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement) 34 | { 35 | return DirectUI::CreateAndInit(3, pParent, pdwDeferCookie, ppElement); 36 | } 37 | 38 | HRESULT CDUIComboBox::Register() 39 | { 40 | return DirectUI::ClassInfo::RegisterGlobal(HINST_THISCOMPONENT, L"DUIComboBox", nullptr, 0); 41 | } 42 | 43 | HRESULT CDUIComboBox::Advise(LCPD::ICredentialField* dataSource) 44 | { 45 | m_FieldInfo = dataSource; 46 | 47 | RETURN_IF_FAILED(m_FieldInfo->add_FieldChanged(this, &m_token)); // 19 48 | 49 | Microsoft::WRL::ComPtr comboBoxField; 50 | RETURN_IF_FAILED(dataSource->QueryInterface(IID_PPV_ARGS(&comboBoxField))); 51 | 52 | Microsoft::WRL::ComPtr> observableItems; 53 | RETURN_IF_FAILED(comboBoxField->get_Items(&observableItems)); 54 | 55 | RETURN_IF_FAILED(observableItems->add_VectorChanged(this, &m_itemsChangedToken)); 56 | 57 | return S_OK; 58 | } 59 | 60 | HRESULT CDUIComboBox::UnAdvise() 61 | { 62 | if (m_FieldInfo) 63 | { 64 | RETURN_IF_FAILED(m_FieldInfo->remove_FieldChanged(m_token)); // 25 65 | 66 | m_FieldInfo.Reset(); 67 | } 68 | 69 | return S_OK; 70 | } 71 | 72 | void CDUIComboBox::OnDestroy() 73 | { 74 | Combobox::OnDestroy(); 75 | UnAdvise(); 76 | } 77 | 78 | void CDUIComboBox::OnEvent(DirectUI::Event* pEvent) 79 | { 80 | if (pEvent->nStage == DirectUI::GMF_DIRECT && pEvent->uidType == DirectUI::Combobox::SelectionChange()) 81 | { 82 | SelectionIndexChangeEvent* selEvent = (SelectionIndexChangeEvent*)pEvent; 83 | if (m_FieldInfo.Get()) 84 | { 85 | Microsoft::WRL::ComPtr comboBoxField; 86 | if (SUCCEEDED(m_FieldInfo->QueryInterface(IID_PPV_ARGS(&comboBoxField)))) 87 | { 88 | LOG_IF_FAILED(comboBoxField->put_SelectedIndex(selEvent->newIndex)); 89 | } 90 | else 91 | { 92 | LOG_HR_MSG(E_FAIL,"Failed to query comboboxfield"); 93 | } 94 | } 95 | } 96 | 97 | Combobox::OnEvent(pEvent); 98 | } 99 | 100 | HRESULT CDUIComboBox::Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) 101 | { 102 | LOG_HR_MSG(E_FAIL,"CDUIComboBox::Invoke\n"); 103 | if (m_owningElement && m_owningElement->m_containersArray[m_index]) 104 | { 105 | CFieldWrapper* fieldData; 106 | m_owningElement->fieldsArray.GetAt(m_index,fieldData); 107 | 108 | bool bShouldUpdateString = false; 109 | 110 | if (args == LCPD::CredentialFieldChangeKind_State) 111 | { 112 | bool bOldVisibility = GetVisible(); 113 | m_owningElement->SetFieldVisibility(m_index,m_FieldInfo); 114 | if (bOldVisibility != GetVisible()) 115 | bShouldUpdateString = true; 116 | } 117 | else if (args == LCPD::CredentialFieldChangeKind_SetString || args == LCPD::CredentialFieldChangeKind_SetComboBoxSelected) 118 | { 119 | //m_owningElement->SetFieldVisibility(m_owningElement->m_containersArray[m_index],fieldData); 120 | bShouldUpdateString = true; 121 | } 122 | if (bShouldUpdateString) 123 | { 124 | RETURN_IF_FAILED(Rebuild()); 125 | } 126 | //m_owningElement->SetFieldInitialVisibility(m_owningElement->m_containersArray[m_index],fieldData); 127 | //LOG_HR_MSG(E_FAIL,"CDUIComboBox::Invoke SetFieldInitialVisibility\n"); 128 | } 129 | 130 | return S_OK; 131 | } 132 | 133 | HRESULT CDUIComboBox::Invoke(WFC::IObservableVector* sender, WFC::IVectorChangedEventArgs* args) 134 | { 135 | LOG_HR_MSG(E_FAIL,"CDUIComboBox::Invoke VectorChangedEvent\n"); 136 | RETURN_IF_FAILED(Rebuild()); 137 | return S_OK; 138 | } 139 | 140 | HRESULT CDUIComboBox::SetSelectionEx(int newSelection) 141 | { 142 | LOG_HR_MSG(E_FAIL,"CDUIComboBox::SetSelectionEx %i\n",newSelection); 143 | if (GetHWND()) 144 | { 145 | SetSelection(9999); 146 | return SetSelection(newSelection); 147 | } 148 | 149 | m_selection = newSelection; 150 | 151 | return S_OK; 152 | } 153 | 154 | HRESULT StringStringAllocCopy(const wchar_t* Src, const wchar_t** a2) 155 | { 156 | const wchar_t* newString = (const wchar_t*)DirectUI::HAlloc((wcslen(Src)+1)*2); 157 | memcpy((void*)newString,Src, (wcslen(Src) + 1) * 2); 158 | *a2 = newString; 159 | return S_OK; 160 | } 161 | 162 | int CDUIComboBox::AddStringEx(const wchar_t* String) 163 | { 164 | if (GetHWND()) 165 | return AddString((unsigned short const*)String); 166 | 167 | const wchar_t* newString = nullptr; 168 | if (SUCCEEDED(StringStringAllocCopy(String, &newString))) 169 | { 170 | if (FAILED(m_stringArray.Add(newString))) 171 | return -1; 172 | 173 | return m_stringArray.GetSize() - 1; 174 | } 175 | 176 | return -1; 177 | } 178 | 179 | void CDUIComboBox::ClearCombobox() 180 | { 181 | for (size_t i = 0; i < m_stringArray.GetSize(); ++i) 182 | { 183 | DirectUI::HFree((void*)m_stringArray[i]); 184 | } 185 | m_stringArray.RemoveAll(); 186 | 187 | if (HWND hwnd = GetHWND()) 188 | SendMessage(hwnd,CB_RESETCONTENT,0,0); 189 | } 190 | 191 | HRESULT CDUIComboBox::Build() 192 | { 193 | Microsoft::WRL::ComPtr comboBoxField; 194 | RETURN_IF_FAILED(m_FieldInfo->QueryInterface(IID_PPV_ARGS(&comboBoxField))); 195 | 196 | Microsoft::WRL::ComPtr> observableItems; 197 | RETURN_IF_FAILED(comboBoxField->get_Items(&observableItems)); 198 | 199 | Microsoft::WRL::ComPtr> items; 200 | RETURN_IF_FAILED(observableItems.As>(&items)); 201 | 202 | UINT numItems; 203 | RETURN_IF_FAILED(items->get_Size(&numItems)); 204 | LOG_HR_MSG(E_FAIL,"Creating checkbox field"); 205 | for (int i = 0; i < numItems; ++i) 206 | { 207 | Microsoft::WRL::Wrappers::HString item; 208 | RETURN_IF_FAILED(items->GetAt(i,item.ReleaseAndGetAddressOf())); 209 | RETURN_HR_IF(E_FAIL, AddStringEx(item.GetRawBuffer(nullptr)) == -1); 210 | 211 | LOG_HR_MSG(E_FAIL,"checkbox field item %i %s\n",i, item.GetRawBuffer(nullptr)); 212 | } 213 | 214 | int initialSelection; 215 | RETURN_IF_FAILED(comboBoxField->get_SelectedIndex(&initialSelection)); 216 | 217 | RETURN_IF_FAILED(SetSelectionEx(initialSelection)); 218 | 219 | return S_OK; 220 | } 221 | 222 | HRESULT CDUIComboBox::Rebuild() 223 | { 224 | ClearCombobox(); 225 | RETURN_IF_FAILED(Build()); 226 | return S_OK; 227 | } 228 | 229 | void CDUIComboBox::OnHosted(DirectUI::Element* peNewHost) 230 | { 231 | bool initiallyNullHWND = GetHWND() == nullptr; 232 | DirectUI::Combobox::OnHosted(peNewHost); 233 | 234 | if (initiallyNullHWND && GetHWND()) 235 | { 236 | for (size_t i = 0; i < m_stringArray.GetSize(); ++i) 237 | { 238 | if (AddStringEx(m_stringArray[i]) == -1) 239 | return; 240 | } 241 | } 242 | 243 | m_stringArray.RemoveAll(); 244 | 245 | if (m_selection != -1) 246 | SetSelectionEx(m_selection); 247 | } 248 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/combobox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | #include "DirectUI/DirectUI.h" 5 | 6 | struct SelectionIndexChangeEvent : DirectUI::Event 7 | { 8 | int oldIndex; 9 | int newIndex; 10 | }; 11 | 12 | class CDUIComboBox : public DirectUI::Combobox 13 | , public Microsoft::WRL::RuntimeClass 14 | , WF::ITypedEventHandler 15 | , WFC::VectorChangedEventHandler 16 | > 17 | { 18 | public: 19 | CDUIComboBox(); 20 | CDUIComboBox(const CDUIComboBox& other) = delete; 21 | ~CDUIComboBox() override; 22 | 23 | CDUIComboBox& operator=(const CDUIComboBox&) = delete; 24 | 25 | static DirectUI::IClassInfo* Class; 26 | DirectUI::IClassInfo* GetClassInfoW() override; 27 | static DirectUI::IClassInfo* GetClassInfoPtr(); 28 | 29 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 30 | 31 | static HRESULT Register(); 32 | 33 | HRESULT Advise(LCPD::ICredentialField* dataSource); 34 | HRESULT UnAdvise(); 35 | 36 | virtual void OnDestroy() override; 37 | void OnEvent(DirectUI::Event* pEvent) override; 38 | 39 | //~ Begin WF::ITypedEventHandler Interface 40 | HRESULT STDMETHODCALLTYPE Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) override; 41 | //~ End WF::ITypedEventHandler Interface 42 | 43 | //~ Begin WFC::VectorChangedEventHandler Interface 44 | STDMETHODIMP Invoke(WFC::IObservableVector* sender, WFC::IVectorChangedEventArgs* args) override; 45 | //~ End WFC::VectorChangedEventHandler Interface 46 | 47 | HRESULT SetSelectionEx(int newSelection); 48 | int AddStringEx(const wchar_t* String); 49 | 50 | void ClearCombobox(); 51 | HRESULT Build(); 52 | HRESULT Rebuild(); 53 | 54 | void OnHosted(DirectUI::Element* peNewHost) override; 55 | 56 | CCoSimpleArray m_stringArray; //@mod, use CCoSimpleArray instead of hdpa 57 | int m_selection; 58 | 59 | int m_index; 60 | class CDUIUserTileElement* m_owningElement; 61 | 62 | private: 63 | EventRegistrationToken m_token; 64 | EventRegistrationToken m_itemsChangedToken; 65 | Microsoft::WRL::ComPtr m_FieldInfo; 66 | }; 67 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/consolebsdrstub.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | using namespace Microsoft::WRL; 4 | 5 | using namespace ABI::Windows::Foundation; 6 | using namespace Windows::Internal::UI::Logon::Controller; 7 | using namespace Windows::Internal::UI::Logon::CredProvData; 8 | 9 | //extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Internal_UI_Logon_Controller_ConsoleBlockedShutdownResolver[] = L"Windows.Internal.UI.Logon.Controller.ConsoleBlockedShutdownResolver"; 10 | extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Internal_UI_Logon_Controller_ConsoleBlockedShutdownResolver[] = L"Windows.Internal.UI.Logon.Controller.BlockedShutdownResolverUX"; 11 | 12 | class ConsoleBSDRStub 13 | : public RuntimeClass 14 | , IBlockedShutdownResolverUX 15 | , FtmBase 16 | > 17 | { 18 | InspectableClass(RuntimeClass_Windows_Internal_UI_Logon_Controller_ConsoleBlockedShutdownResolver, FullTrust); 19 | 20 | public: 21 | ConsoleBSDRStub(); 22 | ~ConsoleBSDRStub() override; 23 | 24 | HRESULT STDMETHODCALLTYPE Start(IUserSettingManager* settingsManager, ILogonUIStateInfo* stateInfo) override; 25 | HRESULT STDMETHODCALLTYPE get_ScaleFactor(UINT* value) override; 26 | HRESULT STDMETHODCALLTYPE get_WasClicked(bool* value) override; 27 | HRESULT STDMETHODCALLTYPE AddApplication(IShutdownBlockingApp* blockingApp) override; 28 | HRESULT STDMETHODCALLTYPE RemoveApplication(UINT appid) override; 29 | HRESULT STDMETHODCALLTYPE add_Resolved(ITypedEventHandler* handler, EventRegistrationToken* token) override; 30 | HRESULT STDMETHODCALLTYPE remove_Resolved(EventRegistrationToken token) override; 31 | HRESULT STDMETHODCALLTYPE Hide() override; 32 | HRESULT STDMETHODCALLTYPE Stop() override; 33 | private: 34 | EventSource> _Resolved; 35 | 36 | }; 37 | 38 | ConsoleBSDRStub::ConsoleBSDRStub() 39 | { 40 | } 41 | 42 | ConsoleBSDRStub::~ConsoleBSDRStub() 43 | { 44 | } 45 | 46 | HRESULT ConsoleBSDRStub::Start(IUserSettingManager* settingsManager, ILogonUIStateInfo* stateInfo) 47 | { 48 | return S_OK; 49 | } 50 | 51 | HRESULT ConsoleBSDRStub::get_ScaleFactor(UINT* value) 52 | { 53 | *value = 100; 54 | return S_OK; 55 | } 56 | 57 | HRESULT ConsoleBSDRStub::get_WasClicked(bool* value) 58 | { 59 | *value = false; 60 | return S_OK; 61 | } 62 | 63 | HRESULT ConsoleBSDRStub::AddApplication(IShutdownBlockingApp* blockingApp) 64 | { 65 | return _Resolved.InvokeAll(this, BlockedShutdownResolution_Force); 66 | } 67 | 68 | HRESULT ConsoleBSDRStub::RemoveApplication(UINT appid) 69 | { 70 | return _Resolved.InvokeAll(this, BlockedShutdownResolution_Force); 71 | } 72 | 73 | HRESULT ConsoleBSDRStub::add_Resolved( 74 | ITypedEventHandler* handler, EventRegistrationToken* token) 75 | { 76 | token->value = 0; 77 | 78 | return _Resolved.Add(handler,token); 79 | } 80 | 81 | HRESULT ConsoleBSDRStub::remove_Resolved(EventRegistrationToken token) 82 | { 83 | return _Resolved.Remove(token); 84 | } 85 | 86 | HRESULT ConsoleBSDRStub::Hide() 87 | { 88 | return S_OK; 89 | } 90 | 91 | HRESULT ConsoleBSDRStub::Stop() 92 | { 93 | return S_OK; 94 | } 95 | 96 | ActivatableClass(ConsoleBSDRStub); 97 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/consoleuimanager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "consoleuimanager.h" 4 | 5 | #include "animationstrip.h" 6 | #include "combobox.h" 7 | #include "labeledcheckbox.h" 8 | #include "logonframe.h" 9 | #include "restrictededit.h" 10 | #include "DirectUI/DirectUI.h" 11 | #include "ShellScalingApi.h" 12 | #include "zoomableelement.h" 13 | 14 | using namespace Microsoft::WRL; 15 | 16 | ConsoleUIManager::ConsoleUIManager() 17 | : m_UIThreadInitResult(E_FAIL) 18 | { 19 | } 20 | 21 | HRESULT ConsoleUIManager::Initialize() 22 | { 23 | // m_UIThreadQuitEvent = nullptr; // @MOD Don't need this line 24 | m_UIThreadQuitEvent.reset(CreateEventExW(nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS)); 25 | return m_UIThreadQuitEvent ? S_OK : ResultFromKnownLastError(); 26 | } 27 | 28 | HRESULT ConsoleUIManager::StartUI() 29 | { 30 | auto scopeExit = wil::scope_exit([this]() -> void { StopUI(); }); 31 | 32 | Wrappers::SRWLock::SyncLockExclusive lock = m_lock.LockExclusive(); 33 | 34 | if (!m_UIThreadHandle) 35 | { 36 | wil::unique_handle quitEvent(CreateEventExW(nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS)); 37 | RETURN_LAST_ERROR_IF_NULL(quitEvent); // 43 38 | 39 | m_UIThreadQuitEvent = std::move(quitEvent); 40 | 41 | RETURN_IF_WIN32_BOOL_FALSE(SHCreateThreadWithHandle( 42 | s_UIThreadHostThreadProc, 43 | this, 44 | CTF_COINIT, 45 | s_UIThreadHostStartThreadProc, 46 | &m_UIThreadHandle)); // 52 47 | } 48 | 49 | scopeExit.release(); 50 | return S_OK; 51 | } 52 | 53 | HRESULT ConsoleUIManager::StopUI() 54 | { 55 | Wrappers::SRWLock::SyncLockExclusive lock = m_lock.LockExclusive(); 56 | if (m_UIThreadHandle) 57 | { 58 | SetEvent(m_UIThreadQuitEvent.get()); 59 | 60 | DWORD dwIndex = 0; 61 | CoWaitForMultipleHandles(COWAIT_ALERTABLE | COWAIT_DISPATCH_CALLS | COWAIT_DISPATCH_WINDOW_MESSAGES, INFINITE, 1, m_UIThreadHandle.addressof(), &dwIndex); 62 | m_UIThreadHandle.reset(); 63 | 64 | ResetEvent(m_UIThreadQuitEvent.get()); 65 | m_UIThreadInitResult = E_FAIL; 66 | } 67 | 68 | return S_OK; 69 | } 70 | 71 | HRESULT ConsoleUIManager::EnsureUIStarted() 72 | { 73 | RETURN_HR_IF(E_ABORT, !m_Dispatcher.Get()); 74 | return S_OK; 75 | } 76 | 77 | DWORD ConsoleUIManager::s_UIThreadHostStartThreadProc(void* parameter) 78 | { 79 | auto pThis = static_cast(parameter); 80 | pThis->AddRef(); 81 | pThis->UIThreadHostStartThreadProc(); 82 | return 0; 83 | } 84 | 85 | HRESULT ConsoleUIManager::UIThreadHostStartThreadProc() 86 | { 87 | HRESULT hr; 88 | auto scopeExit = wil::scope_exit([&]() -> void { m_UIThreadInitResult = hr; }); 89 | 90 | RETURN_IF_FAILED(hr = MakeNotificationDispatcher(&m_Dispatcher)); // 219 91 | 92 | return S_OK; 93 | } 94 | 95 | DWORD ConsoleUIManager::s_UIThreadHostThreadProc(void* parameter) 96 | { 97 | auto pThis = static_cast(parameter); 98 | 99 | HRESULT hr = S_OK; 100 | if (SUCCEEDED(pThis->m_UIThreadInitResult)) 101 | { 102 | hr = pThis->UIThreadHostThreadProc(); 103 | } 104 | pThis->Release(); 105 | return hr; 106 | } 107 | 108 | DWORD ConsoleUIManager::UIThreadHostThreadProc() 109 | { 110 | DWORD dwIndex = WAIT_IO_COMPLETION; 111 | 112 | HANDLE waitHandles[] = { m_UIThreadQuitEvent.get() }; 113 | 114 | SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE); 115 | CoInitializeEx(nullptr, 0); 116 | DirectUI::InitProcessPriv(14, HINST_THISCOMPONENT, false, true, true); 117 | 118 | DirectUI::InitThread(2); 119 | DirectUI::RegisterAllControls(); 120 | 121 | CDUIAnimationStrip::Register(); 122 | CLogonFrame::Register(); 123 | CDUIUserTileElement::Register(); 124 | CDUIZoomableElement::Register(); 125 | CDUIRestrictedEdit::Register(); 126 | CDUIComboBox::Register(); 127 | UserList::Register(); 128 | CDUIFieldContainer::Register(); 129 | CDUILabeledCheckbox::Register(); 130 | 131 | CLogonNativeHWNDHost* nativeHWNDHost = nullptr; 132 | THROW_IF_FAILED(CLogonNativeHWNDHost::Create(0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN),&nativeHWNDHost)); 133 | 134 | CLogonFrame::Create(nativeHWNDHost); 135 | 136 | while (dwIndex == WAIT_IO_COMPLETION) 137 | { 138 | CoWaitForMultipleHandles( 139 | COWAIT_ALERTABLE | COWAIT_INPUTAVAILABLE | COWAIT_DISPATCH_CALLS | COWAIT_DISPATCH_WINDOW_MESSAGES, 140 | INFINITE, ARRAYSIZE(waitHandles), waitHandles, &dwIndex); 141 | if (dwIndex == 1) 142 | { 143 | MSG Msg {}; 144 | while ( PeekMessageW(&Msg, nullptr, 0, 0, PM_REMOVE) ) 145 | { 146 | if (Msg.message == WM_QUIT) 147 | { 148 | break; 149 | } 150 | 151 | TranslateMessage(&Msg); 152 | DispatchMessageW(&Msg); 153 | } 154 | 155 | dwIndex = WAIT_IO_COMPLETION; 156 | } 157 | } 158 | 159 | if (m_Dispatcher.Get()) 160 | { 161 | ComPtr objWithBackRefs; 162 | if (SUCCEEDED(m_Dispatcher.As(&objWithBackRefs))) 163 | { 164 | objWithBackRefs->RemoveBackReferences(); 165 | } 166 | 167 | m_Dispatcher.Reset(); 168 | } 169 | 170 | DirectUI::UnInitThread(); 171 | DirectUI::UnInitProcessPriv(HINST_THISCOMPONENT); 172 | CoUninitialize(); 173 | 174 | //FreeConsole(); 175 | return 0; 176 | } 177 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/consoleuimanager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | 5 | #include "NotificationDispatcher.h" 6 | 7 | class ConsoleUIManager 8 | : public Microsoft::WRL::Implements 9 | , IUnknown 10 | > 11 | { 12 | public: 13 | ConsoleUIManager(); 14 | 15 | HRESULT Initialize(); 16 | HRESULT StartUI(); 17 | HRESULT StopUI(); 18 | 19 | protected: 20 | ~ConsoleUIManager() = default; 21 | 22 | HRESULT EnsureUIStarted(); 23 | 24 | Microsoft::WRL::ComPtr m_Dispatcher; 25 | 26 | private: 27 | 28 | static DWORD WINAPI s_UIThreadHostStartThreadProc(void* parameter); 29 | HRESULT UIThreadHostStartThreadProc(); 30 | 31 | static DWORD WINAPI s_UIThreadHostThreadProc(void* parameter); 32 | DWORD UIThreadHostThreadProc(); 33 | 34 | Microsoft::WRL::Wrappers::SRWLock m_lock; 35 | 36 | wil::unique_handle m_UIThreadHandle; 37 | HRESULT m_UIThreadInitResult; 38 | wil::unique_handle m_UIThreadQuitEvent; 39 | }; 40 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/duiutil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "DirectUI/DirectUI.h" 4 | #include 5 | #include 6 | #include 7 | 8 | static HRESULT SetContentAndAcc(DirectUI::Element* element, const wchar_t* content) 9 | { 10 | HRESULT result = S_OK; 11 | 12 | if (content) 13 | { 14 | result = element->SetContentString(content); 15 | if (SUCCEEDED(result)) 16 | return element->SetAccName(content); 17 | } 18 | else 19 | { 20 | result = element->RemoveLocalValue(DirectUI::Element::ContentProp); 21 | if (SUCCEEDED(result)) 22 | return element->RemoveLocalValue(DirectUI::Element::AccNameProp); 23 | } 24 | return result; 25 | } 26 | 27 | static HRESULT HRESULTFromLastErrorError() 28 | { 29 | DWORD lastErrorDWORD = GetLastError(); 30 | if (!lastErrorDWORD) 31 | lastErrorDWORD = 1; 32 | HRESULT result = static_cast(lastErrorDWORD) | 0x80070000; 33 | if (lastErrorDWORD <= 0) 34 | return static_cast(lastErrorDWORD); 35 | return result; 36 | } 37 | 38 | static HRESULT SetContentAndAccFromResources(DirectUI::Element *element, UINT residContent, UINT residAcc) 39 | { 40 | WCHAR content[128]; 41 | WCHAR acc[128]; 42 | 43 | int StringW = LoadStringW(HINST_THISCOMPONENT, residContent, content, 128); 44 | int v6 = LoadStringW(HINST_THISCOMPONENT, residAcc, acc, 128); 45 | if ( StringW <= 0 || v6 <= 0 ) 46 | return HRESULTFromLastErrorError(); 47 | HRESULT result = element->SetContentString(content); 48 | if (SUCCEEDED(result)) 49 | return element->SetAccName(acc); 50 | return result; 51 | } 52 | 53 | static UINT GetScreenDPI() 54 | { 55 | UINT DPI; 56 | 57 | HDC DC = GetDC(nullptr); 58 | 59 | if (DC) 60 | DPI = GetDeviceCaps(DC, 90); 61 | else 62 | DPI = 0; 63 | 64 | if (DC) 65 | ReleaseDC(nullptr, DC); 66 | 67 | return DPI; 68 | } 69 | 70 | static HRESULT StringStringAllocCopy(const wchar_t* Src, const wchar_t** a2) 71 | { 72 | const wchar_t* newString = (const wchar_t*)DirectUI::HAlloc((wcslen(Src)+1)*2); 73 | memcpy((void*)newString,Src, (wcslen(Src) + 1) * 2); 74 | *a2 = newString; 75 | return S_OK; 76 | } 77 | 78 | static DirectUI::Value* CreateGraphicFromHBITMAP(HBITMAP oldbitmap, UINT width, UINT height, BYTE blendMode) 79 | { 80 | Gdiplus::GdiplusStartupInput gpStartupInput; 81 | ULONG_PTR gpToken; 82 | Gdiplus::GdiplusStartup(&gpToken, &gpStartupInput, NULL); 83 | 84 | Gdiplus::Bitmap* bitmap = Gdiplus::Bitmap::FromHBITMAP(oldbitmap, 0); 85 | 86 | HBITMAP hbitmap = 0; 87 | 88 | if (bitmap) 89 | { 90 | //UINT newWidth = GetSystemMetrics(SM_CXSCREEN); 91 | //UINT newHeight = GetSystemMetrics(SM_CYSCREEN); 92 | Gdiplus::Bitmap bitmap2 = Gdiplus::Bitmap(width, height, PixelFormat32bppARGB); 93 | 94 | Gdiplus::Graphics* graphic = Gdiplus::Graphics::FromImage(&bitmap2); 95 | if (graphic) 96 | { 97 | graphic->SetInterpolationMode(Gdiplus::InterpolationMode::InterpolationModeHighQualityBicubic); 98 | 99 | Gdiplus::ImageAttributes attributes; 100 | attributes.SetWrapMode(Gdiplus::WrapMode::WrapModeTileFlipXY, 0xFF000000, 0); 101 | 102 | UINT oldWidth = bitmap->GetWidth(); 103 | UINT oldHeight = bitmap->GetHeight(); 104 | 105 | graphic->DrawImage(bitmap, Gdiplus::Rect(0, 0, width, height), 0, 0, bitmap->GetWidth(), bitmap->GetHeight(), Gdiplus::Unit::UnitPixel, &attributes, (Gdiplus::DrawImageAbort)0, 0); 106 | 107 | bitmap2.GetHBITMAP(Gdiplus::Color(0xFF000000), &hbitmap); 108 | 109 | delete graphic; 110 | } 111 | 112 | delete bitmap; 113 | } 114 | Gdiplus::GdiplusShutdown(gpToken); 115 | 116 | bool bRtl = false; 117 | if (blendMode == 2 || blendMode == 7) 118 | bRtl = true; 119 | DirectUI::Value* Graphic = DirectUI::Value::CreateGraphic(hbitmap, blendMode, 0xFFFFFFFF, false, false, bRtl); 120 | if (!Graphic) 121 | DeleteObject(hbitmap); 122 | 123 | return Graphic; 124 | } 125 | 126 | static HRESULT SetBackgroundFromHBITMAP(DirectUI::Element* element, HBITMAP bitmap, UINT width, UINT height) 127 | { 128 | DirectUI::Value* GraphicFromHBITMAP = CreateGraphicFromHBITMAP(bitmap, width, height, 4); 129 | DeleteObject(bitmap); 130 | if (GraphicFromHBITMAP) 131 | { 132 | RETURN_IF_FAILED(element->SetValue(DirectUI::Element::BackgroundProp, 1, GraphicFromHBITMAP)); 133 | GraphicFromHBITMAP->Release(); 134 | } 135 | else 136 | return E_FAIL; 137 | 138 | return S_OK; 139 | } 140 | 141 | static int SetLayoutPosDownTree(int val, DirectUI::Element* element1, DirectUI::Element* element2) 142 | { 143 | int result; 144 | DirectUI::Element* ImmediateChild; 145 | 146 | int val_1 = val; 147 | for (DirectUI::Element* i = element1; ; i = ImmediateChild) 148 | { 149 | result = i->SetLayoutPos(val_1); 150 | if (element1 == element2) 151 | break; 152 | ImmediateChild = element1->GetImmediateChild(element2); 153 | val_1 = val; 154 | element1 = ImmediateChild; 155 | } 156 | 157 | return result; 158 | } 159 | 160 | static int SetVisibleDownTree(bool val, DirectUI::Element* element1, DirectUI::Element* element2) 161 | { 162 | int result; 163 | DirectUI::Element* ImmediateChild; 164 | 165 | bool val_1 = val; 166 | for (DirectUI::Element* i = element1; ; i = ImmediateChild) 167 | { 168 | result = i->SetVisible(val_1); 169 | if (element1 == element2) 170 | break; 171 | ImmediateChild = element1->GetImmediateChild(element2); 172 | val_1 = val; 173 | element1 = ImmediateChild; 174 | } 175 | return result; 176 | } 177 | 178 | static int SetEnabledDownTree(bool val, DirectUI::Element* element1, DirectUI::Element* element2) 179 | { 180 | int result; 181 | DirectUI::Element* ImmediateChild; 182 | 183 | bool val_1 = val; 184 | for (DirectUI::Element* i = element1; ; i = ImmediateChild) 185 | { 186 | result = i->SetEnabled(val_1); 187 | if (element1 == element2) 188 | break; 189 | ImmediateChild = element1->GetImmediateChild(element2); 190 | val_1 = val; 191 | element1 = ImmediateChild; 192 | } 193 | return result; 194 | } 195 | 196 | static HRESULT TraverseTree(DirectUI::Element* elm, DirectUI::IClassInfo* classInfo, HRESULT(STDMETHODCALLTYPE* callbackFunc)(DirectUI::Element*, LPVOID param), LPVOID param) 197 | { 198 | if (elm->GetClassInfoW()->IsSubclassOf(classInfo)) 199 | RETURN_IF_FAILED(callbackFunc(elm,param)); 200 | 201 | DirectUI::Value* childVal; 202 | auto Children = elm->GetChildren(&childVal); 203 | if (Children) 204 | { 205 | for (UINT i = 0; i < Children->GetSize(); ++i) 206 | { 207 | auto Child = Children->GetItem(i); 208 | RETURN_IF_FAILED(TraverseTree(Child,classInfo,callbackFunc,param)); 209 | } 210 | } 211 | 212 | childVal->Release(); 213 | 214 | return S_OK; 215 | } 216 | 217 | static bool IsElementOfClass(DirectUI::Element* element, const wchar_t* className) 218 | { 219 | return _wcsicmp(element->GetClassInfoW()->GetName(), className) == 0; 220 | } 221 | 222 | static HRESULT SHRegGetBOOLWithREGSAM(HKEY key, LPCWSTR subKey, LPCWSTR value, REGSAM regSam, BOOL* data) 223 | { 224 | DWORD dwType = REG_NONE; 225 | DWORD dwData; 226 | DWORD cbData = sizeof(dwData); 227 | LSTATUS lRes = RegGetValueW( 228 | key, 229 | subKey, 230 | value, 231 | ((regSam & 0x100) << 8) | RRF_RT_REG_DWORD | RRF_RT_REG_SZ | RRF_NOEXPAND, 232 | &dwType, 233 | &dwData, 234 | &cbData 235 | ); 236 | if (lRes != ERROR_SUCCESS) 237 | { 238 | if (lRes == ERROR_MORE_DATA) 239 | return HRESULT_FROM_WIN32(ERROR_INVALID_DATA); 240 | if (lRes > 0) 241 | return HRESULT_FROM_WIN32(lRes); 242 | return lRes; 243 | } 244 | 245 | if (dwType == REG_DWORD) 246 | { 247 | if (dwData > 1) 248 | return HRESULT_FROM_WIN32(ERROR_INVALID_DATA); 249 | *data = dwData == 1; 250 | } 251 | else 252 | { 253 | if (cbData != 4 || (WCHAR)dwData != L'0' && (WCHAR)dwData != L'1') 254 | return HRESULT_FROM_WIN32(ERROR_INVALID_DATA); 255 | *data = (WCHAR)dwData == L'1'; 256 | } 257 | 258 | return S_OK; 259 | } 260 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/fieldcontainer.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "fieldcontainer.h" 3 | 4 | DirectUI::IClassInfo* CDUIFieldContainer::Class = nullptr; 5 | 6 | DirectUI::IClassInfo* CDUIFieldContainer::GetClassInfoW() 7 | { 8 | return Class; 9 | } 10 | 11 | DirectUI::IClassInfo* CDUIFieldContainer::GetClassInfoPtr() 12 | { 13 | return Class; 14 | } 15 | 16 | HRESULT CDUIFieldContainer::Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, 17 | DirectUI::Element** ppElement) 18 | { 19 | return DirectUI::CreateAndInit(0, pParent, pdwDeferCookie, ppElement); 20 | } 21 | 22 | HRESULT CDUIFieldContainer::Register() 23 | { 24 | return DirectUI::ClassInfo::RegisterGlobal(HINST_THISCOMPONENT, L"FieldContainer", nullptr, 0); 25 | } 26 | 27 | HRESULT CDUIFieldContainer::AddField(DirectUI::Element* field) 28 | { 29 | return FindDescendent(DirectUI::StrToID(L"FieldParent"))->Add(field); 30 | } 31 | 32 | HRESULT CDUIFieldContainer::ShowSubmitButton(const wchar_t* accName, DirectUI::Button** OutSubmitButton) 33 | { 34 | DWORD cookie; 35 | StartDefer(&cookie); 36 | if (!m_SubmitButton) 37 | { 38 | m_SubmitButton = (DirectUI::Button*)FindDescendent(DirectUI::StrToID(L"Submit")); 39 | m_SubmitButton->SetAccName(accName); 40 | } 41 | DirectUI::Element* ForceCenter = FindDescendent(DirectUI::StrToID(L"ForceCenter")); 42 | if (ForceCenter) 43 | ForceCenter->SetLayoutPos(-1); 44 | 45 | m_SubmitButton->SetLayoutPos(-1); 46 | m_SubmitButton->SetVisible(true); 47 | m_SubmitButton->SetEnabled(true); 48 | 49 | if (OutSubmitButton) 50 | *OutSubmitButton = m_SubmitButton; 51 | 52 | if (cookie) 53 | EndDefer(cookie); 54 | 55 | return S_OK; 56 | } 57 | 58 | void CDUIFieldContainer::HideSubmitButton() 59 | { 60 | DWORD cookie = 0; 61 | StartDefer(&cookie); 62 | if (m_SubmitButton) 63 | { 64 | auto ForceCenter = FindDescendent(DirectUI::StrToID(L"ForceCenter")); 65 | if (ForceCenter) 66 | ForceCenter->SetLayoutPos(-3); 67 | 68 | m_SubmitButton->SetLayoutPos(-3); 69 | m_SubmitButton->SetVisible(false); 70 | m_SubmitButton->SetEnabled(false); 71 | } 72 | if (cookie) 73 | EndDefer(cookie); 74 | } 75 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/fieldcontainer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | #include "DirectUI/DirectUI.h" 5 | #include "logoninterfaces.h" 6 | 7 | /* 8 | : public Microsoft::WRL::Implements 9 | , ControlBase 10 | , WF::ITypedEventHandler 11 | */ 12 | 13 | class CDUIFieldContainer : public DirectUI::Element 14 | { 15 | public: 16 | 17 | static DirectUI::IClassInfo* Class; 18 | DirectUI::IClassInfo* GetClassInfoW() override; 19 | static DirectUI::IClassInfo* GetClassInfoPtr(); 20 | 21 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 22 | 23 | static HRESULT Register(); 24 | 25 | HRESULT AddField(DirectUI::Element* field); 26 | HRESULT ShowSubmitButton(const wchar_t* accName, DirectUI::Button** OutSubmitButton); 27 | void HideSubmitButton(); 28 | 29 | DirectUI::Button* m_SubmitButton; 30 | }; 31 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/labeledcheckbox.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "labeledcheckbox.h" 3 | 4 | #include "duiutil.h" 5 | #include "usertileelement.h" 6 | 7 | static BYTE _uidCDUILabeledCheckboxToggled = 0; 8 | UID CDUILabeledCheckbox::s_Toggled = UID(&_uidCDUILabeledCheckboxToggled); 9 | 10 | DirectUI::IClassInfo* CDUILabeledCheckbox::Class = nullptr; 11 | 12 | CDUILabeledCheckbox::CDUILabeledCheckbox() : m_checkbox(nullptr) 13 | , m_label(nullptr) 14 | , m_checkedBackgroundFill(nullptr) 15 | , m_uncheckedBackgroundFill(nullptr) 16 | , m_isChecked(FALSE) 17 | , m_index(-1) 18 | , m_owningElement(nullptr) 19 | , m_token(0) 20 | { 21 | } 22 | 23 | CDUILabeledCheckbox::~CDUILabeledCheckbox() 24 | { 25 | } 26 | 27 | DirectUI::IClassInfo* CDUILabeledCheckbox::GetClassInfoW() 28 | { 29 | return Class; 30 | } 31 | 32 | DirectUI::IClassInfo* CDUILabeledCheckbox::GetClassInfoPtr() 33 | { 34 | return Class; 35 | } 36 | 37 | HRESULT CDUILabeledCheckbox::Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, 38 | DirectUI::Element** ppElement) 39 | { 40 | return DirectUI::CreateAndInit(1, pParent, pdwDeferCookie, ppElement); 41 | } 42 | 43 | HRESULT CDUILabeledCheckbox::Register() 44 | { 45 | return DirectUI::ClassInfo::RegisterGlobal(HINST_THISCOMPONENT, L"DUILabeledCheckbox", nullptr, 0); 46 | } 47 | 48 | HRESULT CDUILabeledCheckbox::Configure(bool isChecked, const wchar_t* labelText) 49 | { 50 | m_checkbox = FindDescendent(DirectUI::StrToID(L"Checkbox")); 51 | m_label = FindDescendent(DirectUI::StrToID(L"Label")); 52 | 53 | DWORD cookie; 54 | StartDefer(&cookie); 55 | 56 | auto scopeExit = wil::scope_exit([&]() -> void {if (cookie) { EndDefer(cookie); }}); 57 | 58 | RETURN_IF_FAILED(SetContentAndAcc(m_label,labelText)); 59 | 60 | RETURN_IF_FAILED(m_label->SetClass(L"SmallText")); 61 | 62 | m_checkedBackgroundFill = DirectUI::Value::CreateDFCFill(4u, 0x400u); 63 | if (m_checkedBackgroundFill) 64 | { 65 | m_uncheckedBackgroundFill = DirectUI::Value::CreateDFCFill(4u, 0); 66 | 67 | if (m_uncheckedBackgroundFill) 68 | { 69 | SetChecked(isChecked); 70 | } 71 | else 72 | { 73 | m_checkedBackgroundFill->Release(); 74 | m_checkedBackgroundFill = nullptr; 75 | } 76 | } 77 | 78 | if (m_checkedBackgroundFill && m_uncheckedBackgroundFill) 79 | { 80 | RETURN_IF_FAILED(m_checkbox->SetAccessible(true)); 81 | 82 | RETURN_IF_FAILED(m_checkbox->SetAccRole(44)); 83 | 84 | RETURN_IF_FAILED(DirectUI::SetDefAction(m_checkbox,(unsigned int)isChecked - 791)); 85 | 86 | RETURN_IF_FAILED(m_checkbox->SetAccName(labelText)); 87 | } 88 | 89 | return S_OK; 90 | } 91 | 92 | void CDUILabeledCheckbox::SetChecked(bool newIsChecked, bool bInformCred) 93 | { 94 | m_isChecked = newIsChecked; 95 | 96 | DWORD cookie; 97 | StartDefer(&cookie); 98 | 99 | DirectUI::Value* fillToUse; 100 | if (m_isChecked) 101 | fillToUse = m_checkedBackgroundFill; 102 | else 103 | fillToUse = m_uncheckedBackgroundFill; 104 | 105 | m_checkbox->SetValue(BackgroundProp,1,fillToUse); 106 | 107 | if (cookie) 108 | EndDefer(cookie); 109 | 110 | int AccState = m_checkbox->GetAccState(); 111 | 112 | int unCheckedAccstate = AccState & 0xFFFFFFEF; 113 | int checkedAccstate = AccState | 0x10; 114 | 115 | if (m_isChecked) 116 | m_checkbox->SetAccState(checkedAccstate); 117 | else 118 | m_checkbox->SetAccState(unCheckedAccstate); 119 | 120 | DirectUI::SetDefAction(m_checkbox, (unsigned int)(LOBYTE(m_isChecked) != 0) - 791); 121 | 122 | if (m_FieldInfo.Get() && bInformCred) 123 | { 124 | Microsoft::WRL::ComPtr checkboxField; 125 | if (SUCCEEDED(m_FieldInfo->QueryInterface(IID_PPV_ARGS(&checkboxField)))) 126 | { 127 | LOG_IF_FAILED(checkboxField->put_Checked(m_isChecked)); 128 | } 129 | else 130 | { 131 | LOG_HR_MSG(E_FAIL,"Failed to get checkboxfield"); 132 | } 133 | } 134 | } 135 | 136 | void CDUILabeledCheckbox::OnInput(DirectUI::InputEvent* inputEvent) 137 | { 138 | if (inputEvent->nStage > DirectUI::GMF_ROUTED) 139 | return DirectUI::Button::OnInput(inputEvent); 140 | 141 | //bool bShouldUpdateCredField = false; 142 | 143 | if (inputEvent->nDevice == DirectUI::GINPUT_KEYBOARD) 144 | { 145 | auto keyboardEvent = reinterpret_cast(inputEvent); 146 | if ((keyboardEvent->ch == 13 || keyboardEvent->ch == 32) && keyboardEvent->nCode) 147 | { 148 | if (inputEvent->nCode == DirectUI::GMOUSE_DOWN) 149 | { 150 | SetChecked(m_isChecked == 0, true); 151 | 152 | DirectUI::Event event; 153 | event.fHandled = m_isChecked; 154 | event.fUIAHandled = m_isChecked; 155 | event.peTarget = this; 156 | event.uidType = CDUILabeledCheckbox::s_Toggled; 157 | DirectUI::Element::FireEvent(&event, true, false); 158 | } 159 | } 160 | } 161 | else if (inputEvent->nDevice == DirectUI::GINPUT_MOUSE) 162 | { 163 | auto mouseEvent = reinterpret_cast(inputEvent); 164 | if ((mouseEvent->bButton == 1 || mouseEvent->bButton == 2) && inputEvent->nCode != DirectUI::GMOUSE_DOWN) 165 | { 166 | if (inputEvent->nCode == DirectUI::GMOUSE_UP) 167 | { 168 | SetChecked(m_isChecked == 0, true); 169 | 170 | DirectUI::Event event; 171 | event.fHandled = m_isChecked; 172 | event.fUIAHandled = m_isChecked; 173 | event.peTarget = this; 174 | event.uidType = CDUILabeledCheckbox::s_Toggled; 175 | DirectUI::Element::FireEvent(&event, true, false); 176 | } 177 | } 178 | } 179 | 180 | return DirectUI::Button::OnInput(inputEvent); 181 | } 182 | 183 | void CDUILabeledCheckbox::SetKeyFocus() 184 | { 185 | if (GetVisible() && GetEnabled()) // guess 186 | m_checkbox->SetKeyFocus(); 187 | } 188 | 189 | HRESULT CDUILabeledCheckbox::Advise(LCPD::ICredentialField* dataSource) 190 | { 191 | m_FieldInfo = dataSource; 192 | 193 | RETURN_IF_FAILED(m_FieldInfo->add_FieldChanged(this, &m_token)); // 19 194 | return S_OK; 195 | } 196 | 197 | HRESULT CDUILabeledCheckbox::UnAdvise() 198 | { 199 | if (m_FieldInfo) 200 | { 201 | RETURN_IF_FAILED(m_FieldInfo->remove_FieldChanged(m_token)); // 25 202 | 203 | m_FieldInfo.Reset(); 204 | } 205 | 206 | return S_OK; 207 | } 208 | 209 | void CDUILabeledCheckbox::OnDestroy() 210 | { 211 | Button::OnDestroy(); 212 | UnAdvise(); 213 | } 214 | 215 | HRESULT CDUILabeledCheckbox::Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) 216 | { 217 | LOG_HR_MSG(E_FAIL,"CDUILabeledCheckbox::Invoke\n"); 218 | if (m_owningElement && m_owningElement->m_containersArray[m_index]) 219 | { 220 | CFieldWrapper* fieldData; 221 | m_owningElement->fieldsArray.GetAt(m_index,fieldData); 222 | 223 | bool bShouldUpdateString = false; 224 | 225 | if (args == LCPD::CredentialFieldChangeKind_State) 226 | { 227 | bool bOldVisibility = GetVisible(); 228 | m_owningElement->SetFieldVisibility(m_index,m_FieldInfo); 229 | if (bOldVisibility != GetVisible()) 230 | bShouldUpdateString = true; 231 | } 232 | else if (args == LCPD::CredentialFieldChangeKind_SetString || args == LCPD::CredentialFieldChangeKind_SetCheckbox) 233 | { 234 | //m_owningElement->SetFieldVisibility(m_owningElement->m_containersArray[m_index],fieldData); 235 | bShouldUpdateString = true; 236 | } 237 | if (bShouldUpdateString) 238 | { 239 | Microsoft::WRL::Wrappers::HString label; 240 | Microsoft::WRL::ComPtr checkBoxField; 241 | if (SUCCEEDED(m_FieldInfo->QueryInterface(IID_PPV_ARGS(&checkBoxField)))) 242 | { 243 | bool bIsChecked = false; 244 | RETURN_IF_FAILED(checkBoxField->get_Checked(&bIsChecked)); 245 | SetChecked(bIsChecked); 246 | } 247 | 248 | RETURN_IF_FAILED(m_FieldInfo->get_Label(label.ReleaseAndGetAddressOf())); 249 | 250 | if (label.Length() > 0) 251 | { 252 | RETURN_IF_FAILED(SetContentAndAcc(m_label,label.GetRawBuffer(nullptr))); 253 | } 254 | } 255 | //m_owningElement->SetFieldInitialVisibility(m_owningElement->m_containersArray[m_index],fieldData); 256 | //LOG_HR_MSG(E_FAIL,"CDUILabeledCheckbox::Invoke SetFieldInitialVisibility\n"); 257 | } 258 | 259 | return S_OK; 260 | } 261 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/labeledcheckbox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | #include "DirectUI/DirectUI.h" 5 | 6 | class CDUILabeledCheckbox : public DirectUI::Button 7 | , public Microsoft::WRL::RuntimeClass 8 | , WF::ITypedEventHandler 9 | > 10 | { 11 | public: 12 | 13 | CDUILabeledCheckbox(); 14 | CDUILabeledCheckbox(const CDUILabeledCheckbox& other) = delete; 15 | ~CDUILabeledCheckbox() override; 16 | 17 | CDUILabeledCheckbox& operator=(const CDUILabeledCheckbox&) = delete; 18 | 19 | static DirectUI::IClassInfo* Class; 20 | DirectUI::IClassInfo* GetClassInfoW() override; 21 | static DirectUI::IClassInfo* GetClassInfoPtr(); 22 | 23 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 24 | 25 | static HRESULT Register(); 26 | 27 | HRESULT Configure(bool isChecked, const wchar_t* labelText); 28 | void SetChecked(bool isChecked, bool bInformCred = false); 29 | void OnInput(DirectUI::InputEvent* inputEvent) override; 30 | void SetKeyFocus() override; 31 | 32 | HRESULT Advise(LCPD::ICredentialField* dataSource); 33 | HRESULT UnAdvise(); 34 | virtual void OnDestroy() override; 35 | 36 | //~ Begin WF::ITypedEventHandler Interface 37 | STDMETHODIMP Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) override; 38 | //~ End WF::ITypedEventHandler Interface 39 | 40 | static UID s_Toggled; 41 | 42 | DirectUI::Element* m_checkbox; 43 | DirectUI::Element* m_label; 44 | DirectUI::Value* m_checkedBackgroundFill; 45 | DirectUI::Value* m_uncheckedBackgroundFill; 46 | BOOL m_isChecked; 47 | 48 | int m_index; 49 | class CDUIUserTileElement* m_owningElement; 50 | 51 | private: 52 | EventRegistrationToken m_token; 53 | Microsoft::WRL::ComPtr m_FieldInfo; 54 | }; 55 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/logonframe.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | 5 | #include "logonnativehwndhost.h" 6 | #include "logonviewmanager.h" 7 | #include "DirectUI/DirectUI.h" 8 | #include "userlist.h" 9 | 10 | class CLogonFrame : public DirectUI::HWNDElement 11 | { 12 | public: 13 | 14 | ~CLogonFrame() override; 15 | 16 | static DirectUI::IClassInfo* Class; 17 | DirectUI::IClassInfo* GetClassInfoW() override; 18 | static DirectUI::IClassInfo* GetClassInfoPtr(); 19 | 20 | static HRESULT Create(HWND hParent, bool fDblBuffer, UINT nCreate, Element* pParent, DWORD* pdwDeferCookie, DirectUI::Element** ppElement); 21 | 22 | static HRESULT Create(CLogonNativeHWNDHost* host); 23 | 24 | static HRESULT Register(); 25 | 26 | static CLogonFrame* GetSingleton(); 27 | 28 | HRESULT CreateStyleParser(DirectUI::DUIXmlParser** outParser) override; 29 | void OnEvent(DirectUI::Event* pEvent) override; 30 | 31 | void SetOptions(MessageOptionFlag optionsFlag); 32 | 33 | void SetBackgroundGraphics(); 34 | void ShowSecurityOptions(LC::LogonUISecurityOptions SecurityOptsFlag, WI::AsyncDeferral> completion); 35 | HRESULT OnSecurityOptionSelected(LC::LogonUISecurityOptions SecurityOpt); 36 | HRESULT ConfirmEmergencyShutdown(); 37 | 38 | void ShowStatusMessage(const wchar_t* message); 39 | 40 | void SwitchToUserList(class UserList* userList); 41 | void DisplayLogonDialog(const wchar_t* messageCaptionContent, const wchar_t* messageContent, WORD flags, WI::AsyncDeferral> completion); 42 | void DisplayLogonDialog(const wchar_t* messageCaptionContent, const wchar_t* messageContent, WORD flags); 43 | HRESULT OnMessageOptionPressed(MessageOptionFlag flag); 44 | 45 | void ShowLockedScreen(); 46 | 47 | CLogonNativeHWNDHost* m_nativeHost; 48 | DirectUI::Element* m_CurrentWindow = nullptr; 49 | DirectUI::DUIXmlParser* m_xmlParser; 50 | 51 | DirectUI::Element* m_Window = nullptr; 52 | DirectUI::Element* m_Options = nullptr; 53 | DirectUI::Element* m_SwitchUser = nullptr; 54 | DirectUI::Element* m_OtherTiles = nullptr; 55 | DirectUI::Element* m_Ok = nullptr; 56 | DirectUI::Element* m_Yes = nullptr; 57 | DirectUI::Element* m_No = nullptr; 58 | DirectUI::Element* m_Cancel = nullptr; 59 | DirectUI::Element* m_ShutDownFrame = nullptr; 60 | DirectUI::Element* m_ShowPLAP = nullptr; 61 | DirectUI::Element* m_DisconnectPLAP = nullptr; 62 | DirectUI::Element* m_Accessibility = nullptr; 63 | DirectUI::Element* m_MessageFrame = nullptr; 64 | DirectUI::Element* m_FullMessageFrame = nullptr; 65 | DirectUI::Element* m_ShortMessageFrame = nullptr; 66 | DirectUI::Element* m_ConnectMessageFrame = nullptr; 67 | DirectUI::Element* m_Status = nullptr; 68 | DirectUI::Element* m_StatusText = nullptr; 69 | DirectUI::Element* m_SecurityOptions = nullptr; 70 | DirectUI::Element* m_Locked = nullptr; 71 | DirectUI::Element* m_WaitAnimation = nullptr; 72 | 73 | UserList* m_activeUserList; 74 | UserList* m_LogonUserList; 75 | UserList* m_PLAPUserList; 76 | 77 | Microsoft::WRL::ComPtr m_consoleUIManager; 78 | Microsoft::WRL::ComPtr m_shutdownChoices; 79 | LC::LogonUIRequestReason m_currentReason; 80 | 81 | bool isHighContrast = false; 82 | 83 | private: 84 | HRESULT _Initialize(CLogonNativeHWNDHost* Host, DirectUI::Element* pParent, DWORD* DeferCookie); 85 | HRESULT _InitializeUserLists(); 86 | bool _IsInstallUpdatesAndShutdownAllowed(); 87 | bool _ShowBackgroundBitmap(); 88 | bool _IsSwitchUserAllowed(); 89 | void _SetSoftKeyboardAllowed(bool allowed); 90 | void _SetBrandingGraphic(); 91 | void _SelectMode(DirectUI::Element* elementToHost, bool isVisible); 92 | void _ShowCursor(bool bShow); 93 | void _DisplayStatusMessage(const wchar_t* message, bool showSpinner); 94 | void _DisplayLogonDialog(const wchar_t* messageCaptionContent, const wchar_t* messageContent, WORD flags); 95 | void _OnEmergencyRestart(); 96 | void _HandleShutdownChoices(); 97 | void _ShutdownCommon(DWORD choice); 98 | 99 | static CLogonFrame* _pSingleton; 100 | 101 | wistd::unique_ptr>> m_SecurityOptionsCompletion; 102 | wistd::unique_ptr>> m_MessageDisplayResultCompletion; 103 | bool m_bIsInEmergencyRestartDialog = false; 104 | }; 105 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/logonnativehwndhost.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "logonnativehwndhost.h" 3 | 4 | #include "duiutil.h" 5 | 6 | CLogonNativeHWNDHost::CLogonNativeHWNDHost() 7 | : m_scenario(LCPD::CredProvScenario_Logon) 8 | { 9 | 10 | } 11 | 12 | HRESULT CLogonNativeHWNDHost::Create(int dx, int dy, int dwidth, int dheight, CLogonNativeHWNDHost** out) 13 | { 14 | CLogonNativeHWNDHost* host = DirectUI::HNewAndZero(); 15 | if (!host) 16 | return E_OUTOFMEMORY; 17 | 18 | HRESULT er = S_OK; 19 | 20 | WNDCLASSEXW wndClass = {}; 21 | 22 | wndClass.cbSize = sizeof(WNDCLASSEXW); 23 | wndClass.style = CS_GLOBALCLASS; 24 | wndClass.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH); 25 | wndClass.hCursor = LoadCursorW(nullptr, IDC_ARROW); 26 | wndClass.lpfnWndProc = DefWindowProcW; 27 | wndClass.lpszClassName = L"AUTHUI.DLL: LogonUI Logon Window"; 28 | if (!RegisterClassExW(&wndClass)) 29 | { 30 | er = HRESULTFromLastErrorError(); 31 | if (FAILED(er)) 32 | { 33 | host->Destroy(); 34 | return er; 35 | } 36 | } 37 | 38 | er = host->Initialize(L"AUTHUI.DLL: LogonUI Logon Window", L"Windows Logon",nullptr,nullptr,dx,dy,dwidth,dheight, 0, 0x80000000 | WS_VISIBLE,nullptr,3); 39 | if (SUCCEEDED(er)) 40 | { 41 | *out = host; 42 | } 43 | else 44 | { 45 | *out = nullptr; 46 | host->Destroy(); 47 | } 48 | return er; 49 | } 50 | 51 | HRESULT CLogonNativeHWNDHost::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plRet) 52 | { 53 | switch (uMsg) 54 | { 55 | case WM_CLOSE: 56 | return FALSE; 57 | default: 58 | break; 59 | } 60 | return TRUE; 61 | } 62 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/logonnativehwndhost.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | #include "DirectUI/DirectUI.h" 5 | 6 | class CLogonNativeHWNDHost : public DirectUI::NativeHWNDHost 7 | { 8 | public: 9 | 10 | CLogonNativeHWNDHost(); 11 | 12 | ~CLogonNativeHWNDHost() override 13 | { 14 | UnregisterClassW(L"AUTHUI.DLL: LogonUI Logon Window", nullptr); 15 | DirectUI::NativeHWNDHost::~NativeHWNDHost(); 16 | } 17 | 18 | static HRESULT Create(int dx, int dy, int dwidth, int dheight, CLogonNativeHWNDHost** out); 19 | 20 | HRESULT OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plRet) override; 21 | 22 | LCPD::CredProvScenario m_scenario; 23 | }; 24 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/logonviewmanager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | 5 | #include "consoleuimanager.h" 6 | 7 | class DECLSPEC_UUID("0bd5f9b3-c467-4545-a2c7-354647461905") LogonViewManager final 8 | : public Microsoft::WRL::RuntimeClass 9 | , ConsoleUIManager 10 | , WF::ITypedEventHandler 11 | , WF::ITypedEventHandler 12 | , WF::ITypedEventHandler 13 | , WFC::VectorChangedEventHandler 14 | , WFC::VectorChangedEventHandler 15 | , WF::ITypedEventHandler 16 | , Microsoft::WRL::FtmBase 17 | > 18 | { 19 | public: 20 | LogonViewManager(); 21 | 22 | // ReSharper disable once CppHidingFunction 23 | HRESULT RuntimeClassInitialize(); 24 | 25 | //~ Begin WF::ITypedEventHandler Interface 26 | STDMETHODIMP Invoke(LCPD::ICredential* sender, IInspectable* args) override; 27 | //~ End WF::ITypedEventHandler Interface 28 | 29 | //~ Begin WFC::VectorChangedEventHandler Interface 30 | STDMETHODIMP Invoke(WFC::IObservableVector* sender, WFC::IVectorChangedEventArgs* args) override; 31 | //~ End WFC::VectorChangedEventHandler Interface 32 | 33 | //~ Begin WFC::VectorChangedEventHandler Interface 34 | STDMETHODIMP Invoke(WFC::IObservableVector* sender, WFC::IVectorChangedEventArgs* args) override; 35 | //~ End WFC::VectorChangedEventHandler Interface 36 | 37 | //~ Begin WF::ITypedEventHandler Interface 38 | STDMETHODIMP Invoke(IInspectable* sender, IInspectable* args) override; 39 | //~ End WF::ITypedEventHandler Interface 40 | 41 | //~ Begin WF::ITypedEventHandler Interface 42 | STDMETHODIMP Invoke(LCPD::ICredProvDataModel* sender, LCPD::BioFeedbackState args) override; 43 | //~ End WF::ITypedEventHandler Interface 44 | 45 | //~ Begin WF::ITypedEventHandler Interface 46 | STDMETHODIMP Invoke(LCPD::ICredProvDataModel* sender, LCPD::ICredentialSerialization* args) override; 47 | //~ End WF::ITypedEventHandler Interface 48 | 49 | HRESULT SetContext( 50 | IInspectable* autoLogonManager, LC::IUserSettingManager* userSettingManager, 51 | LC::IRedirectionManager* redirectionManager, LCPD::IDisplayStateProvider* displayStateProvider, 52 | LC::IBioFeedbackListener* bioFeedbackListener); 53 | HRESULT Lock(LC::LogonUIRequestReason reason, BOOLEAN allowDirectUserSwitching, LC::IUnlockTrigger* unlockTrigger); 54 | HRESULT RequestCredentials( 55 | LC::LogonUIRequestReason reason, LC::LogonUIFlags flags,HSTRING unk, 56 | WI::AsyncDeferral> completion); 57 | HRESULT ReportResult( 58 | LC::LogonUIRequestReason reason, NTSTATUS ntStatus, NTSTATUS ntSubStatus, HSTRING samCompatibleUserName, 59 | HSTRING displayName, HSTRING userSid, 60 | WI::AsyncDeferral> completion); 61 | HRESULT ClearCredentialState(); 62 | HRESULT DisplayStatus(LC::LogonUIState state, HSTRING status, WI::AsyncDeferral completion); 63 | HRESULT DisplayMessage( 64 | LC::LogonMessageMode messageMode, UINT messageBoxFlags, HSTRING caption, HSTRING message, 65 | WI::AsyncDeferral> completion); 66 | HRESULT DisplayCredentialError( 67 | NTSTATUS ntsStatus, NTSTATUS ntsSubStatus, UINT messageBoxFlags, HSTRING caption, HSTRING message, 68 | WI::AsyncDeferral> completion); 69 | HRESULT ShowSecurityOptions( 70 | LC::LogonUISecurityOptions options, 71 | WI::AsyncDeferral> completion); 72 | HRESULT Cleanup(WI::AsyncDeferral completion); 73 | 74 | private: 75 | HRESULT SetContextUIThread( 76 | IInspectable* autoLogonManager, LC::IUserSettingManager* userSettingManager, 77 | LC::IRedirectionManager* redirectionManager, LCPD::IDisplayStateProvider* displayStateProvider, 78 | LC::IBioFeedbackListener* bioFeedbackListener); 79 | HRESULT LockUIThread( 80 | LC::LogonUIRequestReason reason, BOOLEAN allowDirectUserSwitching, LC::IUnlockTrigger* unlockTrigger); 81 | HRESULT RequestCredentialsUIThread( 82 | LC::LogonUIRequestReason reason, LC::LogonUIFlags flags,HSTRING unk, 83 | WI::AsyncDeferral> completion); 84 | HRESULT ReportResultUIThread( 85 | LC::LogonUIRequestReason reason, NTSTATUS ntStatus, NTSTATUS ntSubStatus, HSTRING samCompatibleUserName, 86 | HSTRING displayName, HSTRING userSid, 87 | WI::AsyncDeferral> completion); 88 | HRESULT ShowSecurityOptionsUIThread( 89 | LC::LogonUISecurityOptions options, 90 | WI::AsyncDeferral> completion); 91 | HRESULT DisplayStatusUIThread(LC::LogonUIState state, HSTRING status, WI::AsyncDeferral completion); 92 | HRESULT DisplayMessageUIThread( 93 | LC::LogonMessageMode messageMode, UINT messageBoxFlags, HSTRING caption, HSTRING message, 94 | WI::AsyncDeferral> completion); 95 | HRESULT DisplayCredentialErrorUIThread( 96 | NTSTATUS ntsStatus, NTSTATUS ntsSubStatus, UINT messageBoxFlags, HSTRING caption, HSTRING message, 97 | WI::AsyncDeferral> completion); 98 | HRESULT ClearCredentialStateUIThread(); 99 | HRESULT CleanupUIThread(WI::AsyncDeferral completion); 100 | HRESULT ShowCredentialView(); 101 | HRESULT ShowStatusView(HSTRING status); 102 | HRESULT ShowMessageView( 103 | HSTRING caption, HSTRING message, UINT messageBoxFlags, 104 | WI::AsyncDeferral> completion); 105 | HRESULT ShowSerializationFailedView(HSTRING caption, HSTRING message); 106 | HRESULT StartCredProvsIfNecessary(LC::LogonUIRequestReason reason, BOOLEAN allowDirectUserSwitching, HSTRING unk); 107 | HRESULT OnCredProvInitComplete(); 108 | 109 | enum class LogonView 110 | { 111 | None = 0, 112 | UserSelection = 1, 113 | CredProvSelection = 2, 114 | SelectedCredential = 3, 115 | Status = 4, 116 | Message = 5, 117 | ComboBox = 6, 118 | Locked = 7, 119 | SecurityOptions = 8, 120 | SerializationFailed = 9, 121 | }; 122 | 123 | LogonView m_currentViewType; 124 | 125 | Microsoft::WRL::ComPtr m_autoLogonManager; 126 | Microsoft::WRL::ComPtr m_userSettingManager; 127 | Microsoft::WRL::ComPtr m_redirectionManager; 128 | Microsoft::WRL::ComPtr m_displayStateProvider; 129 | Microsoft::WRL::ComPtr m_bioFeedbackListener; 130 | Microsoft::WRL::ComPtr m_credProvDataModel; 131 | Microsoft::WRL::ComPtr m_selectedGroup; 132 | EventRegistrationToken m_serializationCompleteToken; 133 | EventRegistrationToken m_bioFeedbackStateChangeToken; 134 | EventRegistrationToken m_usersChangedToken; 135 | EventRegistrationToken m_selectedUserChangeToken; 136 | EventRegistrationToken m_credentialsChangedToken; 137 | EventRegistrationToken m_selectedCredentialChangedToken; 138 | bool m_isCredentialResetRequired; 139 | bool m_credProvInitialized; 140 | bool m_showCredentialViewOnInitComplete; 141 | LC::LogonUIRequestReason m_currentReason; 142 | Microsoft::WRL::ComPtr m_unlockTrigger; 143 | wistd::unique_ptr>> m_requestCredentialsComplete; 144 | Microsoft::WRL::ComPtr m_lastReportResultInfo; 145 | Microsoft::WRL::ComPtr m_cachedSerialization; 146 | Microsoft::WRL::ComPtr m_inputSwitchControl; 147 | 148 | friend class CLogonFrame; 149 | }; 150 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/optionaldependencyprovider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | 5 | class OptionalDependencyProvider final 6 | : public Microsoft::WRL::RuntimeClass 7 | , LCPD::IOptionalDependencyProvider 8 | , Microsoft::WRL::FtmBase 9 | > 10 | { 11 | public: 12 | HRESULT RuntimeClassInitialize( 13 | LC::LogonUIRequestReason reason, IInspectable* autoLogonManager, LC::IUserSettingManager* userSettingManager, 14 | LCPD::IDisplayStateProvider* displayStateProvider); 15 | 16 | //~ Begin IOptionalDependencyProvider Interface 17 | STDMETHODIMP GetOptionalDependency(LCPD::OptionalDependencyKind kind, IInspectable** value) override; 18 | //~ End IOptionalDependencyProvider Interface 19 | 20 | private: 21 | Microsoft::WRL::ComPtr m_defaultSelector; 22 | Microsoft::WRL::ComPtr m_telemetryProvider; 23 | Microsoft::WRL::ComPtr m_autoLogonManager; 24 | Microsoft::WRL::ComPtr m_displayStateProvider; 25 | }; 26 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/restrictededit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | #include "DirectUI/DirectUI.h" 5 | 6 | struct CapsLockToggleEvent : DirectUI::Event 7 | { 8 | bool bFieldFocused = false; 9 | }; 10 | 11 | class CDUIRestrictedEdit : public DirectUI::Edit 12 | , public Microsoft::WRL::RuntimeClass 13 | , WF::ITypedEventHandler 14 | > 15 | { 16 | public: 17 | 18 | CDUIRestrictedEdit(); 19 | CDUIRestrictedEdit(const CDUIRestrictedEdit& other) = delete; 20 | ~CDUIRestrictedEdit() override; 21 | 22 | CDUIRestrictedEdit& operator=(const CDUIRestrictedEdit&) = delete; 23 | 24 | static DirectUI::IClassInfo* Class; 25 | DirectUI::IClassInfo* GetClassInfoW() override; 26 | static DirectUI::IClassInfo* GetClassInfoPtr(); 27 | 28 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 29 | 30 | static HRESULT Register(); 31 | 32 | void OnPropertyChanged(const DirectUI::PropertyInfo* ppi, int iIndex, DirectUI::Value* pvOld, DirectUI::Value* pvNew) override; 33 | 34 | static LRESULT CALLBACK _sSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData); 35 | 36 | void SetKeyFocus() override; 37 | 38 | HWND CreateHWND(HWND parentHwnd) override; 39 | 40 | void OnInput(DirectUI::InputEvent* inputEvent) override; 41 | 42 | HRESULT Advise(LCPD::ICredentialField* dataSource); 43 | HRESULT UnAdvise(); 44 | 45 | virtual void OnDestroy() override; 46 | 47 | //~ Begin WF::ITypedEventHandler Interface 48 | STDMETHODIMP Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) override; 49 | //~ End WF::ITypedEventHandler Interface 50 | 51 | HWND m_hwnd; 52 | const wchar_t* m_hintText = L"Hint Text Test"; 53 | DWORD m_maxTextLength; 54 | LCPD::CredProvScenario m_scenario; 55 | bool m_bIsCapslockPressed; 56 | 57 | Microsoft::WRL::ComPtr m_fieldData; 58 | int m_index; 59 | class CDUIUserTileElement* m_owningElement; 60 | 61 | static UID s_CapsLockWarning; 62 | 63 | private: 64 | void _CheckCapsLock(); 65 | bool _IsPasswordField(); 66 | 67 | EventRegistrationToken m_token; 68 | }; 69 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/userlist.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | #include "DirectUI/DirectUI.h" 5 | #include "usertileelement.h" 6 | 7 | class UserList : public DirectUI::Element 8 | { 9 | public: 10 | 11 | static DirectUI::IClassInfo* Class; 12 | DirectUI::IClassInfo* GetClassInfoW() override; 13 | static DirectUI::IClassInfo* GetClassInfoPtr(); 14 | 15 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 16 | 17 | static HRESULT Register(); 18 | 19 | HRESULT Configure(DirectUI::DUIXmlParser* parser); 20 | HRESULT AddTileFromData(const Microsoft::WRL::ComPtr& credential, const Microsoft::WRL::ComPtr user, HSTRING userName); 21 | void DeselectAllTiles(); 22 | void HideAllTiles(); 23 | void FindAndSetKeyFocus(); 24 | void EnableList(); 25 | void DestroyAllTiles(); 26 | 27 | CDUIUserTileElement* FindTileByCredential(const Microsoft::WRL::ComPtr& credential); 28 | HRESULT ZoomTile(CDUIUserTileElement* userTile); 29 | HRESULT UnzoomList(CDUIUserTileElement* userTile); 30 | CDUIUserTileElement* GetZoomedTile(); 31 | 32 | private: 33 | void _SetUnzoomedWidth(); 34 | void _ShowEnumeratedTilesWorker(int visibleIndex); 35 | 36 | static DirectUI::IClassInfo* s_pClassInfo; 37 | public: 38 | DirectUI::DUIXmlParser* m_xmlParser; 39 | DirectUI::Element* m_UserListContainer; 40 | DirectUI::Selector* m_UserListSelector; 41 | LCPD::CredProvScenario m_scenario; 42 | 43 | bool m_bIsActive; 44 | 45 | friend class CLogonFrame; 46 | }; 47 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/usertileelement.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | 5 | #include "fieldcontainer.h" 6 | #include "DirectUI/DirectUI.h" 7 | #include "logoninterfaces.h" 8 | 9 | //wrapper struct to wrap the field datasource so that you can insert fake fields such as for Locked text or the user name text 10 | struct CFieldWrapper 11 | { 12 | Microsoft::WRL::ComPtr m_dataSourceCredentialField; 13 | 14 | // used when m_dataSourceCredentialField is null 15 | CoTaskMemNativeString m_label; 16 | LCPD::CredentialTextSize m_size; 17 | // 18 | 19 | bool m_isSelectorField; 20 | }; 21 | 22 | class CDUIUserTileElement : public DirectUI::Button 23 | { 24 | public: 25 | 26 | ~CDUIUserTileElement() override; 27 | 28 | static DirectUI::IClassInfo* Class; 29 | DirectUI::IClassInfo* GetClassInfoW() override; 30 | static DirectUI::IClassInfo* GetClassInfoPtr(); 31 | 32 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 33 | 34 | static const DirectUI::PropertyInfo* TileZoomedProp(); 35 | static HRESULT Register(); 36 | 37 | bool GetTileZoomed(); 38 | HRESULT SetTileZoomed(bool v); 39 | HRESULT SetFieldInitialVisibility(DirectUI::Element* field, CFieldWrapper* fieldData); 40 | HRESULT SetFieldVisibility(int index, Microsoft::WRL::ComPtr fieldData); 41 | 42 | 43 | void OnEvent(DirectUI::Event* pEvent) override; 44 | 45 | bool m_bTileZoomed; 46 | 47 | bool m_bHasMadeSelectedFields; 48 | 49 | LCPD::CredProvScenario m_scenario; 50 | Microsoft::WRL::ComPtr m_dataSourceCredential; 51 | Microsoft::WRL::ComPtr m_dataSourceUser; 52 | DirectUI::Element** m_elementsArray; 53 | CDUIFieldContainer** m_containersArray; 54 | 55 | CCoSimpleArray fieldsArray; 56 | 57 | class UserList* m_owningUserList; 58 | 59 | DirectUI::DUIXmlParser* m_xmlParser; 60 | 61 | DirectUI::Button* m_submitButton; 62 | DirectUI::Element* m_capsLockWarning; 63 | 64 | private: 65 | 66 | HRESULT _CreateElementArrays(); 67 | UINT _FindFieldInsertionIndex(int fieldIndex); 68 | HRESULT _AddFieldContainer(int index, DirectUI::Element* Parent, CDUIFieldContainer** a5); 69 | HRESULT _AddField(DirectUI::Element* a2, int index, DirectUI::Element* Parent, CDUIFieldContainer** OutContainer); 70 | 71 | HRESULT _CreateStringField(int index, DirectUI::Element* Parent, DirectUI::Element** outElement, CDUIFieldContainer** OutContainer); // 72 | HRESULT _CreateEditField(int index, DirectUI::Element* Parent, DirectUI::Element** outElement, CDUIFieldContainer** OutContainer); // 73 | HRESULT _CreateCommandLinkField(int index, DirectUI::Element* Parent, DirectUI::Element** outElement, CDUIFieldContainer** OutContainer); // 74 | HRESULT _CreateTileImageField(const wchar_t* pszLabel, Microsoft::WRL::ComPtr& tileImageDataSource, DirectUI::Element** OutContainer); 75 | HRESULT _CreateSubmitButton(int index, DirectUI::Button** outButton, DirectUI::Element** outElement); 76 | HRESULT _CreateCheckboxField(int index, DirectUI::Element* Parent, DirectUI::Element** outElement, CDUIFieldContainer** OutContainer); // 77 | HRESULT _CreateComboBoxField(int index, DirectUI::Element* Parent, DirectUI::Element** outElement, CDUIFieldContainer** OutContainer); 78 | 79 | HRESULT _CreateFieldByIndex(int index); 80 | 81 | HRESULT _CreateFieldsForDeselected(); 82 | HRESULT _CreateFieldsForSelected(); 83 | 84 | friend class UserList; 85 | friend class CDUIZoomableElement; 86 | friend class CAdvisableButton; 87 | }; 88 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/zoomableelement.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "zoomableelement.h" 3 | 4 | #include "usertileelement.h" 5 | 6 | DirectUI::IClassInfo* CDUIZoomableElement::Class = nullptr; 7 | 8 | CDUIZoomableElement::CDUIZoomableElement() : m_index(-1) 9 | , m_owningElement(nullptr) 10 | , m_token(0) 11 | { 12 | } 13 | 14 | CDUIZoomableElement::~CDUIZoomableElement() 15 | { 16 | } 17 | 18 | DirectUI::IClassInfo* CDUIZoomableElement::GetClassInfoW() 19 | { 20 | return Class; 21 | } 22 | 23 | DirectUI::IClassInfo* CDUIZoomableElement::GetClassInfoPtr() 24 | { 25 | return Class; 26 | } 27 | 28 | HRESULT CDUIZoomableElement::Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, 29 | DirectUI::Element** ppElement) 30 | { 31 | return DirectUI::CreateAndInit(0, pParent, pdwDeferCookie, ppElement); 32 | } 33 | 34 | static DirectUI::PropertyInfoData dataimpElementZoomedProp {}; 35 | 36 | static const int vvimpElementZoomedProp[] = { 2, (int)0x0FFFFFFFF }; 37 | 38 | static const DirectUI::PropertyInfo impElementZoomedProp = 39 | { 40 | .pszName = L"ElementZoomed", 41 | .fFlags = 0xA, 42 | .fGroups = 0, 43 | .pValidValues = vvimpElementZoomedProp, 44 | .DefaultProc = DirectUI::Value::GetBoolFalse, 45 | .pData = &dataimpElementZoomedProp 46 | }; 47 | 48 | const DirectUI::PropertyInfo* CDUIZoomableElement::ElementZoomedProp() 49 | { 50 | return &impElementZoomedProp; 51 | } 52 | 53 | bool CDUIZoomableElement::GetElementZoomed() 54 | { 55 | DirectUI::Value* pv = GetValue(ElementZoomedProp, 0, nullptr); 56 | bool v = pv->GetBool(); 57 | pv->Release(); 58 | return v; 59 | } 60 | 61 | HRESULT CDUIZoomableElement::SetElementZoomed(bool v) 62 | { 63 | DirectUI::Value* pv = DirectUI::Value::CreateBool(v); 64 | HRESULT hr = pv ? S_OK : E_OUTOFMEMORY; 65 | if (SUCCEEDED(hr)) 66 | { 67 | hr = SetValue(ElementZoomedProp, 0, pv); 68 | pv->Release(); 69 | } 70 | 71 | return hr; 72 | } 73 | 74 | HRESULT CDUIZoomableElement::Advise(LCPD::ICredentialField* dataSource) 75 | { 76 | m_FieldInfo = dataSource; 77 | 78 | RETURN_IF_FAILED(m_FieldInfo->add_FieldChanged(this, &m_token)); // 19 79 | return S_OK; 80 | } 81 | 82 | HRESULT CDUIZoomableElement::UnAdvise() 83 | { 84 | if (m_FieldInfo) 85 | { 86 | RETURN_IF_FAILED(m_FieldInfo->remove_FieldChanged(m_token)); // 25 87 | 88 | m_FieldInfo.Reset(); 89 | } 90 | 91 | return S_OK; 92 | } 93 | 94 | void CDUIZoomableElement::OnDestroy() 95 | { 96 | Element::OnDestroy(); 97 | UnAdvise(); 98 | } 99 | 100 | HRESULT CDUIZoomableElement::Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) 101 | { 102 | LOG_HR_MSG(E_FAIL,"CDUIZoomableElement::Invoke\n"); 103 | if (m_owningElement && m_owningElement->m_containersArray[m_index]) 104 | { 105 | CFieldWrapper* fieldData; 106 | m_owningElement->fieldsArray.GetAt(m_index,fieldData); 107 | 108 | bool bShouldUpdateString = false; 109 | 110 | if (args == LCPD::CredentialFieldChangeKind_State) 111 | { 112 | bool bOldVisibility = GetVisible(); 113 | m_owningElement->SetFieldVisibility(m_index,m_FieldInfo); 114 | if (bOldVisibility != GetVisible()) 115 | bShouldUpdateString = true; 116 | } 117 | else if (args == LCPD::CredentialFieldChangeKind_SetString) 118 | { 119 | //m_owningElement->SetFieldVisibility(m_owningElement->m_containersArray[m_index],fieldData); 120 | bShouldUpdateString = true; 121 | } 122 | if (bShouldUpdateString) 123 | { 124 | Microsoft::WRL::Wrappers::HString label; 125 | Microsoft::WRL::ComPtr stringField; 126 | if (SUCCEEDED(m_FieldInfo->QueryInterface(IID_PPV_ARGS(&stringField)))) 127 | { 128 | RETURN_IF_FAILED(stringField->get_Content(label.ReleaseAndGetAddressOf())); 129 | } 130 | else 131 | RETURN_IF_FAILED(m_FieldInfo->get_Label(label.ReleaseAndGetAddressOf())); 132 | 133 | if (label.Length() > 0) 134 | { 135 | RETURN_IF_FAILED(SetContentString(label.GetRawBuffer(nullptr))); 136 | RETURN_IF_FAILED(SetAccName(label.GetRawBuffer(nullptr))); 137 | } 138 | } 139 | //m_owningElement->SetFieldInitialVisibility(m_owningElement->m_containersArray[m_index],fieldData); 140 | //LOG_HR_MSG(E_FAIL,"CDUIZoomableElement::Invoke SetFieldInitialVisibility\n"); 141 | } 142 | 143 | return S_OK; 144 | } 145 | 146 | HRESULT CDUIZoomableElement::Register() 147 | { 148 | static const DirectUI::PropertyInfo* const s_rgProperties[] = 149 | { 150 | &impElementZoomedProp 151 | }; 152 | return DirectUI::ClassInfo::RegisterGlobal(HINST_THISCOMPONENT, L"ZoomableElement", s_rgProperties, ARRAYSIZE(s_rgProperties)); 153 | } 154 | -------------------------------------------------------------------------------- /shell/auth/authux/consolelogon/lib/zoomableelement.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pch.h" 4 | #include "DirectUI/DirectUI.h" 5 | 6 | class CDUIZoomableElement : public DirectUI::Element 7 | , public Microsoft::WRL::RuntimeClass 8 | , WF::ITypedEventHandler 9 | > 10 | { 11 | public: 12 | 13 | CDUIZoomableElement(); 14 | CDUIZoomableElement(const CDUIZoomableElement& other) = delete; 15 | ~CDUIZoomableElement() override; 16 | 17 | CDUIZoomableElement& operator=(const CDUIZoomableElement&) = delete; 18 | 19 | static DirectUI::IClassInfo* Class; 20 | DirectUI::IClassInfo* GetClassInfoW() override; 21 | static DirectUI::IClassInfo* GetClassInfoPtr(); 22 | 23 | static HRESULT Create(DirectUI::Element* pParent, unsigned long* pdwDeferCookie, DirectUI::Element** ppElement); 24 | 25 | static const DirectUI::PropertyInfo* ElementZoomedProp(); 26 | bool GetElementZoomed(); 27 | HRESULT SetElementZoomed(bool v); 28 | 29 | HRESULT Advise(LCPD::ICredentialField* dataSource); 30 | HRESULT UnAdvise(); 31 | 32 | virtual void OnDestroy() override; 33 | 34 | //~ Begin WF::ITypedEventHandler Interface 35 | STDMETHODIMP Invoke(LCPD::ICredentialField* sender, LCPD::CredentialFieldChangeKind args) override; 36 | //~ End WF::ITypedEventHandler Interface 37 | 38 | int m_index; 39 | class CDUIUserTileElement* m_owningElement; 40 | 41 | static HRESULT Register(); 42 | private: 43 | EventRegistrationToken m_token; 44 | Microsoft::WRL::ComPtr m_FieldInfo; 45 | }; 46 | --------------------------------------------------------------------------------