1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 #include <sal/config.h>
17 namespace sal::systools
19 // Returns true if the current process is run as a Windows store app, which has some specifics
20 inline bool IsStorePackagedApp()
22 // GetCurrentPackageFullName is only available since Windows 8
23 HMODULE hDll
= GetModuleHandleW(L
"kernel32.dll");
24 using Func_t
= LONG
WINAPI(UINT32
*, PWSTR
);
25 if (auto pFunc
= reinterpret_cast<Func_t
*>(GetProcAddress(hDll
, "GetCurrentPackageFullName")))
26 if (UINT32 size
= 0; pFunc(&size
, nullptr) == ERROR_INSUFFICIENT_BUFFER
)
32 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */