Click here to Skip to main content
15,893,622 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to report MFC bug to Microsoft? Pin
Antti Keskinen21-Jan-04 1:53
Antti Keskinen21-Jan-04 1:53 
GeneralRe: How to report MFC bug to Microsoft? Pin
Yogurt21-Jan-04 8:53
Yogurt21-Jan-04 8:53 
AnswerRe: How to report MFC bug to Microsoft? Pin
Michael P Butler21-Jan-04 1:54
Michael P Butler21-Jan-04 1:54 
GeneralRe: How to report MFC bug to Microsoft? Pin
Yogurt21-Jan-04 9:07
Yogurt21-Jan-04 9:07 
GeneralRe: How to report MFC bug to Microsoft? Pin
Jörgen Sigvardsson21-Jan-04 10:05
Jörgen Sigvardsson21-Jan-04 10:05 
GeneralImage Streaming over network Pin
witzner20-Jan-04 23:16
witzner20-Jan-04 23:16 
GeneralKernel32.dll and dllmain Pin
hph20-Jan-04 22:38
hph20-Jan-04 22:38 
GeneralRe: Kernel32.dll and dllmain Pin
Antti Keskinen21-Jan-04 2:16
Antti Keskinen21-Jan-04 2:16 
It doesn't sound logical

The Kernel32.dll behaves just like any other DLL would. Here is a link to the MSDN site[^] depicting the different reasons for call.

According to the MSDN:

It is safe to call other functions in Kernel32.dll, because this DLL is guaranteed to be loaded in the process address space when the entry-point function is called.

Following this logic, the Kernel32.dll's entry-point function gets called each time it is loaded into the process' address space. For each process that starts, this DLL provides the basic system services. According to the "Virtual Machine" thinking, each process runs seperately, and believes that it is the only process in the system. Thus, each process needs to access basic system services, and they are provided by this DLL.

You can use the Dependency Walker to see what DLL's your executable loads when it is started (that is, what executables it needs in order to start up). You cannot track the usability of Kernel32.dll in the whole process, because it gets loaded into the system core memory area. Tampering with this area easily causes an access violation or a machine-wide crash.

In conclusion: the Kernel32.dll is active in the system code memory area. From there, it gets loaded into the address space of each process that uses it (all Win32 programs). The entry-point function gets called each time.

If you want to test this yourself, create a system-wide service DLL and debug-run it with RunDll32.exe, that loads it into the memory. Now, create a set of new application that load this DLL. Then track it's DllMain-calling sequences by putting a breakpoint there. Not sure if this works though, no guarantees given...

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Kernel32.dll and dllmain Pin
hph21-Jan-04 2:56
hph21-Jan-04 2:56 
GeneralParameter of export function in a dll Pin
Manfred Staiger20-Jan-04 22:12
Manfred Staiger20-Jan-04 22:12 
GeneralRe: Parameter of export function in a dll Pin
wb20-Jan-04 23:07
wb20-Jan-04 23:07 
GeneralHELP WITH MACRO Pin
Izer0120-Jan-04 22:11
Izer0120-Jan-04 22:11 
GeneralEnabling Menu Items Pin
Jagadeesh VN20-Jan-04 20:26
Jagadeesh VN20-Jan-04 20:26 
GeneralRe: Enabling Menu Items Pin
Robert A. T. Káldy21-Jan-04 4:56
Robert A. T. Káldy21-Jan-04 4:56 
GeneralRe: Enabling Menu Items Pin
bneacetp21-Jan-04 8:39
bneacetp21-Jan-04 8:39 
GeneralPassword Change Notification Pin
20-Jan-04 19:50
suss20-Jan-04 19:50 
GeneralCRichEditCtrl problem Pin
Shah Shehpori20-Jan-04 19:31
sussShah Shehpori20-Jan-04 19:31 
GeneralGenerating tones using MCI Pin
ffazly20-Jan-04 16:38
ffazly20-Jan-04 16:38 
GeneralDynamically invoking classes at runtime Pin
Tank_Aviator20-Jan-04 15:01
Tank_Aviator20-Jan-04 15:01 
GeneralSlightly offtopic: Installshield Express QuickPatch shortcuts problem Pin
obe20-Jan-04 13:10
obe20-Jan-04 13:10 
Questionhow can i include source files which is under different directory Pin
Member 78215420-Jan-04 11:39
Member 78215420-Jan-04 11:39 
AnswerRe: how can i include source files which is under different directory Pin
alex.barylski20-Jan-04 12:12
alex.barylski20-Jan-04 12:12 
AnswerRe: how can i include source files which is under different directory Pin
Jijo.Raj20-Jan-04 17:31
Jijo.Raj20-Jan-04 17:31 
GeneralRe: how can i include source files which is under different directory Pin
Mike Dimmick21-Jan-04 2:22
Mike Dimmick21-Jan-04 2:22 
GeneralRe: how can i include source files which is under different directory Pin
Member 78215421-Jan-04 5:40
Member 78215421-Jan-04 5:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.