Frank is a Software Engineer with rich experiences on messeging system, embedded system and communication system development. This is his work notes.

Thursday, September 23, 2010

Argument Passing and Naming Conventions

The following calling conventions are supported by the Visual C/C++ compiler.

Keyword Stack cleanup Parameter passing
__cdecl Caller Pushes parameters on the stack, in reverse order (right to left)
__stdcall Callee Pushes parameters on the stack, in reverse order (right to left)
__fastcall Callee Stored in registers, then pushed on stack
thiscall
(not a keyword) Callee Pushed on stack; this pointer stored in ECX

Tuesday, March 09, 2010

use CELOG

1)Build a debug copy of the dll and deploy it to your device with a cab file. Remember to build with WINCESHIP= and WINCEDEBUG=debug
2)Get the following files from your emulator FRD and copy to the windows directory on device
a.celog.exe,
b.oscapture.exe
c.celogflush.exe
d.perfman.exe
3)start celogflush.exe
4)Start perfman.exe

select the zones. 0x800000 is the debug zone.
When done collecting data go to the root directory on your pocket pc and find the file . perfman.log

Parse celog:
readlog perman.log output.txt

Here are some more flags.
LZONE_PROCESS (0x00000040)
CELZONE_THREAD (0x00000020)
CELZONE_RESCHEDULE (0x00000002)
CELZONE_CRITSECT (0x00000100)
CELZONE_SYNCH (0x00000200)
CELZONE_DEMANDPAGE (0x00000010)
CELZONE_HEAP (0x00000800)
CELZONE_INTERRUPT (0x00000001)
CELZONE_DEBUG (0x00800000)
CELZONE_MIGRATE (0x00000004)
CELZONE_PRIORITYINV (0x00000080)

Tuesday, February 02, 2010

.NET concept

The .NET Framework has two main components:
the common language runtime and
the .NET Framework class library.

The common language runtime is the foundation of the .NET Framework.

The runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that promote security and robustness.

the concept of code management is a fundamental principle of the runtime. Code that targets the runtime is known as managed code, while code that does not target the runtime is known as unmanaged code.

The class library, the other main component of the .NET Framework, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services.

Followers