Thursday, May 05, 2016

The blog has moved

Blogger seemed to be getting a bit tired, so I've shifted my blog to a new home. Head over to https://blog.yuo.be for the new one!

Monday, March 28, 2016

Windows 10: The bugs that irk me

There are a few small bugs in Windows 10 that, despite being small bugs, manage to irritate the hell out of me.

1. Desktop icon positions reset themselves during graphics card driver update

This is a peculiar one, as it happens on my desktop, but not on another PC. The bug is simple: while GeForce Experience is installing a new driver, the icons on my desktop are automatically rearranged (as if 'Auto arrange icons' was turned on and then off again). (I only mention GeForce experience, as that's how I get my driver updates.) Now, I keep some frequently used shortcuts near the right edge of the screen, so having them automatically moved from there and mixed in with the other icons is annoying to say the least. And, nVidia release driver updates fairly frequently so it is at least once a month it happens.

Since it doesn't happen on my laptop, I can only guess it's related either to using 125% DPI or having an external display.

2. Bottom line of command prompts cut-off

When you reach the bottom of a command prompt, the active line ends up being half cut-off.

You can scroll down, but it will just happen again when you next reach the bottom of the window. My best guess again is that this is a high-DPI bug, since it doesn't happen on my laptop (which is set to 100% DPI).

3. Pressing Ctrl on the lock screen doesn't always bring up the login screen

I like pressing Ctrl to wake up my monitor and bring up the login screen, because it is usually a fairly innocuous key to press. The problem is that sometimes pressing Ctrl on the lock screen brings up the login screen, while other times it does nothing. I have no idea what the pattern is here (though I'm pretty sure there is one).

4. It wakes up in the middle of the night to finish installing updates

My laptop is in my bedroom. If I hibernate it, Windows likes waking up in the middle of the night to finish installing pending updates. So, I get woken up by the sound of the laptop's DVD drive initialising and a glaring display. I have no idea who thought this would be a good behaviour – Windows 10 giving me sleep problems ranks among the worst problems it could give me. I don't even think it installs the updates properly (or it wakes up early and does nothing for a fair while). I haven't found a way to disable this behaviour, so I've resorted to using shut down instead. My laptop is left connected to the mains, if it matters (I hope it does, since it'd be even worse if it happens when running on battery, or the laptop was in a laptop bag, say).

5. When installing new builds, it reinstalls different drivers

I have a laptop enrolled in the Windows Insider Programme. Whenever a new build is installed, it installs a touch pad driver with a version lower than the one I had previously installed myself. So, whenever a new build is installed, I have to manually reinstall the correct touch pad driver version. Pretty annoying, as some touch pad software/driver settings get reset in the process.


All of these problems are current, on fully up-to-date Windows 10 installation as of today (28 March 2016).

Sunday, January 24, 2016

If you delete the WINDIR environment variable, it's (almost) game over

I came across an interesting problem recently. I was editing some environment variables on a Windows 10 PC, using some third-party software. After doing that, a few things started behaving oddly, such as some system programs would not open. Things got worse after rebooting: I could not right-click on the start button, I could not open Task Manager, I couldn't start anything that required elevation and Windows Firewall kept telling me it was turned off.

Most of the actions that failed to do anything would hang for a fair while, eventually displaying dialog boxes with the message 'The system could not find the environment option that was entered'. Like this:


As it turned out, the cause of all these problems was that WINDIR environment variable had been deleted. (Of course, not intentionally.) And it really was was catch-22: I could not edit the system environment variables without elevation. The best I managed to do was kill explorer.exe using Process Explorer, start a command prompt, set %WINDIR% in the command prompt and start explorer.exe. Alas, that only helped marginally, and trying to open the advanced system properties (SystemPropertiesAdvanced.exe, as it turns out) in the same way did not work.

All was not lost: I could still access the modern settings app and reboot into the recovery menu. From there, I was able to use System Restore to go back a day to when WINDIR was still present. (Of course, I'm sure there are other ways I could've fixed it, but I just took the easiest and quickest solution as the time.)

After all that, I was curious about whether the standard Windows environment variables editor lets you delete the WINDIR environment variable. I just tried (in a VM of course): yes, it does.

Sunday, January 17, 2016

The death of Google Cloud Print on my MX895 printer: a story of ineptitude

I bought a Canon PIXMA MX895 all-in-one printer in May 2012. In fact, I was one of the first owners of the printer in the UK, having pre-ordered it the previous month. The printer was on sale from then until around April 2013.

One of the features the printer had was Google Cloud Print. The printer didn't support it out of the box – it needed a firmware update to add support for it (although it was available on day one). And, since then, I used the Cloud Print feature sporadically.

Fast-forward to late last year. I tried to use Google Cloud Print, but all I got was useless error messages from the printer about it not being able to connect to the server. Suspecting something was up, I set about Googling and can came across this discussion. As it transpired. Google deprecated the authentication API the device was using in April 2012, before there was even any stock of the printer in the UK. And, while Canon have released firmware updates for more recent models, for some models Canon will not release updated firmware, stating in a support article dated 1 September 2015:
Google has recently announced future planned changes to the server authentication method of their Google Cloud Print™ (GCP) service. An impact of these changes will be that specific Canon printers will no longer be able to support Google Cloud Print™ (GCP) because the printer firmware cannot accommodate these planned changes.
Recently is certainly a stretch. I suspect what they mean is that Google recently followed through on something announced over three years ago. For models other than my one, the timeline is even worse. The MG5450, for example, was announced in September 2012 and on sale until around September 2013.

Needless to say, I wasn't exactly impressed on learning all of this. To top it all of, as of writing, Google UK are still listing the MX895 as a Cloud Print printer1.

1No idea if that link will redirect outside of the UK.

Migrating a Windows 10 installation from MBR to GPT/UEFI

I recently updated to Windows 10 on a Z170-based motherboard, but my Windows installation was an MBR-based one rather than a modern UEFI one. I wanted to switch to a UEFI installation for the marginally fast boot time – without losing data during the switch – but most of the information online about doing that involved either purchasing software to do it or dubious use of command-line utilities.

Somewhere, though, I came across the strategy of backing up the current Windows installation, making a clean one in UEFI mode in order to create the relevant boot partitions etc., and then restoring the Windows partition from the backup. I was upgrading my system drive to a larger SSD so it seemed like a good time to give it a go. And indeed, it worked fine, so I thought I'd document the steps I followed here in case it helps anyone else.

The process requires some spare space on another drive in order to save an image of your system drive. Naturally, if you follow these steps and something goes wrong, I don't take any responsibility – it goes without saying that you should make doubly-sure you have everything backed up.

The steps are roughly as follows:
  1. Download the Windows 10 Media Creation Tool.
  2. Use the tool to create a Windows 10 installation image on either a flash drive or a DVD. I used a flash drive.
  3. Back up your system drive using drive imaging software. Macrium Reflect (free) should do, but I used the bootable version of Acronis True Image 2016 (not free) as I already had it. The software you use should allow you to selectively restore partitions from the backup to a partition of a GPT drive. If you are not using a bootable version of the imaging software, then it also needs to be able to restore backups to the system drive. Make sure you validate your backup to make sure there is nothing wrong with it.
  4. At this point, I installed Windows 10 in UEFI mode to my new disk drive. It took minutes to install to a decent SSD from a decent USB 3.0 flash drive (surprisingly fast when compared to how long the upgrade from Windows 7 to 10 took). I disconnected all the other drives in my PC out of an abundance of caution. To install Windows in UEFI mode you need to boot from the Windows 10 installation media in UEFI mode. For me this was achieved by pressing F8 when on my BIOS splash screen and then selecting the entry for my flash drive that was prefixed with UEFI. If you're reusing your existing drive for the UEFI installation, you will need to delete all the partitions on it. You should be able to do this in Windows 10 setup, but I haven't tried that.
  5. When prompted for a product key, select the option saying you don't have one, and then select the relevant Windows edition.
  6. A couple of screens later, you'll need to select your disk drive and create a partition. If you booted the installer in UEFI mode correctly, another three partitions (recovery/system/MSR) should be automatically created when you create the one to install Windows to, leaving you with four in total. If that doesn't happen, you might not have booted in UEFI mode.
  7. You can click through the remaining setup options – they don't matter much as we are just going to overwrite the Windows installation.
  8. Once installation is complete, you need to restore the Windows partition from your backup to your drive using your drive imaging software. You need to only overwrite the current Windows partition with the one from the backup – take care not to restore the whole disk which will wipe your GPT layout.
  9. Reboot and if everything worked as planned your old Windows installation should be back!
  10. You should now be able to disable CSM in your BIOS, which should reduce POST time a bit.
Hopefully that helps someone else – doing this and disabling CSM did indeed make a reasonable improvement to my boot times.

Wednesday, January 06, 2016

Today I learned...

...in the properties for devices in the Sound control panel applet, you can right-click on the volume bars and change the units to decibels:



Friday, January 01, 2016

A change of web host

I shifted yuo.be to Amazon Web Services. Here's a recent screenshot of the 'Time spent downloading a page' graph from the Googlebot crawler stats displayed in the Google Search Console:

Can you pinpoint when the switchover happened? Yes, my old host was that bad.

The baseline 'Pages crawled per day' has also increased – presumably it was throttling itself before...

Wednesday, December 30, 2015

The death of IMpeg2Data and the false start of IPSITables


In the Windows Vista-era, I wrote a DVB-T program. Apart from letting you view TV, it read and parsed DVB-SI. With the removal of Media Centre in Windows 10, I recently tried to get it working again but quickly hit a fairly major snag.

I was using the IMpeg2Data interface to retrieve DVB-SI. In particular, the IMpeg2Data::GetTable and IMpeg2Data::GetStreamOfSections methods.

However, you'll note that Microsoft state:
[IMpeg2Data is no longer available for use as of Windows 7. Instead, use the IPSITables interface to get program specific information (PSI) tables from an MPEG-2 transport stream.]
Fine, the API has been replaced, it should be straightforward to use the new one. Except, it is very poorly documented, and the documentation that is there does not make sense.

Let's have a look at the documentation for the parameters of the only method that the new interface has, IPSITables::GetTable:
dwTSID [in]
Transport stream identifier (TSID) for the table that is retrieved (bytes 0 - 15) and the original network ID (ONID) for an Event Information Table (EIT) that is retrieved (bytes 16 - 31).
dwTID_PID [in]
Table identifier (TID) or the program ID (PID) that identifies the transport stream packet.
dwHashedVer [in]
Hash value that identifies the table contents.
dwPara4 [in]
PID for a Program Mapping Table or the service ID (SID) for an EIT. Otherwise, not used.
ppIUnknown [out]
Pointer to the IUnknown interface for the table object that is retrieved. The caller is responsible for freeing the memory.
How many things are wrong with it?
  • Can a DWORD store 32 bytes now?
  • Is a PID is a program ID now rather than a packet identifier?
  • What the hell the hash value (or hashed version as suggested by the name of the parameter) – the word hash comes up in neither ISO/IEC 13818-1 nor ETSI EN 300 468. CRC32 does – but how on earth would you know the checksum of the table you are trying to retrieve?
  • When do you put the TID in dwTID_PID and when do you put the PID? If you put the PID there, where do you put the TID?
  • What do you put in bits 16 – 31 of dwTSID when it's not an EIT?
  • What do you do if you don't know the TSID?
  • And even if you manage to work all that out, you get a pointer to an IUnknown interface, with no information on what interfaces it actually implements!
As for IMpeg2Data::GetStreamOfSections, there doesn't appear to even be a replacement.

The old IMpeg2Data method was reasonably well-documented and more importantly the method parameters actually made sense.

I wondered what Microsoft actually meant by IMpeg2Data is no longer available for use as of Windows 7. I noticed that the filter and interface are still present. Alas, my experience of what they mean is that IMpeg2Data::GetTable times out and returns EVENT_E_INTERNALERROR, while IMpeg2Data::GetStreamOfSections returns S_OK but no data ever arrives. It is bizarre as it suggests the method implementations are still in place.

In any case, I'm pretty sure my TV app will never work again. Never mind...

Tuesday, December 29, 2015

Windows 10: 'How do you want to open this file'? dialog box

It certainly feels like all the feedback I enter into the Windows Feedback app on Windows 10 ends up in free fall towards the floor of a bottomless abyss. So, perhaps inscribing my thoughts on the more traditional world wide web will be a more productive use of time.

My first in a series of complaints is the 'How do you want to open this file?' dialog box:



My initial complaint (which I'll come back to) was simply that it does not mention which file it is talking about. On closer inspection, though, there are other things amiss. Firstly, albeit a minor quibble, the title seems a bit silly to me – if someone asked me that question I would probably reply 'quickly'. Not sure what is wrong with 'Which app do you want to open this file with?' (apart from being slightly longer).

Secondly, if you view the images at their original sizes, you'll notice the icons are distorted. I use 125% DPI on this PC which is presumably something to do with it.

Back to the original complaint. It can be summarised as: I was running a script in the background. The script sometimes runs a Python script. Some time after I started the script, one of these dialog boxes popped up and I had no idea what file it was referring to. It annoyed me that it did not tell me.

Now I've started writing, I've realised I have even more complaints with this dialog box. Why does it close when you click somewhere else? There is zero visual indication it is going to do that. And, why is there no cancel button?

On my laptop, if I try to open a JPEG I get this:


I haven't as yet selected "%1" to see what happens.

And here's another one. If you try to change the program associated with a file extension via Control Panel, you get this version of the dialog box:


The title makes no sense. There is no 'this .py file'!

Tuesday, July 05, 2011

Welcome to the club

It looks like iTunes can join the mega-GDI-resource-leak club:

Congratulations (?)

Wednesday, April 27, 2011

Broken drivers

Lenovo finally posted an updated driver - version 267.21 - for the Nvidia NVS 3100M chipset in my ThinkPad T510. Unfortunately after installing it I was greeted with strange, but horrible, colour banding. Do they test these things? I also tried 270.61 from nVidia - which actually supports my laptop for a change - but alas, the same obvious problem was present. I reverted to version 260.63, which works fine.

Lenovo also posted an updated Intel Wi-Fi driver, version 14.0.1. This one gave me BSODs, I think when entering sleep mode. Back I went to the official Intel version, 13.5.0, which seems to works fine.

And let's not forget the Bluetooth drivers which wipe your hard drive when upgrading/uninstalling them. The only warning you get from Lenovo is a tiny "Please back up your important data before running the update." I have not bothered to remove them....

Sunday, March 13, 2011

Adobe Reader X 10.0.1: bugged

Hi Adobe,

You might want to do a better job testing your software before releasing it.

I was happily reading a PDF document when I wondered why the taskbar clock was where the start button should be. Also, Adobe Reader had rendering glitches everywhere. Recognising the symptoms, I fired up task manager:



Yes - Adobe Reader X 10.0.1 has a large GDI-resource leak bug. This happens when the semi-transparent light blue search box overlay is visible. If you are in select mode, a chunk of resources will be leaked every time the text cursor flashes. Otherwise, just scrolling around will leak a chunk of resources. Eventually you will reach the default 10k limit. Lovely. Eventually my taskbar responding.

Monday, February 28, 2011

Some never learn

I downloaded the Dragon Age II PC demo, to find that mouse wheel support is broken - a familiar tale. (Specifically, support for freely rotating mouse wheels with non-120-multiple wheel rotation values). Ho-hum.

Sunday, February 27, 2011

Careful with SHAutoComplete

If you call it with a NULL HWND, it will return E_INVALIDARG but leak six GDI handles (seen under Windows 7 SP1).

Yes, you can blame the caller, but 'tis just something to note.

Tuesday, July 13, 2010

Thoughts of the day

1. Surely a (laptop) recovery DVD that depends on the original storage drive partition layout to be (loosely) intact is a complete fail? I'm looking at you, Acer.

2.Some people might call that a memory leak, Notepad++. I'll try version 5.7: let's hope it's better even if it doesn't make any specific promises about this.

3. The hot fix for the Windows 7 erroneous file is corrupt nonsense was finally released a few weeks ago.

4. Some questions on notification icons (tested on Windows 7):
  • When pressing Enter on a focused notification icon, why are two NIN_KEYSELECT notifications sent to the associated application? (i.e. when using Windows 2000 or newer behaviour), Space was OK, as I remember.
  • In the main notification icon area, why are WM_XBUTTONDOWN/WM_XBUTTONUP notifications sent when the 'X' buttons are pressed over another icon?
5. Why do PC modern games still have problems with freely rotating mouse wheels (with non-120-multiple wheel rotation values)? I'm looking at you, Dragon Age. Even worse is to not bother fixing it.

Friday, June 11, 2010

Microsoft SAPI text-to-speech fun

It seems to fail at resampling. I tested on Windows 7 with the stock Microsoft Anna voice; you probably won't notice unless you use an alternative output (e.g. write to file) and specify a non-native sample rate (I suppose most people don't do that).

Handily I was in the context of a foobar2000 component, so I was able to make SAPI output to memory at the native sample rate and use FB2K's resampler.

Here are some samples (native 16kHz, SAPI-resampled 22kHz, FB2K-resampled 22kHz). Feel free to share any insight in the comments...

Sunday, May 30, 2010

Letter of rage

Dear Broadcom WIDCOMM Bluetooth Software 6.2.1.2100 installer,

Thank you for deleting every file you had access to on my system volume. There's nothing like seeing random icons disappear from your desktop one-by-one. It's a shame you left all my other drives alone, but one can't have everything.

Yours sincerely,

Anonymous fan

Update: Ah, came across another report - so the problem has been known (with earlier versions!) for at least a month. Great...

Sunday, May 23, 2010

Web host fun

So my web host blocked my IP address from the server my web site is hosted on... and are denying it/are uninterested in doing anything about it. Seems like I tripped some "security" measure trying to edit a large wiki page.

So off I go to find a new host... which is always a fun process. Wish me luck.

Wednesday, February 10, 2010

Attn: UPEK

As I know the nice person(s) at UPEK like to take notice of things posted here, I thought I'd write about a couple of new problems I had with Protector Suite / my fingerprint reader under Windows 7.

1. A new error message appeared today; it was hiding under all other windows so it went unnoticed for a while:

First time I've seen that one, so not an often occurrence.

2. Sometimes after resuming from sleep, my fingerprint reader doesn't function (no feedback when swiping). If I try to restart the Windows Biometric Service, it times-out or something, though after a while things work again.

Perhaps the below message logged by Windows will help. There's also something for the Windows Biometric Service from when I tried to restart it, that's under Bucket ID 1376951512.
Source
Windows Driver Foundation - User-mode Driver Framework Host Process

Summary
Driver host process timeout.

Date
‎02/‎02/‎2010 8:40 AM

Status
Report sent

Description
The Windows User-Mode Driver Framework detected that a driver host-process did not complete a critical operation within the allowed timeout period.
This report contains information about the process and the drivers running within and will be used to improve the quality of these drivers.

Problem signature
Problem Event Name: WUDFHostProblem
EventClass: HostProblem
Problem: HostTimeout
DetectedBy: 2
UMDFVersion: 6.1.7600.16385. (win7_rtm.090713-1255)
ExitCode: 103
Operation: 0
Message: 6
Status: ffffffff
HardwareId: USB\VID_147E&PID_2016&REV_0001
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 2057

Extra information about the problem
Bucket ID: 4
That's with driver version 1.3.0.214, the latest version available for download at time of writing.

Tuesday, January 26, 2010

Failure at using COM/OLE: Part 2

Last time we just touched on a small issue, as a precursor to the important one.

Consider an application that populates an STGMEDIUM structure as follows:
  • Sets tymed to TYMED_ISTREAM
  • Sets pstm to a pointer to an IStream object
  • Sets pUnkForRelease as a pointer to the IUnknown interface of the same IStream object
  • This IStream object has a reference count of 1.
What's wrong? Let's read the documentation for ReleaseStgMedium:
When the original provider of the medium is responsible for freeing the medium, the provider calls ReleaseStgMedium, specifying the medium and the appropriate IUnknown pointer as the punkForRelease structure member. Depending on the type of storage medium being freed, one of the following actions is taken, followed by a call to the IUnknown::Release method on the specified IUnknown pointer.

Medium





ReleaseStgMedium Action
TYMED_ISTREAM





Calls IStream::Release.
(My emphasis, irrelevant parts of table omitted)

In other words, calling ReleaseStgMedium on that STGMEDIUM structure will end up in the IStream object being released twice, and unsurprisingly things like to blow up the second time.

Sad thing is it didn't really take much time to look up the problem - all of 30 seconds once I found out that freeing TYMED_ISTREAM STGMEDIUMs was the issue. You'd better allocate more time for "convincing person X that the problem exists".

Wednesday, January 20, 2010

Windows 7: SATA controller in AHCI mode and standby issues

I recently decided to switch my SATA controller into AHCI mode. With this information that was easy enough.

What followed though were "BSODs"/stop errors, mainly on resuming from standby. Sadly, minidumps weren't created for these - but the errors were either KERNEL_STACK_INPAGE_ERROR or KERNEL_DATA_INPAGE_ERROR (I didn't note which). Additionally, some applications crashed when resuming from standby with exception code C0000006 (STATUS_IN_PAGE_ERROR).

The problem apparently was KB977178 - "You receive various Stop error messages in Windows 7 or in Windows Server 2008 R2 when you try to resume a computer that has a large SATA hard disk". I noted that it only appears to update the Microsoft AHCI driver.

I have a large page file on another large non-system drive (and a small one on my system drive), so it fits the problem description (no access to the large page file until the drive spun up causing the errors). Indeed, after installing the hot fix the problem stopped.

So, just a hint in case anyone else runs into the same unfortunate issue..

Windows 7 NTFS worry...

Out of the blue, my Windows 7 install decided to run chkdsk on my system drive on startup (once). It didn't find any problems.

A little bit more digging revealed Ntfs event number 55 had been logged last time the computer was on:
"The file system structure on the disk is corrupt and unusable. Please run the chkdsk utility on the volume [volume name]."

Obviously a little bit worrying. Since chkdsk didn't find anything actually wrong, I did a little bit of stress testing to double check for any stability issues - but those seemed fine. The drive in question is a Samsung SLC SSD, again no real sign of any issues there - S.M.A.R.T. data is OK, and actually the normalised wear-levelling attribute is still at 99 (!).

So I decided to leave it at that and wait to see if it reoccurs. (Actually, I decided to switch my SATA controller into AHCI mode which unleashed some separate problems, but I'll write about those separately).

Occur again it did - several days later. This time I caught the message in the event log before I shut down the computer. Indeed I checked the dirty flag of the volume, and it was set. Similarly, chkdsk wasn't flagging up anything as wrong.

Seemed to me that something must have changed recently to start triggering this. There were a few things I could think of, but I simply disabled the real-time protection of my anti-virus (MSE "Ongoing Beta"). Some weeks later and it hasn't reoccurred - but that may well be a coincidence. Not sure what to make of it, but I will have to continue to monitor it..

Update: The Windows photo importing functionality seems to be something that likes to trigger this (see comments). Still investigating whether MSE is relevant or not.

Update: It likes to happen when importing the photos but not always reliably. So far it has only happened with MSE real-time protection enabled. The photo importer is set to import to the "My Pictures" folder, and also picture 'streaming' is enabled. You might also get the dreaded "The file or directory is corrupted and unreadable" message as well. I will also add that I tested on Windows 7 64-bit.

Looks like an OS bug anyway, I don't see why anti-virus should cause this type of error.

Some relevant links:
http://groups.google.com/group/tortoisesvn/browse_thread/thread/69f3e36e6bbf7389?pli=1 (note the post title, easy to miss..)
http://social.technet.microsoft.com/Forums/en/w7itprogeneral/thread/6c3ed415-704b-482d-a20b-69277f6cd4ad (my god there are some idiotic replies)

First one seems interesting, some issue with file locks according to it.

Update: A statement from a Microsoft employee from the TechNet forums:
"This is a known regression in Windows 7 in the NTFS file system. It occurs when doing a superceding rename over a file that has an atomic oplock on it (atomic oplocks are a new feature in Windows 7). The indexer uses atomic oplocks which is why it helped when you disabled the indexer. Explorer also uses atomic oplocks which is why you are still seeing the issue. When this occurs STATUS_FILE_CORRUPT is incorrectly returned and the volume is marked "dirty" which is a signal to the system that chkdsk needs to be run. No actual corruption has occured.

Neal Christiansen
NTFS Development Lead"

Wednesday, January 13, 2010

People's failures at using COM

What does MSDN say about the ppvObject parameter in IUnknown::QueryInterface?
ppvObject [out]

The address of a pointer variable that receives the interface pointer requested in the riid parameter. Upon successful return, *ppvObject contains the requested interface pointer to the object. If the object does not support the interface, *ppvObject is set to NULL.

I made the relevant bit a bit more prominent.

We now have the following code, written by X:
#define COM_QI_BEGIN() HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid,void ** ppvObject) { if (ppvObject == NULL) return E_INVALIDARG;
#define COM_QI_ENTRY(IWhat) { if (iid == IID_##IWhat) {IWhat * temp = this; temp->AddRef(); * ppvObject = temp; return S_OK;} }
#define COM_QI_END() return E_NOINTERFACE; }

COM_QI_BEGIN()
COM_QI_ENTRY(IUnknown)
COM_QI_ENTRY(IDataObject)
COM_QI_END()
This expands to:
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid,void ** ppvObject)
{
if (ppvObject == NULL) return E_INVALIDARG;
{ if (iid == IID_IUnknown) {
IUnknown * temp = this; temp->AddRef(); * ppvObject = temp; return S_OK;} }
{ if (iid == IID_IDataObject) {
IDataObject * temp = this; temp->AddRef(); * ppvObject = temp; return S_OK;} }
return E_NOINTERFACE;
}

Does that look like it sets *ppvObject to NULL on failure?

More on the general subject here.

Monday, December 21, 2009

Mr User Friendly returns

As does Mr Screen Shot...

(If you're wondering, the problem was just that I had the destination file open in a certain application..)

Sunday, November 29, 2009

UPEK Protector Suite strikes again

I thought (or perhaps naively hoped) UPEK had fixed all their issues. Alas, I was to be disappointed on a large scale as you can see below.


I admit, it's not a regular occurrence, but once is more than enough..

I'll try Authentec next time..

ITaskbarList3::ThumbBarUpdateButtons complaint again

I'm going to complain about it again (first time). I recently saw a crash log where the user had right-clicked on our application's notification area icon around the same time as my call to ThumbBarUpdateButtons - the result was a modal TrackPopupMenu call within the ThumbBarUpdateButtons call.. !!

What a complete mess - so make sure you only call ThumbBarUpdateButtons from a posted message/equivalent specifically for that purpose (at least in Windows 7 RTM). Unless you like strange (though rare) crashes, and the possibility thumb buttons being in the wrong state..

Tuesday, September 01, 2009

Windows 7 RTM feedback...

I decided to go ahead and buy a TechNet subscription so I could "evaluate" Windows 7, and am now running Windows 7 RTM on both of my computers. One was an upgrade from Windows Vista 64-bit, the other was a (sneaky) forced upgrade from Windows 7 RC.

In the spirit of "evaluating" Windows 7, I thought I might post some of the issues/problems I have encountered in the RTM version:
  • The upgrade process reset the date modified attribute for all the directories in my user folder. That was one of my favourite things to sort by, so definitely an annoyance.
  • The installer asked me to remove Avira AntiVirus which wasn't actually installed anymore. It was in fact complaining about some old left over driver which I had to manually remove - but how they expect the average user to work that out I don't know.
  • I had a printer shared on the Windows Vista installation. I had renamed the share (to change a space to an underscore, because I was trying to make it accessible from another Mac OS X computer). After upgrading from Vista to 7, the share was still there but it didn't actually work anymore. In Devices and Printers, the printer wasn't marked as shared so I had to share it again. Unsurprisingly, I couldn't use the old share name. I am now left with two printer shares, one of which doesn't work. I thought I would try and remove the dead share using the "net share" CLI command, but I just get: "System error 1801 has occurred. The printer name is invalid." Lovely.
  • This one was on the machine I did the naughty upgrade from Win 7 RC on, but I can't say if that was related to the problem or not. I had .NET Framework 4 beta 1 installed on Win 7 RC, after upgrading to Win 7 RTM I ended up with a broken .NET Framework installation. The solution here was to uninstall .NET Framework 4 and then reinstall it.
  • When dragging an object from an external application (say foobar2000) Windows Explorer windows no longer automatically scrolls when you are near the edges of the items area.
  • When dragging an item over an empty area of the task bar, it no longer shows the desktop automatically. This is probably due to the fact that you can now pin items to the task bar - my view though is that it could very well do both. You can now go over to the show desktop button, but that is all the way in the bottom right corner..
  • This is definitely annoying, it happens on my desktop with a WUXGA monitor. Since it is reported on both AMD ATI and nVidia graphics cards, I'm reluctant to blame the graphics card driver (which is the latest version).
  • When connecting say an SD Card, it doesn't prompt you to view the files or do something with it. I think they have changed this in Vista now also. There is probably some way to change this, I will have to have a look, but generally I want to look at the photos or something when I put in the card from my camera..
  • I wrote about it before, but the removal of the columns header in the Windows Explorer views other than Details is a major step backwards. You now can't at a glance see the current sort order. Sorting by the reverse order of another criteria now takes a lot more work.
  • I wrote about this before, but I still think the Show Desktop icon should be near the bottom left of the screen. The desktop icons are usually on the left of the screen, and also I like liked to blindly click in the bottom right to view the calendar.
  • Amazingly, the Windows Photo Viewer doesn't handle smooth (Microsoft) mouse wheels correctly. It falls into the category "doesn't react unless you scroll the wheel exceptionally fast", and the bug I believe is a is a carry over from Windows Vista. My post on WM_MOUSEWHEEL failings is currently the fourth result on Google.com for "WM_MOUSEWHEEL", so hopefully I've made the world a better place regardless :p
  • Some of the changes to Windows Update seem a step backwards to me. On the page where you select which updates to install, the published date column has been removed, so you have to click on each individual update to see the date. There is also now no "Install" button on that page, you are returned to the previous page to click on install which is a bit more mouse work.
  • Somehow this UI glitch wasn't spotted:


    Yes it is minor enough (the "System" text overlaps the mouse over background), but surely you would notice that from the get-go?
  • The new calculator also tends to slow me down. Vista essentially has the "Scientific" and "Programmer" combined in one, and as I use both views all the time this was really useful. They are separated in Windows 7 which means constant switching of the view, which also causes you to lose your current number (it did before, but I never needed to change view). If they had a toolbar with buttons to change the view, that might help. Animations that weren't quite as annoying after the tenth time would also help. As I mentioned previously, the swapping of the View and Edit menus is also a nuisance. (Some of the new parts of the calculator are useful though, for example the binary display in Programmer view).
  • It really seems unnecessary/mean to remove the Vista Ultimate Extra games (Hold 'Em etc.) when upgrading to Windows 7. It should provide compatible versions.
  • The best is saved until last: On the Windows Update restart reminder, the "Remind me in" time defaults to 10 minutes. If you click on the drop down (mouse left click), press down a few times to four hours (keyboard down arrow), click on the drop down again (mouse left click) and then click on Postpone (mouse left click) it will prompt you again in 10 minutes - not four hours. Not the first time mixed keyboard and mouse navigation has caused issues. This was probably an issue in Windows Vista too but I only recently worked it out. At least I now know why that prompt annoyed me to no end!
OK, I think I got most of it out of my system :p

Thursday, August 27, 2009

Braindead logging

Monday, August 03, 2009

Fun with ITaskbarList3::ThumbBarUpdateButtons

This issue just cropped up:

-We are in function A (a callback function)
-We call ITaskbarList3::ThumbBarUpdateButtons
-It calls SendMessageTimeout with the SMTO_NORMAL flag and not SMTO_BLOCK
-Another instance of our process does a SendMessage to the first instance (for command line processing in this case)
-That results in function B being called. But its not legal to call function B within function A!!

We end up with a boom of kinds.

The end result is that I will have to make all calls to ITaskbarList3::ThumbBarUpdateButtons from a custom message posted by PostMessage - because in any other case it can open up holes I don't want (even if they are rare holes....)

Update: As far as I can see, Shell_NotifyIcon does use the SMTO_BLOCK flag. So why ThumbBarUpdateButtons doesn't I don't know..

Saturday, July 18, 2009

Blurry text disease strikes again

A little while ago I wrote about how the Windows 7 RC jump lists are affected by such a problem. I decided to install Visual Studio 2010 Beta 1 and to my horror, it has also been struck by this illness in several places. Apparently something to do with that thing called WPF. Have a look at this over-sized blown up comparison of the main menu between VS2008 (top) and VS2010 Beta 1 (bottom):

Link to comparison screenshots

Look at that N, p and r! The Intellisense drop-downs are also quite bad.

How anyone can think that is remotely acceptable is beyond me, though apparently they are going to fix the Visual Studio problem for Beta 2.

Dan K kindly blew up my Windows 7 RC screenshot, and as you can see the problem is not nearly as bad there: http://shots.kordix.com/20090714_1.png. Still not great, though. Seems like they might have fixed the Windows 7 issue in builds after the RC, but the real test will be when the final version is out and installed here...

Tuesday, July 14, 2009

PSU whine/squeal/buzz... (under graphics card load)

Just wtf is this about. I'm referring to this, or this, or this, or this... It's horrible, and loud. Seemingly known as 'coil whine', but it's some combination of a whine, buzz and squeal.

I had it when I had a GeForce 9800 GTX graphics card - but it wasn't that loud and happened in fewer situations. At that time I never realised it was coming from my PSU, I just assumed it was my graphics card. Then I read about the PSU issue. Then my GeForce GTX 275 turned up and the noise was happening in far more situations and it was a lot louder. Then I double checked where it was coming from and indeed it is the PSU..

This was one of the more informative things I read about it. But I'm going to blame my PSU since it happened in some capacity with two fairly different video cards. After reading lots of PSU reviews (jonnyGURU.com at least made that slightly less of a chore :p) I've ordered a Corsair HX750W. Let's hope it can stop watching videos making me feel like my computer is about to explode :p

Update
My HX750W turned up. The great news is that it makes no buzzing at all under GPU-stress (that I can hear). It also came in a velvet bag :o

But the bad news is some of its cables seem like they could have had a bit more thought put into them. The combined EPS12V/ATX12V 8-pin/4-pin connector splits off right at the end of the lead, so if you split it you end up with a stiff V shaped thing, which is likely to get in the way of something. It doesn't look like the image on Corsair's website, but like this which I borrowed from Newegg. In my case, connecting it split resulted in it blocking a PCI Express slot - though luckily I had enough space to connect it with both bits joint together. If it split a bit further up the lead, it wouldn't have be a problem. Though my old Antec Neo HE just had separate 4-pin and 8-pin leads.

The other problem I had were the SATA power leads. The cable is flat and not rounded, it is quite stiff and ends up bending outwards quite far which is no good if your drives are close together and you don't have a lot of clearance (which I don't). The way they bend out also gets in the way of using two sets of leads in the same run to work around the clearance issue because the first lead gets in the way. I had to rearrange my drives to get around this. My old Neo HE did far better - it had sleeved, rounded SATA power cables which I was able to bend sideways out of the way.