1 // Copyright 2017 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.
4 
5 #include <windows.h>
6 
7 EXTERN_C IMAGE_DOS_HEADER __ImageBase;
8 
9 // Arg1: pointer to a buffer of size MAX_PATH + 1.
GetPathOnDisk(wchar_t * buffer)10 bool GetPathOnDisk(wchar_t* buffer) {
11   if (buffer == nullptr)
12     return false;
13 
14   if (::GetModuleFileNameW((HINSTANCE)&__ImageBase, buffer, MAX_PATH) == 0)
15     return false;
16 
17   return true;
18 }
19 
DllMain(HINSTANCE instance,DWORD reason,LPVOID reserved)20 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) {
21   return TRUE;
22 }
23