Windows Vista, Windows Firewall, Base Filtering Engine, vLite
Sunday, December 21, 2008 10:24:07 PM
TrackMania and NAT
First, since I'm behind a NAT, I needed to configure port-forwarding in my router (which, by the way, is my desktop computer). It was easy to find out which ports were required:
1. Searching google, I found this topic.
2. Going to TrackMania launcher -> Configure -> Advanced -> Network, I can see and even manually choose the ports used by the game.
3. I could also run netstat -p -a in a command prompt.
The default ports are 2350 and 3450, both TCP and UDP. Note that you don't need to manually type your external IP address in Force server address field (as described in that topic). TrackMania servers are smart enough to discover your correct IP address automatically.
But then... it did not work. So I did some testing...
netcat for Windows
netcat is a small tool, commonly available for Linux and other Unixes, that can be described as cat over network. Basically, the stdin is sent through the network, and data coming from network is printed at stdout. One of the most important features is that it can act as a client (connecting to an arbitrary port on an arbitrary server) or as a server (listening to an arbitrary port, waiting for some connection). See more links about netcat.
So, I downloaded nc110.tgz and tried to see if I could connect to my Windows Vista machine from outside hosts. And I couldn't...
Damn Windows Firewall
Of course, when network-related things fail in Windows, the first thing to blame is the Windows Firewall.
Let me see... Hum... Firewal is OFF. How could the firewall be off and still be blocking things? Well, it's Windows, everything is possible. I guess it could, by default, block all incoming connections. Okay, then, let me start it... WHAT?
Windows cannot start Windows Firewall service.
Okay, let me try again, another way... Start -> Programs -> Administrative Tools -> Computer Management -> Services and Applications -> Services. Select Windows Firewall from that huge list and click start...
Error 1068: The dependency service or group failed to start.
Okay, nice. A hint. The problem is not exactly the Windows Firewall, but one of its dependencies. But... How can I find its dependencies? Hmm... Clicking here, and there, looking at properties window... Nothing! Damn it, Windows sucks!
Googling around... Found a topic with many answers. Let me try one-by-one:
1. Run netsh winsock reset... Reboot... No, nothing, it still does not work.
2. Try to delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall... I don't even have this registry key/folder!
3. Run sfc /scannow, as described in Some Windows Vista functions may not work, or Windows Vista may stop responding. Hum... This might be something!
C:\Users\Administrator>sfc /scannow Beginning system scan. This process will take some time. Beginning verification phase of system scan. Verification 84% complete. Windows Resource Protection found corrupt files but was unable to fix some of th em. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log
Then it says to run findstr /C:"[SR] Cannot repair member file" %windir%\logs\cbs\cbs.log > sfcdetails.txt. Hmmm... findstr? Is this some kind of grep? Looks like so.
Anyway, there was no "Cannot repair" string in that 25.3MB CBS.log file.
Base Filtering Engine
All of this is leading me to nowhere! I need solutions, or at least hints to find the solutions!
I don't remember where I found this, but I can run sc qc SERVICENAME to get information about a service. Looking at the Services window, I found that Windows Firewall is actually MpsSvc. Running sc qc mpssvc, I get mpsdrv and bfe.
Running sc query mpsdrv I see that this service already running.
Running sc query bfe I see that it is stopped.
BFE is Base Filtering Engine, which fails to start when I try.
Error 15100: The resource loader failed to find MUI file.
Oh, nice! This is some progress! Now I know why this server can't start. But... huh... WHAT file is it looking for? Obviously, there is no obvious way to find that under Windows...
Fortunately, I found an useful topic at vLite forum. Prior installing Vista, I customized it using vLite. That way, I could remove tons of features that I didn't need, resulting into a really small install disc (I think I could make Vista install fit in a CD, which is about 700MB) and a lot less wasted space on my hard drive.
At that topic, they talk about a missing "C:\Windows\System32\en-US\polstore.dll.mui" file. Capturing file accesses using Filemon, I could confirm what they said at that topic: starting that service tries to open "C:\Windows\System32\en-US\polstore.dll.mui" or "C:\Windows\System32\en\polstore.dll.mui". (it also tries to open "wersvc.dll.mui", but not when starting BFE)
So... I need this file. What is the easiest way to get such file? Obviously, ask to a friend to send it for you!
Waiting for his e-mail...
Downloading that file...
Moving it to the right directory...
Trying to start Windows Firewall...
Now that I can start Windows Firewall service, I can turn it off.
Let me do some tests using netcat... Working!
It seems that Base Filtering Engine was the key here. It is automatically started with Windows, and should be running even if the Firewall itself is off.
Okay! Now I can finally show my track to my friend!
Well... except for one little problem: right now he is busy playing Half-Life 2, and won't open TrackMania. Oh, well...
Extra info, added a few hours later
And, in other news (not related with the issue discussed above), Windows froze. Two times. And froze in a hard way, so that the three-finger salute did not work! (although alt+tab did work for some time) I was, then, forced to reboot the hard way: keeping the power button pressed for 5 seconds.
And, in the last reboot, I found some weird things. The Steam shortcut at my desktop was not working, but I could copy a working link from the start menu. Then, upon starting Steam, it asked for my username/password. What? Have you forgotten it? Okay, let's see what else is broken... Damn, TrackMania United Forever forgot me, asked for my CD-Key and my login/password. And... what's more... it forgot ALL medals that I had archieved locally but didn't get during an official race (which is one that gets ranked on TrackMania master servers). Damn it... some tracks were REALLY difficult, too sad that I lost those medals... Fortunately, all replays and extra content are still there. Let me see if anything else got broken... Yeah... Firefox forgot everything too. *sighs*
So much time using Linux that I forgot how it is like to use Windows.