Sunday, June 27, 2010

How to disable UAC for an application

It is possible to disable UAC consent prompt for some applications with Microsoft ACT.

References :But unfortunately, this does not work on Windows 7 Pro x64. I failed to disable UAC consent prompt for Process Explorer.

Thursday, June 24, 2010

WPF Cover Flow Tutorial : Part 8

I've been told that Part 7 had memory leaks. In the comments, I link a blog article describing how to study memory leaks : you can watch the Private Bytes performance counter.

We need :
  • The performance counter
  • A callback displaying the counter value
  • A timer
using System.Diagnostics;
using System.Windows.Threading;

private readonly PerformanceCounter counter = GetCounter();
private readonly DispatcherTimer timer = new DispatcherTimer();

private void timer_Tick(object sender, EventArgs e)
long kb = Convert.ToInt64(counter.NextValue() / 1000);
perfLabel.Content = string.Format("{0,12} KB", kb.ToString("###.###.###"));
private static PerformanceCounter GetCounter()
var counter = new PerformanceCounter();
counter.CategoryName = "Process";
counter.CounterName = "Private Bytes";
counter.InstanceName = Process.GetCurrentProcess().ProcessName;
return counter;
public TestWindow()
timer.Tick += timer_Tick;
timer.Interval = TimeSpan.FromMilliseconds(100);

<Label Content="0 KB" Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="perfLabel" VerticalAlignment="Top" Width="142" Foreground="Red" />
Here is the result in video.

Current implementation always stay close to 90 KB :

If we comment out Cover Destroy method:
public void Destroy()
The counter grows continuously :

Note : the ThumbnailManager does not handle empty image files. Loading such a file would throw an OutOfMemoryException.
Edit 2014-02-23 : Code has moved to github.

Wednesday, June 23, 2010

Windows Media Network Sharing Service Memory Usage

Windows Media Network Sharing Service can consume a lot of memory, like 2.5 GB. WTF ?! AFAIK, I have nothing to share. What is consuming all this memory ?
Hopefully, I still have 1 GB free.

Monday, June 21, 2010

Windows 7 fait rebooter la freebox

Depuis que j'ai acheté mon asus u30jc-qx010x, la freebox ADSL (Firmware 1.6.6) reboote régulièrement.

Ce soir, ça redémarrait plusieurs fois par heure jusqu'à ce que je l'éteigne.

Pistes déjà éliminées :
  • Ce n'est pas lié à un navigateur en particulier (IE, Firefox ou Chrome)
  • Désactiver ipv6 sur la carte wifi et sur la freebox ne change rien.
Après un peu de recherche, il s'avère que désactiver les services suivants provoque un redémarrage de la freebox après avoir surfé un certain temps :
  • BFE (Moteur de filtrage de base)
  • IKEEXT (Modules de génération de clés IKE et AuthIP) : dépends de BFE
  • PolicyAgent (Agent de stratégie IPsec) : dépends de BFE

Sunday, June 20, 2010

Windows 7 Search

If you want to index all C: content, some folders are excluded by default :
  • C:\$Recycle.Bin
  • C:\ProgramData
  • C:\ProgramData\Microsoft\Search\Data
  • C:\ProgramData\Microsoft\Windows\Menu Démarrer
  • C:\Utilisateurs (C:\Users)
  • C:\Utilisateurs\*\AppData
  • C:\Utilisateurs\*\Favoris
  • C:\Utilisateurs\*\AppData\Local\Temp
  • C:\Windows
  • C:\Windows\CSC (hidden)
Temp folders are not listed in exclusion list.

Saturday, June 19, 2010

Windows 7 pictures

Default user pictures are stored in C:\ProgramData\Microsoft\User Account Pictures. The format is a bitmap 128x128.

Default login screen backgrounds are stored in C:\Windows\System32\oobe\background.bmp and C:\Windows\SysWOW64\oobe\background.bmp. The format is bitmap 1024x768. You can change the default background if you create C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg. 96% quality (cf. gimp) is not supported but 85% quality is OK. Then it is possible to keep the same background for the login screen and your desktop.

You might need to set HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background\OEMBackground value to 1 (dword).

Tuesday, June 15, 2010

Setup Gentoo on Asus U30JC-QX010X : Part 3 - X

This post is greatly inspired from Gentoo Xorg How-To.

Edit 2010-07-27 :
  • Replaced vesa by intel in VIDEO_CARDS. Using vesa cannot scale X to 1366x768 and it is not compatible with vesa framebuffer.
  • nvidia is not working. It is better to remove it to avoid problems when enabling xorg-x11 opengl (conflict between lib32 and lib64 folders).
Edit /etc/make.conf and define both INPUT_DEVICES and VIDEO_CARDS :
INPUT_DEVICES="evdev synaptics keyboard mouse"
VIDEO_CARDS="nvidia intel"
Edit use flags for a couple of packages needed for X. You can group these settings in /etc/portage/package.use/X :
media-fonts/corefonts X
media-fonts/dejavu X
sys-apps/dbus X
sys-apps/hal laptop X
x11-base/xorg-server hal
x11-drivers/xf86-input-synaptics hal
Emerge Xorg :
emerge xorg-server
env-update && source /etc/profile
Select xorg-x11 (this might be not necessary) ;
eselect opengl set xorg-x11
Emerge hal :
emerge hal
rc-update add hald default
Update keymap if needed :
mkdir -p /etc/hal/fdi/policy
cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy

<merge key="input.xkb.layout" type="string">fr</merge>

/etc/init.d/hald restart
Add yourself to the video group (maybe not needed).

Nvidia (I fail to use Nvidia and the Geforce 310m for now. No better result with 256.35) :

/etc/portage/package.keywords/X :
~sys-kernel/gentoo-sources-2.6.33-r2 ~amd64
~sys-kernel/gentoo-sources-2.6.34-r1 ~amd64
~x11-drivers/nvidia-drivers-195.36.24 ~amd64
~x11-libs/libvdpau-0.3-r2 ~amd64
Emerge kernel, nvidia-drivers, glx tools (like glxgears) :
emerge gentoo-sources-2.6.33-r2
emerge nvidia-drivers-195.36.24
emerge mesa-progs
module-rebuild will rebuild the necessary packages when upgrading your kernel :
emerge module-rebuild
module-rebuild populate
module-rebuild rebuild
Configure Xorg :
Xorg -configure
Copy /root/ to /etc/X11/xorg.conf. You need to comment the Nvidia section to keep only vesa (Nvidia fails).
#Section "Device"
# Identifier "Card0"
# Driver "nvidia"
# VendorName "nVidia Corporation"
# BoardName "Unknown Board"
# BusID "PCI:1:0:0"
Emerge enlightenment. It is also a good idea to add xterm and some font packages. Set enlightenment default :
emerge enlightenment corefonts dejavu xterm
~/.xinitrc :
exec /usr/bin/e16
At this point, once the new kernel has been installed, you should be able to start enlightenment safely (with intel driver only for now).

For info, small kernel updates :
diff config-2.6.33-r2.0 config-2.6.33-r2.7

Nvidia errors :
NVRM: failed to copy vbios to system memory.
NVRM: RmInitAdapter failed! (0x30:0xffffffff:868)
NVRM: rm_init_adapter(0) failed

Saturday, June 12, 2010

Asus FastBoot

Asus FastBoot delays the start up of applications configured to start automatically in the registry through Microsoft/Windows/CurrentVersion/Run keys.

It is handled by the AFBAgent service.

Keys are moved from Microsoft/Windows/CurrentVersion/Run keys to HKLM/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg.

Application delayed by default on an Asus U30JC-QX010C :
  • Adobe Reader Speed Launcher ("C:\Program Files (x86)\Adobe\Reader 9.0\Reader\Reader_sl.exe")
  • ASUS Screen Saver Protector (C:\Windows\AsScrPro.exe)
  • CLMLServer ("C:\Program Files (x86)\CyberLink\Power2Go\CLMLSvc.exe")
  • RtHDVCpl (C:\Program Files\Realtek\Audio\HDA\RAVCpl64.exe -s)

Sunday, June 6, 2010

Asus U30JC-QX010X : Tuning Windows 7 Part 4 : Auto Run

Many programs are configured to start automatically. Note that a couple of x86 applications are configured in the x64 registry. I prefer to remove the keys and keep the application installed, just in case... It is still possible to reset the keys afterwards.

You must disable Asus FastBoot to find some applications listed below.

Keys than can be removed safely :

HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run :
  • Sidebar (C:\Program Files\Windows Sidebar\sidebar.exe /autoRun)
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run :
  • AmIcoSinglun64 (C:\Program Files (x86)\AmIcoSingLun\AmIcoSinglun64.exe) : Alcor Micro USB Card Reader. Not needed to read USB of SD cards.
  • ASUS WebStorage (C:\Program Files (x86)\ASUS\ASUS WebStorage\SERVICE\AsusWSService.exe MySyncFolder) : No free 20 GB account is available for this Asus.
  • IgfxTray (C:\Windows\system32\igfxtray.exe) : Intel Graphics Tray Icon. I rarely need to modify these settings.
  • NvCplDaemon (RUNDLL32.EXE C:\Windows\system32\NvCpl.dll,NvStartup) : NVidia startup utility. Does not prevent the NVidia control panel to start. Seems useless ?
HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run :
  • Adobe Reader Speed Launcher ("C:\Program Files (x86)\Adobe\Reader 9.0\Reader\Reader_sl.exe")
  • ATKMEDIA (C:\Program Files (x86)\ASUS\ATK Media\DMedia.exe) : To configure a media key to launch Windows Media Player but no such key exists on my laptop.
  • ATKOSD2 (C:\Program Files (x86)\ASUS\ATKOSD2\ATKOSD2.exe) : Driver for the missing fingerprint reader. Also provides pretty UI for Fn function keys. When disabled, Fn keys still work, but with a classic UI.
  • CLMLServer ("C:\Program Files (x86)\CyberLink\Power2Go\CLMLSvc.exe") : Cyberlink Media Library.
  • HControlUser (C:\Program Files (x86)\ASUS\ATK Hotkey\HControlUser.exe)
  • RemoteControl9 ("C:\Program Files (x86)\CyberLink\PowerDVD9\PDVD9Serv.exe") : DVD Remote Control.
  • Setwallpaper (c:\programdata\SetWallpaper.cmd) : Batch is missing !
  • UpdateLBPShortCut ("C:\Program Files (x86)\CyberLink\LabelPrint\MUITransfer\MUIStartMenu.exe" "C:\Program Files (x86)\CyberLink\LabelPrint" UpdateWithCreateOnce "Software\CyberLink\LabelPrint\2.5") : DVD printing startup utility. WTF ?
  • UpdateP2GoShortCut ("C:\Program Files (x86)\CyberLink\Power2Go\MUITransfer\MUIStartMenu.exe" "C:\Program Files (x86)\CyberLink\Power2Go" UpdateWithCreateOnce "SOFTWARE\CyberLink\Power2Go\6.0") : DVD burning startup utility. WTF ?
Other keys :

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run :
  • ETDWare (C:\Program Files\Elantech\ETDCtrl.exe) : Smart-Pad.
  • HotKeysCmds (C:\Windows\system32\hkcmd.exe) : Hot Key Commands from Intel graphics driver.
  • Persistence (C:\Windows\system32\igfxpers.exe)
  • RtHDVCpl (C:\Program Files\Realtek\Audio\HDA\RAVCpl64.exe -s)
HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run :
  • ASUS Screen Saver Protector (C:\Windows\AsScrPro.exe)
When playing with these settings, the ELAN Smart-Pad can be disabled. Actually, it was running until I enter my password to open a session. Then, it was disabled. I needed to open the mice parameters in the control panel, open ELAN tab and enable the device. The laptop might also fail to detect the usb mouse. In this case, open the Device Manager, right click (with the touchpad) on the mouse section and scan for hardware changes.

Edit 2010.08.14 : Asus Web Storage.

Asus U30JC-QX010X : Tuning Windows 7 Part 3 : Tasks

More than 40 scheduled tasks are configured under Windows 7 Professional on my Asus laptop. Task scheduling has been greatly improved. It is now possible to configure a task so that it starts when some user open a session. These tasks are responsible for many processes running in the background. Task are also organized hierarchicaly.

Some of these tasks are configured with the Administrators group which does not exist on my French laptop. I must fix the task user first to be able to disable the task.

The following tasks can be disabled :
  • \ACMON (bad user) : Asus Splendid Video Enhancement Technology
  • \ASUS Live Update (bad user)
  • \ASUS SmartLogon Console Sensor (bad user) : Face identification with webcam
  • \ASUSControlDeck (bad user) : Asus Control Deck application
  • SidebarExecute : Might be the nuisance responsible for automatically resizing (some) windows by reserving the right of the screen.
  • \WC3 (bad user) : Asus Wireless Console 3
Requirements :
  • \ASUS P4G (bad user) : Power 4 Gear. This task must be running to launch Power 4 Gear (BatteryLife.exe). But this task can be annoying : it automatically disable transparency and force some white asus wallpaper when running on battery.