1 /* Copyright (c) 2003, Roger Dingledine
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2021, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
9 * \brief Find and load windows system libraries.
11 * We use this function to dynamically load code at runtime that might not be
12 * available on all versions of Windows that we support.
16 #include "lib/fs/winlib.h"
19 load_windows_system_library(const TCHAR
*library_name
)
23 n
= GetSystemDirectory(path
, MAX_PATH
);
24 if (n
== 0 || n
+ _tcslen(library_name
) + 2 >= MAX_PATH
)
26 _tcscat(path
, TEXT("\\"));
27 _tcscat(path
, library_name
);
28 return LoadLibrary(path
);
30 #endif /* defined(_WIN32) */