blob: e6b74c17b5342fe6440763e3243adb081ebfaaec [file] [log] [blame]
John Stiles964d8f12022-10-26 13:52:03 -04001/*
2 * Copyright 2022 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "tools/SkGetExecutablePath.h"
9#include <windows.h>
10
John Stilesf04b8272022-11-04 13:58:26 -040011std::string SkGetExecutablePath() {
John Stiles964d8f12022-10-26 13:52:03 -040012 char executableFileBuf[MAX_PATH];
13 DWORD executablePathLen = GetModuleFileNameA(nullptr, executableFileBuf, MAX_PATH);
John Stilesf04b8272022-11-04 13:58:26 -040014 return (executablePathLen > 0) ? std::string(executableFileBuf) : std::string();
John Stiles964d8f12022-10-26 13:52:03 -040015}