snowie2000 / mactype

Better font rendering for Windows.
https://mactype.net
GNU General Public License v3.0
10.14k stars 444 forks source link

2018.1 Beta 5 not working for UWP or DirectWrite #518

Open agentjsp opened 5 years ago

agentjsp commented 5 years ago

I have the latest 2018.1 Beta 5, DirectWrite is set to 1 in the ini file, and I'm using service mode. None of the Windows 10 UWP apps, or the Settings app, or any other app in the system (Firefox without the config tweak, etc) using DirectWrite seems to be rendered with MacType.

What am I missing?

wmjordan commented 5 years ago

I installed the beta 6, however, this issue is not yet solved.

Please reopen it.

sammilucia commented 5 years ago

@wmjordan oh yes you're right! Closing #552

The uploaded test MacTray.exe in here has a newer date AND the same version number (2019.1), therefore the installer won't overwrite it

(test version is on the right). image

This is not a fault of the installer, it's behaving as intended. It's just a side-effect of messing with individual files, which is an unsupported scenario.

snowie2000 commented 5 years ago

try this one. It gives a popup of your dcom pid or the reason why it fails to get the pid.

It correctly displayed the PID of the service after stopping the running MacType service. shot

Since this build displays a modal dialog, it can no longer be started as a service any more. I got another pop up window when I exited this version which ran in tray mode and restarted it. shot

Meanwhile, it somehow popped up an error box after running for some time. shot

bugreport.txt

This file could not work either in tray mode or service mode.

I didn't quite get it. How did you get the second dialog which says "access denied"? On your exiting of the app or on the start of the second run of the app? If it's on the start, does it give you the correct pid of DCOM? Did you run it as admin every time? It needs admin privilege to get that pid.

wmjordan commented 5 years ago

The access denied was on the start of the second run of the app. I forgot to run as admin on both start. The first run gave the PID of DCOM, but the second failed. And sometimes it popped up the bugreport box.

I noticed that the mactype.ini in the default installation put svchost.exe into the [UnloadDll] section, could it be the reason for this issue?

Having read your reply, I restarted MacTray (beta6) with admin rights and removed svchost.exe from the ini file, MacType could successfully render the PC Settings dialog eventually.

shot

wmjordan commented 5 years ago

I switched MacType to run in service mode and rebooted my computer. After the reboot, it managed to render the PC Settings dialog as expected, after the removal of svchost.exe from MacType.ini.

wmjordan commented 5 years ago

I also examined the processes with Process Explorer, and was amazed to find that most svchost.exe instances were not injected with EasyHook (I did not check them out one by one since there were so many instances there), but the one which hosted the DCOM Launcher service did get injected!

It seems that the removal of svchost.exe won't get every svchost.exe instances injected with MacType, and it solves this problem.

snowie2000 commented 5 years ago

I checked the repo and the process was added on the final commit where you updated the unloaddll list from #523 @sammilucia svchost.exe should never be excluded as it is necessary to hook into all the COM processes.

@wmjordan MacTray can distinguish different svchost instances and only apply to the DCom one so that the potential side effects can be mitigated as possible.

agentjsp commented 5 years ago

I just want to point out that beta 6 doesn't work for me (service mode). The settings app and the start menu and so on don't render with mactype (though the settings window will if I go to the font page), so I'm assuming the relevant process is still not being hooked.

It seems even win32 applications that use DirectWrite aren't rendering with mactype.

Edit: So after trying the font page trick, it seems the change persisted even after I restarted the settings app several times. I don't recall it lasting that long in beta 5, but regardless I restarted the computer just now and it's back to not rendering with mactype, at least presumably until I do the trick again.

wmjordan commented 5 years ago

@agentjsp Have you ever tried to remove svchost.exe from MacType.ini. it worked on my machine.

snowie2000 commented 5 years ago

@agentjsp Have you ever tried to remove svchost.exe from MacType.ini. it worked on my machine.

You have to remove it. It is a mistake.

agentjsp commented 5 years ago

I removed it, it worked briefly after one restart (though went away), and after successive restarts it doesn't seem to work anymore. Mactype is running in service mode.

agentjsp commented 5 years ago

Services: 001 002 003

snowie2000 commented 5 years ago

Please switch to tray mode. The service mode is a bit weird in Windows 10. In your last screenshot, the svchost.exe with PID 920 should be Running instead of disabled. Could you try to apply to it manually and see if it does apply?

agentjsp commented 5 years ago

If I enable it, it says "running" for about a second and then switches back to disabled. Is tray mode where I have to manually drag every single application?

snowie2000 commented 5 years ago

Of course not, tray mode is just a more interactive service mode.

snowie2000 commented 5 years ago

If it says running and back to disabled, it most likely means that it was blocked to inject into it by something.

agentjsp commented 5 years ago

So I tried it in tray mode (with run as administrator checked) in both standalone and compatibility mode. It seems the injecting is still being blocked. Any idea what could be doing that or how I could get around it?

snowie2000 commented 5 years ago

Although the registry mode is not recommended but I think it is the only hope right now.

Do you have any antivirus installed?

sammilucia commented 5 years ago

We need to stop creating new issues against this same thread guys..... After @agentjsp 's issue is solved this thread is closed

agentjsp commented 5 years ago

This is the same original issue that I opened the thread for.

Registry mode doesn't work either, and I have no anti-virus installed besides the Windows Defender that comes with Windows 10. In general, this installation is pretty close to stock plain Windows. Is there any way for me to see which process is blocking the injection, or a way for me to "force" the injection to happen?

snowie2000 commented 5 years ago

No other way to know why it is rejected except debugging.

Maybe you can check logs in the event viewer and see if there is any information about the rejection.

Also is there any other third party dlls loaded into that dcom svchost?

agentjsp commented 5 years ago

I haven't seen anything in the event viewer. Is there a way for me to check for the third party dlls?

snowie2000 commented 5 years ago

You can see all the loaded dlls in the svchost via process explorer.

agentjsp commented 5 years ago

[snip]

There doesn't appear to be.

snowie2000 commented 5 years ago

You need administrator privileges to look into it. If you still can’t see anything with administrative privilege, your dcom process is heavily protected.

agentjsp commented 5 years ago

Thanks. Everything appears to be Microsoft related.

01 02