Tuesday, December 22, 2009

Rundll/Rundll32

http://support.microsoft.com/kb/164787
http://vlaurie.com/computers2/Articles/rundll32.htm

Wednesday, October 14, 2009

Logging Services

Was looking for a good logging framework bumped into log4cxx, it even supports logging to event viewer in Windows.

http://logging.apache.org/log4cxx/index.html

Apache projects:

http://projects.apache.org/indexes/pmc.html

Wednesday, September 23, 2009

Accessing Volume Shadows Manually

Use the following command line for viewing list of shadow copies:

vssadmin list shadows /for=[volume]:

For example to view volume shadows of C: use the following command.

vssadmin list shadows /for=C:

C:\>vssadmin list shadows /for=C:

This will give a list like the following:

vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool(C) Copyright 2001-2005 Microsoft Corp.
Contents of shadow copy set ID: {69ca3ddf-94b0-455c-b20b-e591b8bae522} Contained 1 shadow copies at creation time: 14-09-2009 16:08:24 Shadow Copy ID: {a6e93a79-86a1-4be1-b322-b2ee9bd65f27} Original Volume: (C:)\\?\Volume{b9da36ea-83c0-11dd-a453-806e6f6e6963}\ Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1 Originating Machine: swarajya-PC Service Machine: swarajya-PC Provider: 'Microsoft Software Shadow Copy provider 1.0' Type: ClientAccessibleWriters Attributes: Persistent, Client-accessible, No auto release, Differential, Auto recovered

1. Accessing volume shadow using symbolic links


mklink /d c:\shadow1 \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1
Volume shadow - 'HarddiskVolumeShadowCopy1' will be available at folder C:\shadow1.


2. Using tool DOSDEV.EXE (can be found at - http://www.ltr-data.se/files/dosdev.zip)


dosdev X: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2
Volume shadow - 'HarddiskVolumeShadowCopy2' will be availabe at volume X:


3. Accessing using network share


net share shadow2=\\.\HarddiskVolumeShadowCopy3
Volume shadow - 'HarddiskVolumeShadowCopy3' will be available at \\[Host Name]\shadow2

Monday, September 7, 2009

Database keys - ID or GUID?

I would prefer database keys to be GUIDs, however, there are performance issues to be considered. The following links are good read on the topic.

http://www.codinghorror.com/blog/archives/000817.htmlhttp://www.sql-server-performance.com/articles/per/guid_performance_p1.aspxhttp://stackoverflow.com/questions/45399/advantages-and-disadvantages-of-guid-uuid-database-keys

Wednesday, August 5, 2009

String Tokenizer for std::string

http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html

Friday, May 15, 2009

Writing endian-independent code in C

http://www.ibm.com/developerworks/aix/library/au-endianc/index.html

Monday, May 4, 2009

Making a console application invisible, avoid unnecessary pop-ups.

If you have a non interactive console application, let it be an invisible application, you can always generate logs for troubleshooting. If you want to run a console application without console pop-ups, from startup folder or ‘Run’ registry key, you need to make following changes to the console project. The basic idea is to make your console project a windows application.

Step 1:
Go to Project Properties -> C/C++ ->Preprocessor.
Replace _CONSOLE with _WINDOWS.
Step 2:
Go to Project Properties-> Linker -> Subsytem.
Replace Console (/SUBSYSTEM:CONSOLE) with Windows (/SUBSYSTEM:WINDOWS).
Step 3:
Replace _tmain()/main() with WinMain(). If your console application uses command line arguments you need to make appropriate changes for WinMain().
Step 4:
Build and run the application, it will do the same operations, however, without any console pop-up.