Recently in Windows Category

CreativeWhine Oh get over yourself! I do not need to install the music management software on my computer and not having it installed is not the end of the world. It's almost as bad as the apple updater suggesting you install Safari. Mind you, it's nowhere near as annoying about it, and it doesn't suggest that the world will end if you don't download it (but, you know, it just might...)
Flash Update Message Apparently, it needed to install a security update. I don't believe I'm using any flash applications that would keep the player in use, so why the pathetic dialog on the left after I installed it? This is one of those cases where pushing through the update makes more sense. As it is this only tells me that I need to reboot my computer to be safe from 'flash viruses'.
Is it that the flash component is so embedded in the operating system that updating it requires a reboot? If that's the case then why? it's only a little thing for displaying animations; not the end of the fricking world.
It's great. simply prettier and a lot more usable than Firefox 2. The awesome bar (the address bar) kicks ass. Much easier to use than the previous one. Bookmark management has been improved. The look and feel is nicer. I even 'kind of' prefer the subtle dialog box improvement which turns up at the top of the form, which is like a wide series of websites that perform the same thing themselves.
This definitely has replaced my web browsers in Windows and Linux. There's a very high chance that it will replace Safari on the Mac. The only niggle I have is that it doesn't store your passwords in the Mac keychain, which I still feel is the better place to have them.
Damn the electric fence...
Every time you reinstall vmware it seems to recreate your network interfaces, and at the same time reassigns the ip addresses that you had set up. If you want to move them then you need to edit a file and a couple of registry entries.
The first file is %APPDATA%\VMware\vmnetdhcp.conf. On XP it's normally C:\Documents and Settings\All Users\Application Data, Under Vista that's C:\ProgramData. Note, however that when UAC is enabled, this folder experiences redirection on write by unprivileged users, so editing this file as an ordinary user will have no effect, so make sure that you use a privileged editor when altering this file.
The content you want to change are the Subnet and Range entries to match your original subnet entries you had. You can also put in entries for the domain-name and router. When you add this information it gives you the ability to mark a the subnet as identified under Vista, so you can be in an identified network, and thus be discoverable. Please note that doing this and then putting an insecure OS on the client vm is your own fault.
The other entries that need to be altered are in the registry. The first one is HKLM\Software\VMware, Inc.\VMnetLib\VMnetConfig\vmnet? entries - the IPSubnetAddress entry needs to be changed to match the entries that you set in the .conf file. The next one is a little bit tricky - it's HKLM\SYSTEM\CurrentControlSet\Services\VMnetDHCP\Parameters\VirtualEthernetSegments\?, the value is HostIpAddress - and it needs to be mapped. The value is a endian-reversed representation of your address so if your ip address is 192.168.22.1 the value would be 0x0116A8C0, C0==192, a8==168, 16=22, 01=01. Use Calc to get the values that you should put in there.
Restart the service "vmware dhcp service", and then you should be OK.
For some reason even though I explicitly un-check the 'apple software update' option when installing either itunes or the bonjour service I am unsurprised to find that it has been installed.
Along with the quicktime icon in the notification area. Please respect my wishes to keep my notification area clear. It's already cluttered with the detritus of outlook, pidgin, vmware, creative X-fi, hotsync, sync manager, bluetooth, quickset, virtual daemon manager, the power status, network status, volume and the sidebar. At least I can switch off clock, volume, network and power if I so choose, and they respect my authoritay.
The network interfaces that get configured by vmware always fall into the 'unidentified realm'. The reason seems to be tied to the lack of a router or default gateway entry for the address.
So we cheat, and add in a router entry for the networks that is the same as the IP address of the connection and bingo, you get the option to put it into another network and give it a label! So I put both the VMware network interfaces and the Microsoft loopback interface into a group called 'local only', and providing I don't use any grotty windows virtual machines, it should service me well. Of course, this is all purely academic for those who don't use vista
I'm replaying network traffic at 1000 packets per second into a vmware client that's hosted on a vista machine. It's losing quite a few packets. the Vista OS does not appear to be losing the packets, they are simple missing on the guest operating system. This is a lot like crap, really.
Not always a problem. Except when I've got international characters in my filenames. Which seems to be quite common with the import albums I'm downloading.
Dang. There is a patcharound, but it's unsupported. Honestly, this backwards compatibility is a pain in the ass.
The next issue is cygwin/X. It's hanging on Vista. Seems to be related to dwm and the pretty aero effects and the occasional toggle to non-aero mode caused by some applications (not java 1.6, though).
It turns out that if the privileges on a file/folder contain users/groups other than the standard set (Owner - explicit or CREATOR OWNER, SYSTEM and for the most part Administrators) then it assumes that you're sharing it - even if the users in question have no privileges on the file. While I agree with the idea in concept, the terminology is too vague. There's sharing, in the local concept - which is to say that the privileges are relaxed enough to allow access to the file by users other than yourself and then there's sharing in the remote sense - which is to say that the file can be accessed from a remote system. Honestly, I'd not have used the moniker of 'sharing' the file.
Well vista is being a bit of a pain. When hardware DEP was switched on in XP service pack 2, I immediately went and turned on the 'opt out' policy - i.e. I would selectively switch on the applications that needed to have hardware DEP disabled. Most of my applications worked well, and the few exceptions were easy to take care of.
For some bizarre reason I don't get the option of disabling hardware dep on applications that crash under vista; or at least it may be selective.
dvdidle pro is one of those applications which started crashing under Vista. The problem was that it only said 'this program has stopped working', no explanations given. When I went and manually disabled DEP for it it all started running just fine again. I prefer to have a longer lasting battery, thank you very much.
Let's see. I have copernic desktop search, which injects itself into pretty much every process that's running on my desktop.
then we have the nvidia nview desktop manager, which is pretty useful in a multi-monitor setting. It also insinuates itself into every process that runs on the desktop.
The end result ... they keep hitting each other over the back of the head.
Steam is a great idea. You get to download your games and you can play anywhere that you can log in to steam. The problem is that the prices of the games are a bit on the high side. For example today Eidos have announced a load of their games are now on steam. Hitman: blood money is $35.95. It's cheaper to walk into your local game store and get it there.
For some reason the re-release on steam pumps the price up over what you can get in the stores. And then it stays there. You get the occasional reduction in price, but overall the price of each game remains reasonably static for it's life on the system. Which is frustrating.
It was something brought up by Joanna Rutkowska that her original pagefile attack on Vista was now stalled because Microsoft removed the ability of administrative users to perform write operations on the physical disk. So what happens to all those developers of undelete utilities (use a second disk?).
Firstly, lets look at the attack in more detail. What happens is that the kernel is forced to swap out pages of memory from drivers that are loaded in the kernel. These pages are swapped out to disk. I for one find this to be an incredibly stupid place to swap out the pages, as after all, until the kernel is completely done with a driver the original copy remains on disk.
Ok, maybe it had something to do with the new paging mentality of vista (you can page onto a usb memory device if it's fast enough).
Damn, I'm talking myself out of my own argument.
No, paging of code from binaries should revert to the on-disk copy unless they have made COW modifications to their segments (does windows do this?)

My Frelling Documents

| No Comments
The old new thing has a short article about the use of the My Documents, which links to a short entry about the use of the Documents folder on the Mac.
Let's see how many folders I have on my little box that are not of my creation
05/05/2006  13:39    <DIR>          ACT Projects
05/05/2006  13:40    <DIR>          AdobeStockPhotos
24/11/2006  19:30    <DIR>          Bluetooth Exchange Folder
04/12/2006  22:29    <DIR>          Borland Studio Projects
23/08/2006  17:15    <DIR>          History
04/05/2006  14:02    <DIR>          InterVideo
06/12/2006  22:01    <DIR>          Java Development
12/10/2006  13:07    <DIR>          My Albums
05/05/2006  13:49    <DIR>          My Data Sources
01/11/2006  15:29    <DIR>          My Digital Editions
29/12/2006  03:06    <DIR>          My Downloads
05/08/2006  16:19    <DIR>          My DVDs
08/08/2006  18:26    <DIR>          My Games
05/05/2006  13:53    <DIR>          My MMS
25/12/2006  21:04    <DIR>          My Music
28/12/2006  11:42    <DIR>          My Pictures
11/05/2006  10:19    <DIR>          My Received Files
05/05/2006  13:53    <DIR>          My Shapes
05/05/2006  13:53    <DIR>          My Skype Content
11/05/2006  10:19    <DIR>          My Skype Pictures
27/12/2006  22:10    <DIR>          My Videos
07/12/2006  14:43    <DIR>          My Virtual Machines
21/12/2006  09:34    <DIR>          My Widgets
12/12/2006  10:11    <DIR>          Nero Recode
05/05/2006  13:53    <DIR>          NeroVision
27/11/2006  14:40    <DIR>          PSP Games
27/11/2006  14:56    <DIR>          PSP Sync
06/10/2006  17:18    <DIR>          Rogue Trooper
05/05/2006  18:23    <DIR>          SimCity 4
15/10/2006  23:57    <DIR>          Source Insight
05/10/2006  20:16    <DIR>          Tomb Raider - Legend
05/05/2006  13:59    <DIR>          TT Installer Logs
14/11/2006  12:14    <DIR>          Updater
05/05/2006  13:37    <DIR>          Visual FoxPro Projects
17/11/2006  22:39    <DIR>          Visual Studio 2005
25/09/2006  18:02    <DIR>          Visual Studio Projects
I mean, what the frel is TT Installer logs? For the most part, all code goes into a version controlled sub directory, which is not under my documents (that would be silly). Bleugh... the save game location being under My Games is fine, but not in my documents; maybe under Application Data/Local Settings/Games would make more sense. You can't load them except from the game so why have them there.
Finally deactivated that fracking red mercury bomb. For the last mission I decided that all bets were off for all the other characters in the game - really should not have done that as it sent my stats into the floor. Prior to this mission it was practically 100% intact bad guys, for some places. Well, leaving the boat blow up doesn't count, does it?
God, this one really annoys me. I've installed an application and it puts the shortcuts into the root of all programs. I move it where I want it to be (There was no choice on install). Then I run said program. Up pops the windows installer and recreates the shortcuts in the root of the start menu.
You ignorant stupid rat b*****d wh***son of a b****h. What; do you think you own my computer? Away with you and your crappy force fix of my choices as a customer. This complaint brought to you by shite software and a harkening back to why is there no programmatic access to the Start menu pin list. Thank you for small mercies.
Firstly, it's cool that they are there. Rather than having to do something surreal involving runas, explorer and a couple of other things to allow you to run an application at a privileged level you now encounter the ubiquitous shield icon, which tells you that to perform this operation you need to acquire the appropriate privileges. It's a lot like the linux sudo, except by default you just have to click the 'continue' prompt instead of a password.
Pretty cool, even if you're an administrative user, you don't start with all the privileges that your group memberships provide.
Here comes the rub - I've stopped reading the prompts, I just find the one that tells me how to get to the next step and click on it. I'm not positive, but I think this is probably par for the course for other users as well.
Shame that, nice idea, but hamstrung by having too many things need administrative privileges.
When I converted the id3 tags to v2.3 all the album art went to the correct format. Interesting issue that. By noting it here I hope that it will help someone else. iTunes has been great for this as it can convert between various tag types (from v1.1 through). I've shoved my collection to version 2.3 tags, and it seems to have solved the problem with the screwed up album art.
Let's see, a bulk change of many thousands of tracks should take all night.
Interesting thing that Windows Media Player 11 does to the artwork on albums you possess is to place them in a cache directory under %USERPROFILE%\Local Settings\Application Data\Microsoft\Media Player\Art Cache\LocalMLS. Each one is names after a guid, which is probably generated for each track in the collection.
I'm just wondering how difficult it would have been to use a hash of the image data as it's file name, and storing the hash in the media library instead of the pointer to the guid. This way when you have duplicate images (typically 10 per album), they are not replicated into the cache of images.
The other complaint is that I've got a bunch of black album art images. It's completely odd, as they seem to be completely ok inside in the file - other tools have no difficulty in examining them, and show correct icons. Maybe I should feed this back to them - after all it's a beta of media player 11.
For some reason the ^G character is not performing a 'default system sound' when it happens. No idea why, probably a misconfiguration on my behalf. It makes using a console very annoying - for example every exception on vmware produces an annoying beep when anything wrong happens.
The solution is in, of all places, the MSDN reference for Beep(), which states in small print to type: net stop beep followed by sc config beep start= disabled
Reenabling it involves typing: sc config beep start= system followed by net start beep
I hope you found this as useful as I did.

Waiting for Vista

| No Comments
It's my own limited homage to Samuel Beckett. :-)
Direct3D 10 (AKA DirectX 10) is a Vista only item. Considering the driver model changes for Vista I can see how you would have a problem shoehorning the API back into XP. The problem is that they keep delaying the release for various reasons meaning that the games keep being delayed. The longer you delay the OS the later it will be adopted. I'm not planning on an upgrade until I've heard a reasonable amount of feedback as I can't afford to waste time troubleshooting problems. Considering that everything native I'm developing has to be backwards compatible with Windows 2000, my upgrade path has been restricted somewhat.
The new toy has the dreaded 'Windows Vista Capable', which is a tad suspicious.
I encountered a real dunderhead of a program. It claims to be completely NT, 2K and XP happy, yet it doesn't tell us it needs administrator access because it creates it's temp files in C:\, yes, the root of the C drive. There is a perfectly good API available for making good, clean temp files - it's called GetTempFileName. for a bonus there's GetTempPath, which gets you a directory for creating temp files, and this directory stands a really good chance of being user isolated (being that it's %USERPROFILE%\Local Settings\Temp on most NT based OSes). But no, you go and ruin my perfectly working ordinary user program by insisting that you run as administrator. Bloody not written by me sub-programs. You deserve great pain for what you have done.

Detecting debuggers

| No Comments
Let's assume that we're all using an NT based OS (2k, XP, 2003). It's a simple matter to detect that you're being run unde a debugger - simply isue an IsDebuggerPresent call. Heck, you could even put it into a thread that intermittently polls and reacts (in)appropriately.
Of course, I'm not one for polling. Never have been. I just consider it 'lower class' to do something like that. This is of course why I like the next trick for detecting the arrival of a debugger.
what happens is that an external thread attaches and executed the 'DbgUiRemoteBreakin' function; which at some point issues an 'DbgBreakPoint', which of all things contains an int3 and a return statement (this is a kick the debugger operation).
Detecting the debugger consists of rewriting the function implementation.
What we want to do is invoke our function (fun) when a debugger attaches. The following code does just that, and as a result of the attachment of the process simply spits out a message and terminates.
#include <windows.h>
#include <stdio.h>

HANDLE wh;

void
message(void)
{
        SetEvent(wh);
        ExitThread(0);
}

int
main(int argc, char **argv)
{
        unsigned char *abki;
        HMODULE dlh;

        wh = CreateEvent(NULL, FALSE, FALSE, NULL);

        dlh = GetModuleHandle("ntdll.dll");
        abki = (void *)GetProcAddress(dlh, "DbgUiRemoteBreakin");

        if (abki != NULL) {
                DWORD olp;
                if (VirtualProtect(abki, 20, PAGE_EXECUTE_READWRITE, &olp)) {
                        *abki++ = 0xb8; // Mov EAX,
                        *(DWORD *)abki = (DWORD)message;
                        abki+=4;
                        *(WORD *)abki = 0xd0ff; // call EAX
                } else {
                        printf("Page Protection Failed\n");
                        return (1);
                }
        }
        WaitForSingleObject(wh, INFINITE);
        printf("Debugger\n");
        return (0);
}
This is the beginning of something bigger.
Uninstalling Visual Studio .NET. It's taking an age. All this so I can install visual studio 2005 and hockey things up again :)
I was experiencing this occasionally when implementing the delete functionality for a browse window. It turns out that I was not positioned on a record, but instead was either before first or after the last record. Simple problem, really but a bit of a pain to discover the reason as the error isn't really informative.
The solution was to do move to either the first or last record. Thanks to the magic of the 'meta bof/eof records'. I have to use the description loosely, as they definitely ain't records and the correctness police would be rapping my knuckles for such a statement.
Discovering the solution was not helped by the browse grid control I was using - it seemed to indicate that I was on a record when in reality it wasn't. Another case of model does not match the implementation.

Who's living in what apartment?

| No Comments
It's the COM apartment models. They're related to the threads that make use of COM objects. What happens is that when you initialize COM for a specific thread you declare that it's either Apartment Threaded (AKA Single Threaded Apartment) or Multi Threaded.
When you use the Apartment threading model, it means that the COM object is isolated within the thread that created it. The most important piece of information about this model is that you should never use that object in another thread - it causes brokenness.
When you use the multi-threading model, what you're pretty much saying is that I'm probably going to use this COM object in several threads. The way it works is that a multi threaded model, then the context is shared within the process.
The model you support also puts extra complications on you, the creator of the object. COM objects with a declared MT support must use some synchronization to protect shared information within the object, otherwise you'll suffer from data corruption due to threads walking over the data. You don't have any of these considerations in a Single threaded model - you're guaranteed safe and sane interactions.
Additionally, when you're in COM land, remember never just WaitFor*, but instead MsgWaitFor* things. This also applies to using DDE. This is because the Apartment model uses windows messages under the hood.
[Listening to: TWiT 38: MacWorld Expo - Leo Laporte and the TWiTs - this WEEK in TECH (1:19:01)]
Well, tricked out with the new procexp.exe, I wondered how it did it's magic 'replace the task manager' option. It turns out that this magic is from the Image File Execution Options registry key entries. There's a blog entry which describes this feature. process explorer sets itself up as the debugger application for taskmgr.exe, when you try to launch taskmgr, it launches procexp first as it's debugger, which then doesn't launch taskmgr.

About this Archive

This page is a archive of recent entries in the Windows category.

Software is the previous category.

Find recent content on the main index or look in the archives to find all content.