Run-time error of the access violation reading and writing

 

Compiler: Visual C++ Express Edition 2005

Compiled on Platform: Windows XP Pro SP2

Header file: Standard and Windows

Additional library: Windows Platform SDK

Additional project setting: Set project to be compiled as C

Project -> your_project_name Properties -> Configuration Properties -> C/C++ -> Advanced -> Compiled As: Compiled as C Code (/TC)

Other info: non-CLR or unmanaged

To do: Using Permissions View tool - Permview

To show: The run-time error of the access violation reading and writing if the pointer not initialized to point to a valid memory addresses when compiled with Visual C++ (or Visual Studio) Express Edition.

 

The following is a First-chance exception, Access violation reading (or writing) violation example encountered during the program running when the pointers are pointed at an invalid memory address such as NULL and system reserved memory area.

 

'cplus.exe': Loaded 'F:\vc2005project\cplus\debug\cplus.exe', Symbols loaded.

'cplus.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.

'cplus.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.

'cplus.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', No symbols loaded.

'cplus.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.

First-chance exception at 0x7c91b83e in cplus.exe: 0xC0000005: Access violation reading location 0xfffffff8.

First-chance exception at 0x7c91b83e in cplus.exe: 0xC0000005: Access violation reading location 0xfffffff8.

First-chance exception at 0x7c91b83e in cplus.exe: 0xC0000005: Access violation reading location 0xfffffff8.

First-chance exception at 0x7c91b83e in cplus.exe: 0xC0000005: Access violation reading location 0xfffffff8.

First-chance exception at 0x7c91b83e in cplus.exe: 0xC0000005: Access violation reading location 0xfffffff8.

First-chance exception at 0x7c92a653 in cplus.exe: 0xC0000005: Access violation reading location 0xfffffff8.

The program '[3112] cplus.exe: Native' has exited with code 0 (0x0).

 

A tool that can be used to view permission sets is permview, coming together with Visual C++ (Visual Studio) Express Edition. The Permissions View tool (Permview) is used to view the minimal, optional, and refused permission sets requested by an assembly. Optionally, you can use Permview.exe to view all declarative security used by an assembly. Permview.exe is available only in the .NET Framework versions 1.0 and 1.1. The file is at the following directory:

 

 

C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin

 

To run the program from any relative directory, copy it to the %\system32\ directory of your Windows machine.

 

 

C and C++ Programming Resources | C & C++ Code Example Index