Basic COM   «Prev  Next»

Debug DllCanUnloadNow - Exercise

Debug DllCanUnloadNow

Objective: Find a bug in DllCanUnloadNow.


Find the bug in the following code and explain what will happen as a result of the bug.
//Global Reference Counters
ULONG g_server_locks = 0;
ULONG g_objcnt = 0;

STDAPI DllCanUnloadNow() {
   if (g_server_locks == 0 || g_objcnt == 0)   
         return TRUE;
   return FALSE;

Exercise scoring

This exercise is worth 10 points. There is no partial credit given.

Exercise submission

Write or paste your answer into the text area below. When you are done, click the Submit button to submit your answer.