You may get a crash in Windows Media Player if you register and select a plug-in implemented in a multi-threading context and if you have not marshalled the pointers correctly.

Two points to remember before you write your Windows Media Player plug-in using the WMP public interfaces. 1. WMP interfaces are not thread safe. 2. WMP’s public interfaces can be used on different threads as long as you make sure that you have marshalled the pointer correctly. You can use CoMarshalInterThreadInterfaceInStream to marshal the WMP…


Get the MAC address of a machine/device whose IP Address is known

Sometime you may be in a situation to get the MAC address of a machine/device whose IP Address is known. Conventional way like using NetBios or GetAdaptersInfo or GetAdaptersAddresses can give the MAC address of the same machine where the code is running, does not solve the purpose because the machine where the code is…


Enable or Disable “Enable write caching on disk” behavior on disk

Couple of times I got a question to <Enable or Disable “Enable write caching on disk” behavior on disk>, How to do it programmatically on Windows? When I got this question for the first time, it was tough but doing research I was able to solve it and it works well. Every next time, it…


Check membership of a group from user’s process access token

Question may be, I need to check If the user belong to a particular group or not? There are NetUser* APIs available in NetApi32.lib to list the groups a user belong to a group. You can actually check but then you will need to compare the string of the group you are interested to check…