Windows SDK Support Team Blog
#define _WIN32_WINNT
How to get the CSP name from a certificate containing the private key?
I was testing with some code to get the CSP name from a certificate containing the private...
Author: Prateek Kr Dubey Date: 11/15/2010
How to take a quartz log?
Many a times I do get this questions from my varied customers and colleagues and I cannot...
Author: Prateek Kr Dubey Date: 11/15/2010
Getting a “System.ArgumentException: Value was invalid” when trying to sign data using SHA256CryptoServiceProvider Here is the symptom:
- You are using RSACryptoServiceProvider for computing SHA-2 signatures. 2. Doing this you get...
Author: Prateek Kr Dubey Date: 11/15/2010
Getting a “System.ArgumentException: Value was invalid” when trying to sign data using SHA256CryptoServiceProvider
Here is the symptom: 1. You are using RSACryptoServiceProvider for...
Author: Prateek Kr Dubey Date: 08/18/2010
Compliance of .Net security libraries about verifying a CMS Advanced Electronic Signatures (CAdES) message
CAdES is an extension of CMS and these extensions, where present, require a different process to...
Author: Prateek Kr Dubey Date: 08/06/2010
Dealing with Administrator and standard user’s context
With introduction of UAC, I often get two questions for Windows Vista and later. 1) How to launch an...
Author: Prateek Kr Dubey Date: 05/31/2010
How to make your custom RNG (random number generator) implementation the default RNG provider for the system using CNG API's
If you have implemented your random number generator make sure that you register it using...
Author: Prateek Kr Dubey Date: 05/28/2010
How to use ADSI/LDAP API’s for querying active directory using credentials derived from a Smart Card
There are no ADSI/LDAP API’s that eventually could directly use the Smart Card Credentials. We...
Author: Prateek Kr Dubey Date: 05/28/2010
Screen capture using Windows Media Encoder
If you have to screen capture using Windows Media Encoder please follow the steps below. Start...
Author: Prateek Kr Dubey Date: 05/28/2010
You might get a high CPU usage while decrypting using RSA keys
You might get a high CPU usage while decrypting using RSA keys The root cause of this issue (high...
Author: Prateek Kr Dubey Date: 05/28/2010
How to read a certificate from a Smart Card and add it to the system store
The basic high level steps to read a certificate from a Smart Card and add it to the system store...
Author: Prateek Kr Dubey Date: 05/28/2010
Steps for creating a self-signed certificate with the key container created at the machine key set and private key exportable.
Here are the steps for creating a self-signed certificate with the key container created at the...
Author: Prateek Kr Dubey Date: 05/28/2010
CryptAcquireCertificatePrivateKey fails with CRYPT_E_NO_KEY_PROPERTY (0x8009200B ) when trying to obtain access to a user's private key on machine's after the user changes his password.
You create a key container on a machine for a specific user on the user’s profile. You log off...
Author: Prateek Kr Dubey Date: 05/28/2010
Error with WMEncoderLib when trying to build a 64 bit version of your application.
You may get a runtime error with your 64 bit managed Windows Media Encoder application while the 32...
Author: Prateek Kr Dubey Date: 05/28/2010
How to update security bulletin MS10-013 on a Windows Server 2000 box?
While updating your Windows 2000 box with latest security fixes you may get a situation where you...
Author: Prateek Kr Dubey Date: 05/28/2010
Understanding of SignedCms.CheckSignature(True)
An understanding of SignedCms.CheckSignature(True) based on the code stated below. ' Create a...
Author: Prateek Kr Dubey Date: 05/28/2010
Behaviour of AesCryptoServiceProvider class with FIPS policy set/ unset
You may want to use a Crypto API for Advanced Encryption Standard that is FIPS 140-2 complaint....
Author: Prateek Kr Dubey Date: 05/28/2010
Passing the flag CERT_CLOSE_STORE_FORCE_FLAG to CertCloseStore may cause your application to crash.
CertCloseStore is called with flag CERT_CLOSE_STORE_FORCE_FLAG. This flag forces CertCloseStore to...
Author: Prateek Kr Dubey Date: 01/29/2010
VB.NET code to find a certificate with its issuer name and display its contents – small post but helpful
This is a small blog post but I found it handy and useful to document. I created a test certificate...
Author: Prateek Kr Dubey Date: 01/29/2010
'System.Security.Cryptography.CryptographicException - The index value is not valid'
While trying to extract the public key from a certificate you may get an exception that says:...
Author: Prateek Kr Dubey Date: 01/29/2010
You may get a service timeout from a signed .NET/ managed service application while the system is doing a revocation check of the certificate over the internet.
You may get a service timeout from your signed .NET service application while the OS does a...
Author: Prateek Kr Dubey Date: 01/29/2010
What should you do if you find that DecryptMessage (Schannel) function returns SEC_E_INVALID_TOKEN; which means the buffers are of wrong type or no buffer of type SECBUFFER_DATA was found.
DecryptMessage (Schannel) function returns SEC_E_INVALID_TOKEN, means the buffers are of the wrong...
Author: Prateek Kr Dubey Date: 01/29/2010
While creating cryptographic keys or key containers repeatedly, your hard disk may get filled with lots of files and may end up filling the whole hard disk space, if not deleted.
A cryptographic service provider creates key containers for storing RSA public/private asymmetric...
Author: Prateek Kr Dubey Date: 01/29/2010
I lost the “Security” tab of offline files synced by Sync Centre !!
In Windows Vista and later there is a cool feature of making network shared files available offline...
Author: Prateek Kr Dubey Date: 12/28/2009
ExpandEnvironmentStringsForUser() API does NOT expand the environment variable %USERNAME% on Windows 7.
ExpandEnvironmentStringsForUser() API does not expand the environment variable %USERNAME% on Windows...
Author: Prateek Kr Dubey Date: 12/14/2009
How to disable Address Space Layout Randomization (ASLR) ?
Here is the scenario - You have a legacy application where you wish to load a DLL or module at a...
Author: Prateek Kr Dubey Date: 11/30/2009
GetIPForwardTable return’s undocumented error ERROR_MORE_DATA
Symptom: ======= GetIPForwardTable return’s undocumented error ERROR_MORE_DATA where it should...
Author: Prateek Kr Dubey Date: 11/20/2009
ARP Changes in Server 2008/Vista:
Introduction: ARP is used to perform Duplicate Address Detection by sending an...
Author: Prateek Kr Dubey Date: 11/20/2009
Web Service can’t start the Windows Service
Working with Windows Service and Web Service together is nothing less than fun, especially when you...
Author: Prateek Kr Dubey Date: 11/18/2009
Web application gets Access Denied accessing a Named Pipe.
Recently, I was troubleshooting a problem for one of my customers. A named pipe created by a native...
Author: Prateek Kr Dubey Date: 11/18/2009
Where are my performance counters ?
Your custom created 32 bit performance counters do not show counter information when generating logs...
Author: Prateek Kr Dubey Date: 11/16/2009
Send multiple files to FAX in one call
There might be a need that an application need to send multiple files to the FAX server in one...
Author: Prateek Kr Dubey Date: 11/16/2009
When custom EAP authentication dll calls EapPeerInvokeInteractiveUI for wireless LAN 802.1x
When custom EAP authentication dll calls EapPeerInvokeInteractiveUI for wireless LAN 802.1x, a...
Author: Prateek Kr Dubey Date: 11/16/2009
Introduction to IMAPI
In the recent past, I have seen few question coming to me saying, “How do I write data on the CD/DVD...
Author: Prateek Kr Dubey Date: 11/16/2009
UAC dialog on Process.Start()
Symptom: You may get Security Warning dialog while launching a process using fully qualified domain...
Author: Prateek Kr Dubey Date: 11/16/2009
Opps!!! System.Security.Cryptography.CryptographicException: The system cannot find the file specified.
If you are creating the cryptographic keys on the user's profile directory you may get a...
Author: Prateek Kr Dubey Date: 11/16/2009
Do you need to explicitly call CryptoStream.Close() to close your CryptoStream object after you are done using it?
You can verify this with a simple program, stated below that shows that CryptoStream.Close() is...
Author: Prateek Kr Dubey Date: 11/13/2009
Steps to sign a file using Signtool.exe
You may have a situation where you need to sign a file which may be an a. .exe b. .cab c. .cat d....
Author: Prateek Kr Dubey Date: 11/13/2009
How to create different Firewall Rules on different Interfaces in Windows XP OS Programmatically?
You want to create different exception rules on different interfaces on an XP Based operating system...
Author: Prateek Kr Dubey Date: 11/12/2009
Correct way to join a Multicast Group on a specified interface.
Generally Multicast Sockets should be bound to the wildcard address [INADDR_ANY], before joining the...
Author: Prateek Kr Dubey Date: 11/12/2009
Bluetooth Manager does not recognizes the devices, if the device gets paired with another box and comes back later.
Consider the following scenario: a) You have a Bluetooth device with serial port profile connected...
Author: Prateek Kr Dubey Date: 11/12/2009
Access denied on a Mutex
If you are in a situation where, one process creates a MUTEX with default security descriptor and...
Author: Prateek Kr Dubey Date: 11/10/2009
How to programmatically inject a list of IP Addresses into the IP Options header in the IP Datagram [ Source Routing ]?
IP Datagrams gets routed dynamically in the sense, we cannot precisely predict which...
Author: Prateek Kr Dubey Date: 11/05/2009
Only one CPU being utilized
Symptom: ======== You have several threads in your application running , but you observe that only...
Author: Prateek Kr Dubey Date: 11/04/2009
String Table in the Resource File [RC File] generated by CTRPP tool has junk characters for Unicode strings defined in the performance counter manifest XML file.
String Table in the Resource File [RC File] generated by CTRPP tool has junk characters for...
Author: Prateek Kr Dubey Date: 11/04/2009
WriteFile API succeeds and returns TRUE, but data is not written to the SAN Drive.
Symptom: ======= WriteFile API returns TRUE and succeeds, but data is not written to the SAN...
Author: Prateek Kr Dubey Date: 11/04/2009
WMCreateStreamForURL is called in XP and Vista but not in Windows 7
It is always possible to write our own storage system for Windows media files and make the content...
Author: Prateek Kr Dubey Date: 11/04/2009
Is RijndaelManaged class FIPS compliant?
If you enabled the “fipsalgorithmpolicy” sub key in registry location...
Author: Prateek Kr Dubey Date: 11/04/2009