Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: base/native_library.h

Issue 2744043003: Use LoadLibraryExW if applicable in LoadNativeLibrary on Windows (Closed)
Patch Set: Better variable name. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/native_library_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_NATIVE_LIBRARY_H_ 5 #ifndef BASE_NATIVE_LIBRARY_H_
6 #define BASE_NATIVE_LIBRARY_H_ 6 #define BASE_NATIVE_LIBRARY_H_
7 7
8 // This file defines a cross-platform "NativeLibrary" type which represents 8 // This file defines a cross-platform "NativeLibrary" type which represents
9 // a loadable module. 9 // a loadable module.
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 NativeLibraryLoadError* error); 84 NativeLibraryLoadError* error);
85 85
86 // Loads a native library from disk. Release it with UnloadNativeLibrary when 86 // Loads a native library from disk. Release it with UnloadNativeLibrary when
87 // you're done. Returns NULL on failure. 87 // you're done. Returns NULL on failure.
88 // If |error| is not NULL, it may be filled in on load error. 88 // If |error| is not NULL, it may be filled in on load error.
89 BASE_EXPORT NativeLibrary LoadNativeLibraryWithOptions( 89 BASE_EXPORT NativeLibrary LoadNativeLibraryWithOptions(
90 const FilePath& library_path, 90 const FilePath& library_path,
91 const NativeLibraryOptions& options, 91 const NativeLibraryOptions& options,
92 NativeLibraryLoadError* error); 92 NativeLibraryLoadError* error);
93 93
94 #if defined(OS_WIN)
95 // Loads a native library from disk. Release it with UnloadNativeLibrary when
96 // you're done.
97 // This function retrieves the LoadLibrary function exported from kernel32.dll
98 // and calls it instead of directly calling the LoadLibrary function via the
99 // import table.
100 BASE_EXPORT NativeLibrary LoadNativeLibraryDynamically(
101 const FilePath& library_path);
102 #endif // OS_WIN
103
104 // Unloads a native library. 94 // Unloads a native library.
105 BASE_EXPORT void UnloadNativeLibrary(NativeLibrary library); 95 BASE_EXPORT void UnloadNativeLibrary(NativeLibrary library);
106 96
107 // Gets a function pointer from a native library. 97 // Gets a function pointer from a native library.
108 BASE_EXPORT void* GetFunctionPointerFromNativeLibrary(NativeLibrary library, 98 BASE_EXPORT void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
109 StringPiece name); 99 StringPiece name);
110 100
111 // Returns the full platform specific name for a native library. 101 // Returns the full platform specific name for a native library.
112 // |name| must be ASCII. 102 // |name| must be ASCII.
113 // For example: 103 // For example:
114 // "mylib" returns "mylib.dll" on Windows, "libmylib.so" on Linux, 104 // "mylib" returns "mylib.dll" on Windows, "libmylib.so" on Linux,
115 // "libmylib.dylib" on Mac. 105 // "libmylib.dylib" on Mac.
116 BASE_EXPORT std::string GetNativeLibraryName(StringPiece name); 106 BASE_EXPORT std::string GetNativeLibraryName(StringPiece name);
117 107
118 } // namespace base 108 } // namespace base
119 109
120 #endif // BASE_NATIVE_LIBRARY_H_ 110 #endif // BASE_NATIVE_LIBRARY_H_
OLDNEW
« no previous file with comments | « no previous file | base/native_library_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698