in the book with quotes below:
                  
                  
                  "If both the EXE
                  
                  
                  and the DLL link to the DLL C/C++ run-time library, the code works just fine. However, if one or both of the modules
                  
                  
                  link to the static C/C++ run-time library, the call to free fails"
                  
                  
                  
                  
                  
                  it's said that the correct way would be like this:
                  
                  
                  VOID EXEFunc() {
                  
                  
                  PVOID pv = DLLFunc();
                  
                  
                  // Access the storage pointed to by pv...
                  
                  
                  DLLFreeFunc(pv);
                  
                  
                  }
                  
                  
                  PVOID DLLFunc() {
                  
                  
                  PVOID pv = malloc(100);
                  
                  
                  return(pv);
                  
                  
                  }
                  
                  
                  BOOL DLLFreeFunc(PVOID pv) {
                  
                  
                  return(free(pv));
                  
                  
                  }
                  
                  
                  but i think both almost same
                  
                  
                  what's the differences?
                  
                  
                
which book and what is the context?
the book says both malloc and free must be in exe or in dll to work in that context
Обсуждают сегодня