Blender V5.3
winstuff.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9
10#ifdef WIN32
11# ifdef WIN32_LEAN_AND_MEAN
12# undef WIN32_LEAN_AND_MEAN
13# endif
14# include <conio.h>
15# include <shlwapi.h>
16# include <stdio.h>
17# include <stdlib.h>
18# define COBJMACROS /* Remove this when converting to C++ */
19# include <dxgi.h>
20
21# include "MEM_guardedalloc.h"
22
23# define WIN32_SKIP_HKEY_PROTECTION /* Need to use HKEY. */
24# include "BLI_fileops.hh"
25# include "BLI_path_utils.hh"
26# include "BLI_string.hh"
27# include "BLI_utildefines.hh"
28# include "BLI_winstuff.hh"
29
30# include "utf_winfunc.hh"
31# include "utfconv.hh"
32
33namespace blender {
34
35/* FILE_MAXDIR + FILE_MAXFILE */
36
37int BLI_windows_get_executable_dir(char r_dirpath[/*FILE_MAXDIR*/])
38{
39 char filepath[FILE_MAX];
40 char dir[FILE_MAX];
41 int a;
42 /* Change to UTF support. */
43 GetModuleFileName(nullptr, filepath, sizeof(filepath));
44 BLI_path_split_dir_part(filepath, dir, sizeof(dir)); /* shouldn't be relative */
45 a = strlen(dir);
46 if (dir[a - 1] == '\\') {
47 dir[a - 1] = 0;
48 }
49
50 BLI_strncpy(r_dirpath, dir, FILE_MAXDIR);
51
52 return 1;
53}
54
56{
57 char install_dir[FILE_MAXDIR];
59 return (BLI_strcasestr(install_dir, "\\WindowsApps\\") != nullptr);
60}
61
62static void registry_error(HKEY root, const char *message)
63{
64 if (root) {
65 RegCloseKey(root);
66 }
67 fprintf(stderr, "%s\n", message);
68}
69
70static bool open_registry_hive(bool all_users, HKEY *r_root)
71{
72 if (RegOpenKeyEx(all_users ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER,
73 "Software\\Classes",
74 0,
75 KEY_ALL_ACCESS,
76 r_root) != ERROR_SUCCESS)
77 {
78 registry_error(*r_root, "Unable to open the registry with the required permissions");
79 return false;
80 }
81 return true;
82}
83
84static bool register_blender_prog_id(const char *prog_id,
85 const char *executable,
86 const char *friendly_name,
87 bool all_users)
88{
89 LONG lresult;
90 HKEY root = 0;
91 HKEY hkey_progid = 0;
92 char buffer[256];
93 DWORD dwd = 0;
94
95 if (!open_registry_hive(all_users, &root)) {
96 return false;
97 }
98
99 lresult = RegCreateKeyEx(root,
100 prog_id,
101 0,
102 nullptr,
103 REG_OPTION_NON_VOLATILE,
104 KEY_ALL_ACCESS,
105 nullptr,
106 &hkey_progid,
107 &dwd);
108
109 if (lresult == ERROR_SUCCESS) {
110 lresult = RegSetValueEx(
111 hkey_progid, nullptr, 0, REG_SZ, (BYTE *)friendly_name, strlen(friendly_name) + 1);
112 }
113 if (lresult == ERROR_SUCCESS) {
114 lresult = RegSetValueEx(
115 hkey_progid, "AppUserModelId", 0, REG_SZ, (BYTE *)prog_id, strlen(prog_id) + 1);
116 }
117 if (lresult != ERROR_SUCCESS) {
118 registry_error(root, "Unable to register Blender App Id");
119 return false;
120 }
121
122 SNPRINTF(buffer, "%s\\shell\\open", prog_id);
123 lresult = RegCreateKeyEx(root,
124 buffer,
125 0,
126 nullptr,
127 REG_OPTION_NON_VOLATILE,
128 KEY_ALL_ACCESS,
129 nullptr,
130 &hkey_progid,
131 &dwd);
132
133 lresult = RegSetValueEx(
134 hkey_progid, "FriendlyAppName", 0, REG_SZ, (BYTE *)friendly_name, strlen(friendly_name) + 1);
135
136 SNPRINTF(buffer, "%s\\shell\\open\\command", prog_id);
137
138 lresult = RegCreateKeyEx(root,
139 buffer,
140 0,
141 nullptr,
142 REG_OPTION_NON_VOLATILE,
143 KEY_ALL_ACCESS,
144 nullptr,
145 &hkey_progid,
146 &dwd);
147
148 if (lresult == ERROR_SUCCESS) {
149 const size_t buffer_len = SNPRINTF_RLEN(buffer, "\"%s\" \"%%1\"", executable);
150 lresult = RegSetValueEx(hkey_progid, nullptr, 0, REG_SZ, (BYTE *)buffer, buffer_len + 1);
151 RegCloseKey(hkey_progid);
152 }
153 if (lresult != ERROR_SUCCESS) {
154 registry_error(root, "Unable to register Blender App Id");
155 return false;
156 }
157
158 SNPRINTF(buffer, "%s\\DefaultIcon", prog_id);
159 lresult = RegCreateKeyEx(root,
160 buffer,
161 0,
162 nullptr,
163 REG_OPTION_NON_VOLATILE,
164 KEY_ALL_ACCESS,
165 nullptr,
166 &hkey_progid,
167 &dwd);
168
169 if (lresult == ERROR_SUCCESS) {
170 const size_t buffer_len = SNPRINTF_RLEN(buffer, "\"%s\", 1", executable);
171 lresult = RegSetValueEx(hkey_progid, nullptr, 0, REG_SZ, (BYTE *)buffer, buffer_len + 1);
172 RegCloseKey(hkey_progid);
173 }
174 if (lresult != ERROR_SUCCESS) {
175 registry_error(root, "Unable to register Blender App Id");
176 return false;
177 }
178 return true;
179}
180
181bool BLI_windows_register_blend_extension(const bool all_users)
182{
184 fprintf(stderr, "Registration not possible from Microsoft Store installation.");
185 return false;
186 }
187
188 HKEY root = 0;
189 char blender_path[MAX_PATH];
190 char *blender_app;
191 HKEY hkey = 0;
192 LONG lresult;
193 DWORD dwd = 0;
194 const char *prog_id = BLENDER_WIN_APPID;
195 const char *friendly_name = BLENDER_WIN_APPID_FRIENDLY_NAME;
196
197 GetModuleFileName(0, blender_path, sizeof(blender_path));
198
199 /* Prevent overflow when we add -launcher to the executable name. */
200 if (strlen(blender_path) > (sizeof(blender_path) - 10)) {
201 return false;
202 }
203
204 /* Replace the actual app name with the wrapper. */
205 blender_app = strstr(blender_path, "blender.exe");
206 if (!blender_app) {
207 return false;
208 }
209 strcpy(blender_app, "blender-launcher.exe");
210
211 if (!open_registry_hive(all_users, &root)) {
212 return false;
213 }
214
215 if (!register_blender_prog_id(prog_id, blender_path, friendly_name, all_users)) {
216 registry_error(root, "Unable to register Blender file type");
217 return false;
218 }
219
220 lresult = RegCreateKeyEx(
221 root, ".blend", 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &hkey, &dwd);
222 if (lresult == ERROR_SUCCESS) {
223 /* Set this instance the default. */
224 lresult = RegSetValueEx(hkey, nullptr, 0, REG_SZ, (BYTE *)prog_id, strlen(prog_id) + 1);
225
226 if (lresult != ERROR_SUCCESS) {
227 registry_error(root, "Unable to register Blender file type");
228 RegCloseKey(hkey);
229 return false;
230 }
231 RegCloseKey(hkey);
232
233 lresult = RegCreateKeyEx(root,
234 ".blend\\OpenWithProgids",
235 0,
236 nullptr,
237 REG_OPTION_NON_VOLATILE,
238 KEY_ALL_ACCESS,
239 nullptr,
240 &hkey,
241 &dwd);
242
243 if (lresult != ERROR_SUCCESS) {
244 registry_error(root, "Unable to register Blender file type");
245 RegCloseKey(hkey);
246 return false;
247 }
248 lresult = RegSetValueEx(hkey, prog_id, 0, REG_NONE, nullptr, 0);
249 RegCloseKey(hkey);
250 }
251
252 if (lresult != ERROR_SUCCESS) {
253 registry_error(root, "Unable to register Blender file type");
254 return false;
255 }
256
257 if (!BLI_windows_update_pinned_launcher(blender_path)) {
258 fprintf(stderr, "Update of pinned launcher failed.");
259 return false;
260 }
261
262# ifdef WITH_BLENDER_THUMBNAILER
263 {
264 char reg_cmd[MAX_PATH * 2];
265 char install_dir[FILE_MAXDIR];
266 char system_dir[FILE_MAXDIR];
268 GetSystemDirectory(system_dir, sizeof(system_dir));
269 const char *thumbnail_handler = "BlendThumb.dll";
270 SNPRINTF(reg_cmd, "%s\\regsvr32 /s \"%s\\%s\"", system_dir, install_dir, thumbnail_handler);
271 system(reg_cmd);
272 }
273# endif
274
275 RegCloseKey(root);
276 char message[256];
277 SNPRINTF(message,
278 "Blend file extension registered for %s.",
279 all_users ? "all users" : "the current user");
280 printf("%s\n", message);
281
282 return true;
283}
284
285bool BLI_windows_unregister_blend_extension(const bool all_users)
286{
288 fprintf(stderr, "Unregistration not possible from Microsoft Store installation.");
289 return false;
290 }
291
292 HKEY root = 0;
293 HKEY hkey = 0;
294 LONG lresult;
295
296 if (!open_registry_hive(all_users, &root)) {
297 return false;
298 }
299
300 /* Don't stop on failure. We want to allow unregister after unregister. */
301
302 RegDeleteTree(root, BLENDER_WIN_APPID);
303
304 lresult = RegOpenKeyEx(root, ".blend", 0, KEY_ALL_ACCESS, &hkey);
305 if (lresult == ERROR_SUCCESS) {
306 char buffer[256] = {0};
307 DWORD size = sizeof(buffer);
308 lresult = RegGetValueA(hkey, nullptr, nullptr, RRF_RT_REG_SZ, nullptr, &buffer, &size);
309 if (lresult == ERROR_SUCCESS && STREQ(buffer, BLENDER_WIN_APPID)) {
310 RegSetValueEx(hkey, nullptr, 0, REG_SZ, 0, 0);
311 }
312 }
313
314# ifdef WITH_BLENDER_THUMBNAILER
315 {
316 char reg_cmd[MAX_PATH * 2];
317 char install_dir[FILE_MAXDIR];
318 char system_dir[FILE_MAXDIR];
320 GetSystemDirectory(system_dir, sizeof(system_dir));
321 const char *thumbnail_handler = "BlendThumb.dll";
322 SNPRINTF(reg_cmd, "%s\\regsvr32 /u /s \"%s\\%s\"", system_dir, install_dir, thumbnail_handler);
323 system(reg_cmd);
324 }
325# endif
326
327 lresult = RegOpenKeyEx(hkey, "OpenWithProgids", 0, KEY_ALL_ACCESS, &hkey);
328 if (lresult == ERROR_SUCCESS) {
329 RegDeleteValue(hkey, BLENDER_WIN_APPID);
330 }
331
332 RegCloseKey(root);
333 char message[256];
334 SNPRINTF(message,
335 "Blend file extension unregistered for %s.",
336 all_users ? "all users" : "the current user");
337 printf("%s\n", message);
338
339 return true;
340}
341
348static bool BLI_windows_file_operation_is_registered(const char *extension, const char *operation)
349{
350 HKEY hKey;
351 HRESULT hr = AssocQueryKey(ASSOCF_INIT_IGNOREUNKNOWN,
352 ASSOCKEY_SHELLEXECCLASS,
353 (LPCTSTR)extension,
354 (LPCTSTR)operation,
355 &hKey);
356 if (SUCCEEDED(hr)) {
357 RegCloseKey(hKey);
358 return true;
359 }
360 return false;
361}
362
363bool BLI_windows_external_operation_supported(const char *filepath, const char *operation)
364{
365 if (STREQ(operation, "open") || STREQ(operation, "properties")) {
366 return true;
367 }
368
369 if (BLI_is_dir(filepath)) {
370 return BLI_windows_file_operation_is_registered("Directory", operation);
371 }
372
373 const char *extension = BLI_path_extension(filepath);
374 return BLI_windows_file_operation_is_registered(extension, operation);
375}
376
377bool BLI_windows_external_operation_execute(const char *filepath, const char *operation)
378{
379 WCHAR wpath[FILE_MAX];
380 if (conv_utf_8_to_16(filepath, wpath, ARRAY_SIZE(wpath)) != 0) {
381 return false;
382 }
383
384 WCHAR woperation[FILE_MAX];
385 if (conv_utf_8_to_16(operation, woperation, ARRAY_SIZE(woperation)) != 0) {
386 return false;
387 }
388
389 SHELLEXECUTEINFOW shellinfo = {0};
390 shellinfo.cbSize = sizeof(SHELLEXECUTEINFO);
391 shellinfo.fMask = SEE_MASK_INVOKEIDLIST;
392 shellinfo.lpVerb = woperation;
393 shellinfo.lpFile = wpath;
394 shellinfo.nShow = SW_SHOW;
395
396 return ShellExecuteExW(&shellinfo);
397}
398
399bool BLI_windows_execute_self(const char *parameters,
400 const bool wait,
401 const bool elevated,
402 const bool silent)
403{
404 char blender_path[MAX_PATH];
405 GetModuleFileName(0, blender_path, MAX_PATH);
406
407 SHELLEXECUTEINFOA shellinfo = {0};
408 shellinfo.cbSize = sizeof(SHELLEXECUTEINFO);
409 shellinfo.fMask = wait ? SEE_MASK_NOCLOSEPROCESS : SEE_MASK_DEFAULT;
410 shellinfo.hwnd = nullptr;
411 shellinfo.lpVerb = elevated ? "runas" : nullptr;
412 shellinfo.lpFile = blender_path;
413 shellinfo.lpParameters = parameters;
414 shellinfo.lpDirectory = nullptr;
415 shellinfo.nShow = silent ? SW_HIDE : SW_SHOW;
416 shellinfo.hInstApp = nullptr;
417 shellinfo.hProcess = 0;
418
419 DWORD exitCode = 0;
420 if (!ShellExecuteExA(&shellinfo)) {
421 return false;
422 }
423 if (!wait) {
424 return true;
425 }
426
427 if (shellinfo.hProcess != 0) {
428 WaitForSingleObject(shellinfo.hProcess, INFINITE);
429 GetExitCodeProcess(shellinfo.hProcess, &exitCode);
430 CloseHandle(shellinfo.hProcess);
431 return (exitCode == 0);
432 }
433
434 return false;
435}
436
437void BLI_windows_get_default_root_dir(char root[4])
438{
439 char str[MAX_PATH + 1];
440
441 /* the default drive to resolve a directory without a specified drive
442 * should be the Windows installation drive, since this was what the OS
443 * assumes. */
444 if (GetWindowsDirectory(str, MAX_PATH + 1)) {
445 root[0] = str[0];
446 root[1] = ':';
447 root[2] = '\\';
448 root[3] = '\0';
449 }
450 else {
451 /* if GetWindowsDirectory fails, something has probably gone wrong,
452 * we are trying the blender install dir though */
453 if (GetModuleFileName(nullptr, str, MAX_PATH + 1)) {
454 printf(
455 "Error! Could not get the Windows Directory - "
456 "Defaulting to Blender installation Dir!\n");
457 root[0] = str[0];
458 root[1] = ':';
459 root[2] = '\\';
460 root[3] = '\0';
461 }
462 else {
463 DWORD tmp;
464 int i;
465 int rc = 0;
466 /* now something has gone really wrong - still trying our best guess */
467 printf(
468 "Error! Could not get the Windows Directory - "
469 "Defaulting to first valid drive! Path might be invalid!\n");
470 tmp = GetLogicalDrives();
471 for (i = 2; i < 26; i++) {
472 if ((tmp >> i) & 1) {
473 root[0] = 'a' + i;
474 root[1] = ':';
475 root[2] = '\\';
476 root[3] = '\0';
477 if (GetFileAttributes(root) != 0xFFFFFFFF) {
478 rc = i;
479 break;
480 }
481 }
482 }
483 if (0 == rc) {
484 printf("ERROR in 'BLI_windows_get_default_root_dir': cannot find a valid drive!\n");
485 root[0] = 'C';
486 root[1] = ':';
487 root[2] = '\\';
488 root[3] = '\0';
489 }
490 }
491 }
492}
493
494bool BLI_windows_get_directx_driver_version(const wchar_t *deviceSubString,
495 long long *r_driverVersion)
496{
497 IDXGIFactory *pFactory = nullptr;
498 IDXGIAdapter *pAdapter = nullptr;
499 if (CreateDXGIFactory(__uuidof(IDXGIFactory), (void **)&pFactory) == S_OK) {
500 for (UINT i = 0; pFactory->EnumAdapters(i, &pAdapter) != DXGI_ERROR_NOT_FOUND; ++i) {
501 LARGE_INTEGER version;
502 if (pAdapter->CheckInterfaceSupport(__uuidof(IDXGIDevice), &version) == S_OK) {
503 DXGI_ADAPTER_DESC desc;
504 if (pAdapter->GetDesc(&desc) == S_OK) {
505 if (wcsstr(desc.Description, deviceSubString)) {
506 *r_driverVersion = version.QuadPart;
507
508 pAdapter->Release();
509 pFactory->Release();
510 return true;
511 }
512 }
513 }
514
515 pAdapter->Release();
516 }
517 pFactory->Release();
518 }
519
520 return false;
521}
522
524 int *driver_version_minor,
525 int *driver_version_major,
526 uint32_t *device_id)
527{
528 IDXGIFactory *pFactory = nullptr;
529 IDXGIAdapter *pAdapter = nullptr;
530 if (CreateDXGIFactory(__uuidof(IDXGIFactory), (void **)&pFactory) == S_OK) {
531 for (UINT i = 0; pFactory->EnumAdapters(i, &pAdapter) != DXGI_ERROR_NOT_FOUND; ++i) {
532 LARGE_INTEGER version;
533 if (pAdapter->CheckInterfaceSupport(__uuidof(IDXGIDevice), &version) == S_OK) {
534 DXGI_ADAPTER_DESC desc;
535 if (pAdapter->GetDesc(&desc) == S_OK) {
536 uint64_t adapter_luid = (uint64_t(desc.AdapterLuid.HighPart) << uint64_t(32)) |
537 uint64_t(desc.AdapterLuid.LowPart);
538 if (device_luid == adapter_luid) {
539 *device_id = desc.DeviceId;
540 *driver_version_major = int((version.QuadPart >> 16) & 0xFFFF);
541 *driver_version_minor = int(version.QuadPart & 0xFFFF);
542
543 pAdapter->Release();
544 pFactory->Release();
545 return true;
546 }
547 }
548 }
549
550 pAdapter->Release();
551 }
552 pFactory->Release();
553 }
554
555 return false;
556}
557
559 DWORD minorVersion,
560 DWORD buildNumber)
561{
562 HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
563 if (hMod == 0) {
564 return false;
565 }
566
567 typedef NTSTATUS(WINAPI * RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
568 RtlGetVersionPtr rtl_get_version = (RtlGetVersionPtr)::GetProcAddress(hMod, "RtlGetVersion");
569 if (rtl_get_version == nullptr) {
570 fprintf(stderr, "BLI_windows_is_build_version_greater_or_equal: RtlGetVersion not found.");
571 return false;
572 }
573
574 RTL_OSVERSIONINFOW osVersioninfo{};
575 osVersioninfo.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOW);
576 if (rtl_get_version(&osVersioninfo) != 0) {
577 fprintf(stderr, "BLI_windows_is_build_version_greater_or_equal: RtlGetVersion failed.");
578 return false;
579 }
580 if (majorVersion != osVersioninfo.dwMajorVersion) {
581 return osVersioninfo.dwMajorVersion > majorVersion;
582 }
583 if (minorVersion != osVersioninfo.dwMinorVersion) {
584 return osVersioninfo.dwMajorVersion > minorVersion;
585 }
586 return osVersioninfo.dwBuildNumber >= buildNumber;
587}
588
589void BLI_windows_process_set_qos(QoSMode qos_mode, QoSPrecedence qos_precedence)
590{
591 static QoSPrecedence qos_precedence_last = QoSPrecedence::JOB;
592 if (int(qos_precedence) < int(qos_precedence_last)) {
593 return;
594 }
595
596 /* Only supported on Windows build >= 10.0.22000, i.e., Windows 11 21H2:
597 * https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/ne-processthreadsapi-process_information_class
598 */
600 return;
601 }
602
603 PROCESS_POWER_THROTTLING_STATE processPowerThrottlingState{};
604 processPowerThrottlingState.Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION;
605 switch (qos_mode) {
606 case QoSMode::DEFAULT:
607 processPowerThrottlingState.ControlMask = 0;
608 processPowerThrottlingState.StateMask = 0;
609 break;
610 case QoSMode::HIGH:
611 processPowerThrottlingState.ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
612 processPowerThrottlingState.StateMask = 0;
613 break;
614 case QoSMode::ECO:
615 processPowerThrottlingState.ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
616 processPowerThrottlingState.StateMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
617 break;
618 }
619 HANDLE hProcess = GetCurrentProcess();
620 if (!SetProcessInformation(hProcess,
621 ProcessPowerThrottling,
622 &processPowerThrottlingState,
623 sizeof(PROCESS_POWER_THROTTLING_STATE)))
624 {
625 fprintf(stderr,
626 "BLI_windows_set_process_qos: SetProcessInformation failed: %lx\n",
627 GetLastError());
628 return;
629 }
630 qos_precedence_last = qos_precedence;
631}
632
633} // namespace blender
634
635#else
636
637/* intentionally empty for UNIX */
638
639#endif
File and directory operations.
#define FILE_MAX
#define FILE_MAXDIR
#define SNPRINTF(dst, format,...)
#define SNPRINTF_RLEN(dst, format,...)
Compatibility-like things for windows.
Read Blender memory allocation and freeing.
#define STREQ(a, b)
#define str(s)
#define L
int size(const AssetLibraryReference *library_reference)
constexpr toml::spec version
Definition recents.cc:33
BMesh Iterators.
bool BLI_windows_unregister_blend_extension(bool all_users)
unsigned __int64 uint64_t
Definition BKE_text.h:91
bool BLI_windows_execute_self(const char *parameters, const bool wait, const bool elevated, const bool silent)
bool BLI_windows_external_operation_execute(const char *filepath, const char *operation)
const char * BLI_path_extension(const char *filepath) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
int char * BLI_strcasestr(const char *s, const char *find) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
bool BLI_windows_get_directx_driver_version(const wchar_t *deviceSubString, long long *r_driverVersion)
unsigned int uint32_t
Definition BKE_text.h:81
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
bool BLI_windows_update_pinned_launcher(const char *launcher_path)
bool BLI_windows_is_store_install(void)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:457
bool BLI_windows_get_directx_intel_driver_info(uint64_t device_luid, int *driver_version_minor, int *driver_version_major, uint32_t *device_id)
void BLI_windows_process_set_qos(QoSMode qos_mode, QoSPrecedence qos_precedence)
bool BLI_windows_external_operation_supported(const char *filepath, const char *operation)
bool BLI_windows_register_blend_extension(bool all_users)
int BLI_windows_get_executable_dir(char r_dirpath[])
void BLI_windows_get_default_root_dir(char root_dir[4])
bool BLI_windows_is_build_version_greater_or_equal(DWORD majorVersion, DWORD minorVersion, DWORD buildNumber)
int conv_utf_8_to_16(const char *in8, wchar_t *out16, size_t size16)
Definition utfconv.cc:182