1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_FRAME_MODULE_UTILS_H_
6 #define CHROME_FRAME_MODULE_UTILS_H_
13 // Attempts to register a window class under a well known name and appends to
14 // its extra data a handle to the current module. Will fail if the window
15 // class is already registered. This is intended to be called from DllMain
16 // under PROCESS_ATTACH.
17 static bool DllRedirector::RegisterAsFirstCFModule();
19 // Unregisters the well known window class if we registered it earlier.
20 // This is intended to be called from DllMain under PROCESS_DETACH.
21 static void DllRedirector::UnregisterAsFirstCFModule();
23 // Helper function that extracts the HMODULE parameter from our well known
25 static HMODULE
GetFirstCFModule();
27 // Helper function to return the DllGetClassObject function pointer from
28 // the given module. On success, the return value is non-null and module
29 // will have had its reference count incremented.
30 static LPFNGETCLASSOBJECT
GetDllGetClassObjectPtr(HMODULE module
);
33 // Use this to keep track of whether or not we have registered the window
34 // class in this module.
37 friend class ModuleUtilsTest
;
40 #endif // CHROME_FRAME_MODULE_UTILS_H_