[a1bae3e] | 1 | // SoftEther UT-VPN SourceCode |
---|
| 2 | // |
---|
| 3 | // Copyright (C) 2004-2010 SoftEther Corporation. |
---|
| 4 | // Copyright (C) 2004-2010 University of Tsukuba, Japan. |
---|
| 5 | // Copyright (C) 2003-2010 Daiyuu Nobori. |
---|
| 6 | // All Rights Reserved. |
---|
| 7 | // |
---|
| 8 | // http://utvpn.tsukuba.ac.jp/ |
---|
| 9 | // |
---|
| 10 | // This program is free software; you can redistribute it and/or |
---|
| 11 | // modify it under the terms of the GNU General Public License |
---|
| 12 | // version 2 as published by the Free Software Foundation. |
---|
| 13 | // |
---|
| 14 | // This program is distributed in the hope that it will be useful, |
---|
| 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | // GNU General Public License for more details. |
---|
| 18 | // |
---|
| 19 | // You should have received a copy of the GNU General Public License version 2 |
---|
| 20 | // along with this program; if not, write to the Free Software |
---|
| 21 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 22 | // |
---|
| 23 | // このファイルは GPL バージョン 2 ライセンスで公開されています。 |
---|
| 24 | // 誰でもこのファイルの内容を複製、改変したり、改変したバージョンを再配布 |
---|
| 25 | // することができます。ただし、原著作物を改変した場合は、原著作物の著作権表示 |
---|
| 26 | // を除去することはできません。改変した著作物を配布する場合は、改変実施者の |
---|
| 27 | // 著作権表示を原著作物の著作権表示に付随して記載するようにしてください。 |
---|
| 28 | // |
---|
| 29 | // この SoftEther UT-VPN オープンソース・プロジェクトは、日本国の |
---|
| 30 | // ソフトイーサ株式会社 (SoftEther Corporation, http://www.softether.co.jp/ ) |
---|
| 31 | // および筑波大学 (University of Tsukuba, http://www.tsukuba.ac.jp/ ) によって |
---|
| 32 | // ホストされています。 |
---|
| 33 | // 本プログラムの配布者は、本プログラムを、業としての利用以外のため、 |
---|
| 34 | // および、試験または研究のために利用が行われることを想定して配布 |
---|
| 35 | // しています。 |
---|
| 36 | // SoftEther UT-VPN プロジェクトの Web サイトは http://utvpn.tsukuba.ac.jp/ に |
---|
| 37 | // あります。 |
---|
| 38 | // 本ソフトウェアの不具合の修正、機能改良、セキュリティホールの修復などのコード |
---|
| 39 | // の改変を行った場合で、その成果物を SoftEther UT-VPN プロジェクトに提出して |
---|
| 40 | // いただける場合は、 http://utvpn.tsukuba.ac.jp/ までソースコードを送付して |
---|
| 41 | // ください。SoftEther UT-VPN プロジェクトの本体リリースまたはブランチリリース |
---|
| 42 | // に組み込みさせていただきます。 |
---|
| 43 | // |
---|
| 44 | // GPL に基づいて原著作物が提供される本ソフトウェアの改良版を配布、販売する |
---|
| 45 | // 場合は、そのソースコードを GPL に基づいて誰にでも開示する義務が生じます。 |
---|
| 46 | // |
---|
| 47 | // 本ソフトウェアに関連する著作権、特許権、商標権はソフトイーサ株式会社 |
---|
| 48 | // (SoftEther Corporation) およびその他の著作権保持者が保有しています。 |
---|
| 49 | // ソフトイーサ株式会社等はこれらの権利を放棄していません。本ソフトウェアの |
---|
| 50 | // 二次著作物を配布、販売する場合は、これらの権利を侵害しないようにご注意 |
---|
| 51 | // ください。 |
---|
| 52 | // |
---|
| 53 | // お願い: どのような通信ソフトウェアにも通常は必ず未発見の |
---|
| 54 | // セキュリティホールが潜んでいます。本ソースコードをご覧いただいた結果、 |
---|
| 55 | // UT-VPN にセキュリティホールを発見された場合は、当該セキュリティホールの |
---|
| 56 | // 情報を不特定多数に開示される前に、必ず、ソフトイーサ株式会社 |
---|
| 57 | // および脆弱性情報の届出を受け付ける公的機関まで通報いただき、 |
---|
| 58 | // 公益保護にご協力いただきますようお願い申し上げます。 |
---|
| 59 | // |
---|
| 60 | // ソフトイーサ株式会社は、当該セキュリティホールについて迅速に対処を |
---|
| 61 | // 行い、UT-VPN および UT-VPN に関連するソフトウェアのユーザー・顧客 |
---|
| 62 | // を保護するための努力を行います。 |
---|
| 63 | // |
---|
| 64 | // ソフトイーサへの届出先: http://www.softether.co.jp/jp/contact/ |
---|
| 65 | // 日本国内の脆弱性情報届出受付公的機関: |
---|
| 66 | // 独立行政法人 情報処理推進機構 |
---|
| 67 | // http://www.ipa.go.jp/security/vuln/report/ |
---|
| 68 | // |
---|
| 69 | // 上記各事項について不明な点は、ソフトイーサ株式会社までご連絡ください。 |
---|
| 70 | // 連絡先: http://www.softether.co.jp/jp/contact/ |
---|
| 71 | |
---|
| 72 | // ----------------------------------------------- |
---|
| 73 | // [ChangeLog] |
---|
| 74 | // 2010.05.20 |
---|
| 75 | // 新規リリース by SoftEther |
---|
| 76 | // ----------------------------------------------- |
---|
| 77 | |
---|
| 78 | // Microsoft.h |
---|
| 79 | // Microsoft.c のヘッダ |
---|
| 80 | |
---|
| 81 | #ifdef OS_WIN32 |
---|
| 82 | |
---|
| 83 | // Windows 用の型が windows.h をインクルードしていなくても使えるようにする |
---|
| 84 | #ifndef _WINDEF_ |
---|
| 85 | |
---|
| 86 | typedef void *HWND; |
---|
| 87 | |
---|
| 88 | #endif // _WINDEF_ |
---|
| 89 | |
---|
| 90 | #ifndef MICROSOFT_H |
---|
| 91 | #define MICROSOFT_H |
---|
| 92 | |
---|
| 93 | |
---|
| 94 | // イベントログ定数 |
---|
| 95 | #define MS_EVENTLOG_TYPE_INFORMATION 0 |
---|
| 96 | #define MS_EVENTLOG_TYPE_WARNING 1 |
---|
| 97 | #define MS_EVENTLOG_TYPE_ERROR 2 |
---|
| 98 | |
---|
| 99 | #define MS_RC_EVENTLOG_TYPE_INFORMATION 0x40000001L |
---|
| 100 | #define MS_RC_EVENTLOG_TYPE_WARNING 0x80000002L |
---|
| 101 | #define MS_RC_EVENTLOG_TYPE_ERROR 0xC0000003L |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | // TCP/IP レジストリ値 |
---|
| 105 | #define TCP_MAX_NUM_CONNECTIONS 16777214 |
---|
| 106 | |
---|
| 107 | #define DEFAULT_TCP_MAX_WINDOW_SIZE_RECV 5955584 |
---|
| 108 | #define DEFAULT_TCP_MAX_WINDOW_SIZE_SEND 131072 |
---|
| 109 | #define DEFAULT_TCP_MAX_NUM_CONNECTIONS 16777214 |
---|
| 110 | |
---|
| 111 | // 定数 |
---|
| 112 | #define SVC_ARG_INSTALL "/install" |
---|
| 113 | #define SVC_ARG_UNINSTALL "/uninstall" |
---|
| 114 | #define SVC_ARG_START "/start" |
---|
| 115 | #define SVC_ARG_STOP "/stop" |
---|
| 116 | #define SVC_ARG_TEST "/test" |
---|
| 117 | #define SVC_ARG_USERMODE "/usermode" |
---|
| 118 | #define SVC_ARG_USERMODE_SHOWTRAY "/usermode_showtray" |
---|
| 119 | #define SVC_ARG_USERMODE_HIDETRAY "/usermode_hidetray" |
---|
| 120 | #define SVC_ARG_SERVICE "/service" |
---|
| 121 | #define SVC_ARG_SETUP_INSTALL "/setup_install" |
---|
| 122 | #define SVC_ARG_SETUP_UNINSTALL "/setup_uninstall" |
---|
| 123 | #define SVC_ARG_WIN9X_SERVICE "/win9x_service" |
---|
| 124 | #define SVC_ARG_WIN9X_INSTALL "/win9x_install" |
---|
| 125 | #define SVC_ARG_WIN9X_UNINSTALL "/win9x_uninstall" |
---|
| 126 | #define SVC_ARG_TCP "/tcp" |
---|
| 127 | #define SVC_ARG_TCP_SETUP "/tcpsetup" |
---|
| 128 | #define SVC_ARG_TRAFFIC "/traffic" |
---|
| 129 | #define SVC_ARG_UIHELP "/uihelp" |
---|
| 130 | #define SVC_ARG_UIHELP_W L"/uihelp" |
---|
| 131 | #define SVC_ARG_SILENT "/silent" |
---|
| 132 | |
---|
| 133 | // サービスがフリーズした場合の自殺までの時間 |
---|
| 134 | #define SVC_SELFKILL_TIMEOUT (5 * 60 * 1000) |
---|
| 135 | |
---|
| 136 | // Win32 版仮想 LAN カードのデバイスドライバの名称 (先頭部分) |
---|
| 137 | #define VLAN_ADAPTER_NAME "UT-VPN Client Adapter" |
---|
| 138 | |
---|
| 139 | // Win32 版仮想 LAN カードのデバイスドライバの名称 (フルネーム) |
---|
| 140 | #define VLAN_ADAPTER_NAME_TAG "UT-VPN Client Adapter - %s" |
---|
| 141 | |
---|
| 142 | // Win32 版仮想 LAN カードの [ネットワーク接続] における表示名 (フルネーム) |
---|
| 143 | #define VLAN_CONNECTION_NAME "%s - UT-VPN Client" |
---|
| 144 | |
---|
| 145 | |
---|
| 146 | // サービス時のコマンドライン書式 |
---|
| 147 | #define SVC_RUN_COMMANDLINE L"\"%s\" /service" |
---|
| 148 | |
---|
| 149 | // モード値 |
---|
| 150 | #define SVC_MODE_NONE 0 |
---|
| 151 | #define SVC_MODE_INSTALL 1 |
---|
| 152 | #define SVC_MODE_UNINSTALL 2 |
---|
| 153 | #define SVC_MODE_START 3 |
---|
| 154 | #define SVC_MODE_STOP 4 |
---|
| 155 | #define SVC_MODE_TEST 5 |
---|
| 156 | #define SVC_MODE_USERMODE 6 |
---|
| 157 | #define SVC_MODE_SERVICE 7 |
---|
| 158 | #define SVC_MODE_SETUP_INSTALL 8 |
---|
| 159 | #define SVC_MODE_SETUP_UNINSTALL 9 |
---|
| 160 | #define SVC_MODE_WIN9X_SERVICE 10 |
---|
| 161 | #define SVC_MODE_WIN9X_INSTALL 11 |
---|
| 162 | #define SVC_MODE_WIN9X_UNINSTALL 12 |
---|
| 163 | #define SVC_MODE_TCP 13 |
---|
| 164 | #define SVC_MODE_TCPSETUP 14 |
---|
| 165 | #define SVC_MODE_TRAFFIC 15 |
---|
| 166 | #define SVC_MODE_UIHELP 16 |
---|
| 167 | |
---|
| 168 | |
---|
| 169 | #define WIN9X_SVC_REGKEY_1 "Software\\Microsoft\\Windows\\CurrentVersion\\RunServices" |
---|
| 170 | #define WIN9X_SVC_REGKEY_2 "Software\\Microsoft\\Windows\\CurrentVersion\\Run" |
---|
| 171 | |
---|
| 172 | #define VISTA_MMCSS_KEYNAME "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile\\Tasks" |
---|
| 173 | #define VISTA_MMCSS_FILENAME "mmcss_backup.dat" |
---|
| 174 | |
---|
| 175 | #define SVC_NAME "SVC_%s_NAME" |
---|
| 176 | #define SVC_TITLE "SVC_%s_TITLE" |
---|
| 177 | #define SVC_DESCRIPT "SVC_%s_DESCRIPT" |
---|
| 178 | |
---|
| 179 | #define SVC_USERMODE_SETTING_KEY "Software\\SoftEther Corporation\\UT-VPN\\UserMode Settings" |
---|
| 180 | #define SVC_HIDETRAY_REG_VALUE "HideTray_%S" |
---|
| 181 | |
---|
| 182 | #define SVC_CALLING_SM_PROCESS_ID_KEY "Software\\SoftEther Corporation\\UT-VPN\\Service Control\\%s" |
---|
| 183 | #define SVC_CALLING_SM_PROCESS_ID_VALUE "ProcessId" |
---|
| 184 | |
---|
| 185 | #define MMCSS_PROFILE_KEYNAME "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile" |
---|
| 186 | |
---|
| 187 | // その他の定数 |
---|
| 188 | #define MS_REG_TCP_SETTING_KEY "Software\\SoftEther Corporation\\Network Settings" |
---|
| 189 | |
---|
| 190 | |
---|
| 191 | |
---|
| 192 | // ドライバ関係の定数 |
---|
| 193 | #define DRIVER_INF_FILE_NAME L"|vpn_driver.inf" |
---|
| 194 | #define DRIVER_INF_FILE_NAME_X64 L"|vpn_driver_x64.inf" |
---|
| 195 | #define DRIVER_INF_FILE_NAME_IA64 L"|vpn_driver_ia64.inf" |
---|
| 196 | #define DRIVER_INF_FILE_NAME_9X L"|vpn_driver_9x.inf" |
---|
| 197 | #define DRIVER_SYS_FILE_NAME L"|vpn_driver.sys" |
---|
| 198 | #define DRIVER_SYS_FILE_NAME_X64 L"|vpn_driver_x64.sys" |
---|
| 199 | #define DRIVER_SYS_FILE_NAME_IA64 L"|vpn_driver_ia64.sys" |
---|
| 200 | #define DRIVER_SYS_FILE_NAME_9X L"|vpn_driver_9x.sys" |
---|
| 201 | #define DRIVER_INSTALL_INF_NAME_TAG "Sen_%s.inf" |
---|
| 202 | #define DRIVER_INSTALL_SYS_NAME_TAG "Sen_%s.sys" |
---|
| 203 | #define DRIVER_INSTALL_SYS_NAME_TAG_NEW "Sen_%04u.sys" |
---|
| 204 | #define DRIVER_INSTALL_SYS_NAME_TAG_MAXID 128 |
---|
| 205 | |
---|
| 206 | // Vista 用ドライバインストーラ関係 |
---|
| 207 | #define VISTA_DRIVER_INSTALLER_SRC L"|driver_installer.exe" |
---|
| 208 | #define VISTA_DRIVER_INSTALLER_SRC_X64 L"|driver_installer_x64.exe" |
---|
| 209 | #define VISTA_DRIVER_INSTALLER_SRC_IA64 L"|driver_installer_ia64.exe" |
---|
| 210 | #define VISTA_DRIVER_INSTALLER_DST L"%s\\driver_installer.exe" |
---|
| 211 | |
---|
| 212 | #define DRIVER_DEVICE_ID_TAG "SenAdapter_%s" |
---|
| 213 | |
---|
| 214 | |
---|
| 215 | #if (defined(MICROSOFT_C) || defined(NETWORK_C)) && (defined(OS_WIN32)) |
---|
| 216 | |
---|
| 217 | typedef enum __TCP_TABLE_CLASS { |
---|
| 218 | _TCP_TABLE_BASIC_LISTENER, |
---|
| 219 | _TCP_TABLE_BASIC_CONNECTIONS, |
---|
| 220 | _TCP_TABLE_BASIC_ALL, |
---|
| 221 | _TCP_TABLE_OWNER_PID_LISTENER, |
---|
| 222 | _TCP_TABLE_OWNER_PID_CONNECTIONS, |
---|
| 223 | _TCP_TABLE_OWNER_PID_ALL, |
---|
| 224 | _TCP_TABLE_OWNER_MODULE_LISTENER, |
---|
| 225 | _TCP_TABLE_OWNER_MODULE_CONNECTIONS, |
---|
| 226 | _TCP_TABLE_OWNER_MODULE_ALL |
---|
| 227 | } _TCP_TABLE_CLASS, *_PTCP_TABLE_CLASS; |
---|
| 228 | |
---|
| 229 | // Win32 ネットワーク関係の API 関数へのポインタ |
---|
| 230 | typedef struct NETWORK_WIN32_FUNCTIONS |
---|
| 231 | { |
---|
| 232 | HINSTANCE hIpHlpApi32; |
---|
| 233 | DWORD (WINAPI *DeleteIpForwardEntry)(PMIB_IPFORWARDROW); |
---|
| 234 | DWORD (WINAPI *CreateIpForwardEntry)(PMIB_IPFORWARDROW); |
---|
| 235 | DWORD (WINAPI *GetIpForwardTable)(PMIB_IPFORWARDTABLE, PULONG, BOOL); |
---|
| 236 | DWORD (WINAPI *GetNetworkParams)(PFIXED_INFO, PULONG); |
---|
| 237 | DWORD (WINAPI *GetIfTable)(PMIB_IFTABLE, PULONG, BOOL); |
---|
| 238 | DWORD (WINAPI *IpRenewAddress)(PIP_ADAPTER_INDEX_MAP); |
---|
| 239 | DWORD (WINAPI *IpReleaseAddress)(PIP_ADAPTER_INDEX_MAP); |
---|
| 240 | DWORD (WINAPI *GetInterfaceInfo)(PIP_INTERFACE_INFO, PULONG); |
---|
| 241 | DWORD (WINAPI *GetAdaptersInfo)(PIP_ADAPTER_INFO, PULONG); |
---|
| 242 | DWORD (WINAPI *GetExtendedTcpTable)(PVOID, PDWORD, BOOL, ULONG, _TCP_TABLE_CLASS, ULONG); |
---|
| 243 | DWORD (WINAPI *AllocateAndGetTcpExTableFromStack)(PVOID *, BOOL, HANDLE, DWORD, DWORD); |
---|
| 244 | DWORD (WINAPI *GetTcpTable)(PMIB_TCPTABLE, PDWORD, BOOL); |
---|
| 245 | DWORD (WINAPI *NotifyRouteChange)(PHANDLE, LPOVERLAPPED); |
---|
| 246 | BOOL (WINAPI *CancelIPChangeNotify)(LPOVERLAPPED); |
---|
| 247 | DWORD (WINAPI *NhpAllocateAndGetInterfaceInfoFromStack)(IP_INTERFACE_NAME_INFO **, |
---|
| 248 | PDWORD, BOOL, HANDLE, DWORD); |
---|
| 249 | } NETWORK_WIN32_FUNCTIONS; |
---|
| 250 | #endif |
---|
| 251 | |
---|
| 252 | |
---|
| 253 | #ifdef MICROSOFT_C |
---|
| 254 | // 内部用構造体 |
---|
| 255 | typedef struct MS |
---|
| 256 | { |
---|
| 257 | HINSTANCE hInst; |
---|
| 258 | HINSTANCE hKernel32; |
---|
| 259 | bool IsNt; |
---|
| 260 | bool IsAdmin; |
---|
| 261 | struct NT_API *nt; |
---|
| 262 | HANDLE hCurrentProcess; |
---|
| 263 | UINT CurrentProcessId; |
---|
| 264 | bool MiniDumpEnabled; |
---|
| 265 | char *ExeFileName; |
---|
| 266 | char *ExeFileDir; |
---|
| 267 | char *WindowsDir; |
---|
| 268 | char *System32Dir; |
---|
| 269 | char *TempDir; |
---|
| 270 | char *WinTempDir; |
---|
| 271 | char *WindowsDrive; |
---|
| 272 | char *ProgramFilesDir; |
---|
| 273 | char *CommonStartMenuDir; |
---|
| 274 | char *CommonProgramsDir; |
---|
| 275 | char *CommonStartupDir; |
---|
| 276 | char *CommonAppDataDir; |
---|
| 277 | char *CommonDesktopDir; |
---|
| 278 | char *PersonalStartMenuDir; |
---|
| 279 | char *PersonalProgramsDir; |
---|
| 280 | char *PersonalStartupDir; |
---|
| 281 | char *PersonalAppDataDir; |
---|
| 282 | char *PersonalDesktopDir; |
---|
| 283 | char *MyDocumentsDir; |
---|
| 284 | char *LocalAppDataDir; |
---|
| 285 | char *MyTempDir; |
---|
| 286 | char *UserName; |
---|
| 287 | char *UserNameEx; |
---|
| 288 | wchar_t *ExeFileNameW; |
---|
| 289 | wchar_t *ExeFileDirW; |
---|
| 290 | wchar_t *WindowsDirW; |
---|
| 291 | wchar_t *System32DirW; |
---|
| 292 | wchar_t *TempDirW; |
---|
| 293 | wchar_t *WinTempDirW; |
---|
| 294 | wchar_t *WindowsDriveW; |
---|
| 295 | wchar_t *ProgramFilesDirW; |
---|
| 296 | wchar_t *CommonStartMenuDirW; |
---|
| 297 | wchar_t *CommonProgramsDirW; |
---|
| 298 | wchar_t *CommonStartupDirW; |
---|
| 299 | wchar_t *CommonAppDataDirW; |
---|
| 300 | wchar_t *CommonDesktopDirW; |
---|
| 301 | wchar_t *PersonalStartMenuDirW; |
---|
| 302 | wchar_t *PersonalProgramsDirW; |
---|
| 303 | wchar_t *PersonalStartupDirW; |
---|
| 304 | wchar_t *PersonalAppDataDirW; |
---|
| 305 | wchar_t *PersonalDesktopDirW; |
---|
| 306 | wchar_t *MyDocumentsDirW; |
---|
| 307 | wchar_t *LocalAppDataDirW; |
---|
| 308 | wchar_t *MyTempDirW; |
---|
| 309 | wchar_t *UserNameW; |
---|
| 310 | wchar_t *UserNameExW; |
---|
| 311 | wchar_t *MinidumpBaseFileNameW; |
---|
| 312 | IO *LockFile; |
---|
| 313 | } MS; |
---|
| 314 | |
---|
| 315 | // Windows NT 用 API |
---|
| 316 | typedef struct NT_API |
---|
| 317 | { |
---|
| 318 | HINSTANCE hAdvapi32; |
---|
| 319 | HINSTANCE hShell32; |
---|
| 320 | HINSTANCE hNewDev; |
---|
| 321 | HINSTANCE hSetupApi; |
---|
| 322 | HINSTANCE hWtsApi32; |
---|
| 323 | HINSTANCE hPsApi; |
---|
| 324 | HINSTANCE hKernel32; |
---|
| 325 | HINSTANCE hSecur32; |
---|
| 326 | HINSTANCE hUser32; |
---|
| 327 | HINSTANCE hDbgHelp; |
---|
| 328 | BOOL (WINAPI *OpenProcessToken)(HANDLE, DWORD, PHANDLE); |
---|
| 329 | BOOL (WINAPI *LookupPrivilegeValue)(char *, char *, PLUID); |
---|
| 330 | BOOL (WINAPI *AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); |
---|
| 331 | BOOL (WINAPI *InitiateSystemShutdown)(LPTSTR, LPTSTR, DWORD, BOOL, BOOL); |
---|
| 332 | BOOL (WINAPI *LogonUserW)(wchar_t *, wchar_t *, wchar_t *, DWORD, DWORD, HANDLE *); |
---|
| 333 | BOOL (WINAPI *LogonUserA)(char *, char *, char *, DWORD, DWORD, HANDLE *); |
---|
| 334 | BOOL (WINAPI *UpdateDriverForPlugAndPlayDevicesW)(HWND hWnd, wchar_t *hardware_id, wchar_t *inf_path, UINT flag, BOOL *need_reboot); |
---|
| 335 | UINT (WINAPI *CM_Get_DevNode_Status_Ex)(UINT *, UINT *, DWORD, UINT, HANDLE); |
---|
| 336 | UINT (WINAPI *CM_Get_Device_ID_ExA)(DWORD, char *, UINT, UINT, HANDLE); |
---|
| 337 | UINT (WINAPI *WTSQuerySessionInformation)(HANDLE, DWORD, WTS_INFO_CLASS, wchar_t *, DWORD *); |
---|
| 338 | void (WINAPI *WTSFreeMemory)(void *); |
---|
| 339 | BOOL (WINAPI *WTSDisconnectSession)(HANDLE, DWORD, BOOL); |
---|
| 340 | BOOL (WINAPI *WTSEnumerateSessions)(HANDLE, DWORD, DWORD, PWTS_SESSION_INFO *, DWORD *); |
---|
| 341 | SC_HANDLE (WINAPI *OpenSCManager)(LPCTSTR, LPCTSTR, DWORD); |
---|
| 342 | SC_HANDLE (WINAPI *CreateServiceA)(SC_HANDLE, LPCTSTR, LPCTSTR, DWORD, DWORD, DWORD, DWORD, LPCTSTR, LPCTSTR, LPDWORD, LPCTSTR, LPCTSTR, LPCTSTR); |
---|
| 343 | SC_HANDLE (WINAPI *CreateServiceW)(SC_HANDLE, LPCWSTR, LPCWSTR, DWORD, DWORD, DWORD, DWORD, LPCWSTR, LPCWSTR, LPDWORD, LPCWSTR, LPCWSTR, LPCWSTR); |
---|
| 344 | BOOL (WINAPI *ChangeServiceConfig2)(SC_HANDLE, DWORD, LPVOID); |
---|
| 345 | BOOL (WINAPI *CloseServiceHandle)(SC_HANDLE); |
---|
| 346 | SC_HANDLE (WINAPI *OpenService)(SC_HANDLE, LPCTSTR, DWORD); |
---|
| 347 | BOOL (WINAPI *QueryServiceStatus)(SC_HANDLE, LPSERVICE_STATUS); |
---|
| 348 | BOOL (WINAPI *StartService)(SC_HANDLE, DWORD, LPCTSTR); |
---|
| 349 | BOOL (WINAPI *ControlService)(SC_HANDLE, DWORD, LPSERVICE_STATUS); |
---|
| 350 | BOOL (WINAPI *SetServiceStatus)(SERVICE_STATUS_HANDLE, LPSERVICE_STATUS); |
---|
| 351 | SERVICE_STATUS_HANDLE (WINAPI *RegisterServiceCtrlHandler)(LPCTSTR, LPHANDLER_FUNCTION); |
---|
| 352 | BOOL (WINAPI *StartServiceCtrlDispatcher)(CONST LPSERVICE_TABLE_ENTRY); |
---|
| 353 | BOOL (WINAPI *DeleteService)(SC_HANDLE); |
---|
| 354 | BOOL (WINAPI *EnumProcesses)(DWORD *, DWORD, DWORD *); |
---|
| 355 | BOOL (WINAPI *EnumProcessModules)(HANDLE, HMODULE *, DWORD, DWORD *); |
---|
| 356 | DWORD (WINAPI *GetModuleFileNameExA)(HANDLE, HMODULE, LPSTR, DWORD); |
---|
| 357 | DWORD (WINAPI *GetModuleFileNameExW)(HANDLE, HMODULE, LPWSTR, DWORD); |
---|
| 358 | LONG (WINAPI *RegDeleteKeyExA)(HKEY, LPCTSTR, REGSAM, DWORD); |
---|
| 359 | BOOL (WINAPI *IsWow64Process)(HANDLE, BOOL *); |
---|
| 360 | void (WINAPI *GetNativeSystemInfo)(SYSTEM_INFO *); |
---|
| 361 | BOOL (WINAPI *DuplicateTokenEx)(HANDLE, DWORD, SECURITY_ATTRIBUTES *, SECURITY_IMPERSONATION_LEVEL, TOKEN_TYPE, HANDLE *); |
---|
| 362 | BOOL (WINAPI *ConvertStringSidToSidA)(LPCSTR, PSID *); |
---|
| 363 | BOOL (WINAPI *SetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, void *, DWORD); |
---|
| 364 | BOOL (WINAPI *GetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, void *, DWORD, PDWORD); |
---|
| 365 | BOOL (WINAPI *CreateProcessAsUserA)(HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, void *, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION); |
---|
| 366 | BOOL (WINAPI *CreateProcessAsUserW)(HANDLE, LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, void *, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION); |
---|
| 367 | BOOL (WINAPI *LookupAccountSidA)(LPCSTR,PSID,LPSTR,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE); |
---|
| 368 | BOOL (WINAPI *LookupAccountNameA)(LPCSTR,LPCSTR,PSID,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE); |
---|
| 369 | BOOL (WINAPI *GetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG); |
---|
| 370 | BOOL (WINAPI *GetUserNameExW)(EXTENDED_NAME_FORMAT, LPWSTR, PULONG); |
---|
| 371 | BOOL (WINAPI *SwitchDesktop)(HDESK); |
---|
| 372 | HDESK (WINAPI *OpenDesktopA)(LPTSTR, DWORD, BOOL, ACCESS_MASK); |
---|
| 373 | BOOL (WINAPI *CloseDesktop)(HDESK); |
---|
| 374 | BOOL (WINAPI *SetProcessShutdownParameters)(DWORD, DWORD); |
---|
| 375 | HANDLE (WINAPI *RegisterEventSourceW)(LPCWSTR, LPCWSTR); |
---|
| 376 | BOOL (WINAPI *ReportEventW)(HANDLE, WORD, WORD, DWORD, PSID, WORD, DWORD, LPCWSTR *, LPVOID); |
---|
| 377 | BOOL (WINAPI *DeregisterEventSource)(HANDLE); |
---|
| 378 | BOOL (WINAPI *Wow64DisableWow64FsRedirection)(void **); |
---|
| 379 | BOOLEAN (WINAPI *Wow64EnableWow64FsRedirection)(BOOLEAN); |
---|
| 380 | BOOL (WINAPI *Wow64RevertWow64FsRedirection)(void *); |
---|
| 381 | BOOL (WINAPI *GetFileInformationByHandle)(HANDLE, LPBY_HANDLE_FILE_INFORMATION); |
---|
| 382 | HANDLE (WINAPI *GetProcessHeap)(); |
---|
| 383 | BOOL (WINAPI *MiniDumpWriteDump)(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, |
---|
| 384 | PMINIDUMP_EXCEPTION_INFORMATION, PMINIDUMP_USER_STREAM_INFORMATION, |
---|
| 385 | PMINIDUMP_CALLBACK_INFORMATION); |
---|
| 386 | } NT_API; |
---|
| 387 | |
---|
| 388 | typedef struct MS_EVENTLOG |
---|
| 389 | { |
---|
| 390 | HANDLE hEventLog; |
---|
| 391 | } MS_EVENTLOG; |
---|
| 392 | |
---|
| 393 | extern NETWORK_WIN32_FUNCTIONS *w32net; |
---|
| 394 | |
---|
| 395 | #endif // MICROSOFT_C |
---|
| 396 | |
---|
| 397 | // 警告を出さないようにするための構造体 |
---|
| 398 | typedef struct NO_WARNING |
---|
| 399 | { |
---|
| 400 | DWORD ThreadId; |
---|
| 401 | THREAD *NoWarningThread; |
---|
| 402 | EVENT *HaltEvent; |
---|
| 403 | volatile bool Halt; |
---|
| 404 | wchar_t *SoundFileName; |
---|
| 405 | } NO_WARNING; |
---|
| 406 | |
---|
| 407 | // ルートキーの ID |
---|
| 408 | #define REG_CLASSES_ROOT 0 // HKEY_CLASSES_ROOT |
---|
| 409 | #define REG_LOCAL_MACHINE 1 // HKEY_LOCAL_MACHINE |
---|
| 410 | #define REG_CURRENT_USER 2 // HKEY_CURRENT_USER |
---|
| 411 | #define REG_USERS 3 // HKEY_USERS |
---|
| 412 | |
---|
| 413 | // サービス関数 |
---|
| 414 | typedef void (SERVICE_FUNCTION)(); |
---|
| 415 | |
---|
| 416 | // プロセスリスト項目 |
---|
| 417 | typedef struct MS_PROCESS |
---|
| 418 | { |
---|
| 419 | char ExeFilename[MAX_PATH]; // EXE ファイル名 |
---|
| 420 | wchar_t ExeFilenameW[MAX_PATH]; // EXE ファイル名 (Unicode) |
---|
| 421 | UINT ProcessId; // プロセス ID |
---|
| 422 | } MS_PROCESS; |
---|
| 423 | |
---|
| 424 | #define MAX_MS_ADAPTER_IP_ADDRESS 64 |
---|
| 425 | |
---|
| 426 | // ネットワークアダプタ |
---|
| 427 | typedef struct MS_ADAPTER |
---|
| 428 | { |
---|
| 429 | char Title[MAX_PATH]; // 表示名 |
---|
| 430 | UINT Index; // インデックス |
---|
| 431 | UINT Type; // 種類 |
---|
| 432 | UINT Status; // ステータス |
---|
| 433 | UINT Mtu; // MTU |
---|
| 434 | UINT Speed; // 速度 |
---|
| 435 | UINT AddressSize; // アドレスサイズ |
---|
| 436 | UCHAR Address[8]; // アドレス |
---|
| 437 | UINT64 RecvBytes; // 受信バイト数 |
---|
| 438 | UINT64 RecvPacketsBroadcast; // 受信ブロードキャストパケット数 |
---|
| 439 | UINT64 RecvPacketsUnicast; // 受信ユニキャストパケット数 |
---|
| 440 | UINT64 SendBytes; // 送信バイト数 |
---|
| 441 | UINT64 SendPacketsBroadcast; // 送信ブロードキャストパケット数 |
---|
| 442 | UINT64 SendPacketsUnicast; // 送信ユニキャストパケット数 |
---|
| 443 | bool Info; // 詳しい情報があるかどうか |
---|
| 444 | char Guid[MAX_SIZE]; // GUID |
---|
| 445 | UINT NumIpAddress; // IP アドレス個数 |
---|
| 446 | IP IpAddresses[MAX_MS_ADAPTER_IP_ADDRESS]; // IP アドレス |
---|
| 447 | IP SubnetMasks[MAX_MS_ADAPTER_IP_ADDRESS]; // サブネット マスク |
---|
| 448 | UINT NumGateway; // ゲートウェイ個数 |
---|
| 449 | IP Gateways[MAX_MS_ADAPTER_IP_ADDRESS]; // ゲートウェイ |
---|
| 450 | bool UseDhcp; // DHCP 使用フラグ |
---|
| 451 | IP DhcpServer; // DHCP サーバー |
---|
| 452 | UINT64 DhcpLeaseStart; // DHCP リース開始日時 |
---|
| 453 | UINT64 DhcpLeaseExpires; // DHCP リース期限日時 |
---|
| 454 | bool UseWins; // WINS 使用フラグ |
---|
| 455 | IP PrimaryWinsServer; // プライマリ WINS サーバー |
---|
| 456 | IP SecondaryWinsServer; // セカンダリ WINS サーバー |
---|
| 457 | } MS_ADAPTER; |
---|
| 458 | |
---|
| 459 | // ネットワークアダプタリスト |
---|
| 460 | typedef struct MS_ADAPTER_LIST |
---|
| 461 | { |
---|
| 462 | UINT Num; // 個数 |
---|
| 463 | MS_ADAPTER **Adapters; // 内容 |
---|
| 464 | } MS_ADAPTER_LIST; |
---|
| 465 | |
---|
| 466 | // TCP 設定 |
---|
| 467 | typedef struct MS_TCP |
---|
| 468 | { |
---|
| 469 | UINT RecvWindowSize; // 受信ウインドウサイズ |
---|
| 470 | UINT SendWindowSize; // 送信ウインドウサイズ |
---|
| 471 | } MS_TCP; |
---|
| 472 | |
---|
| 473 | // スリープ防止 |
---|
| 474 | typedef struct MS_NOSLEEP |
---|
| 475 | { |
---|
| 476 | THREAD *Thread; // スレッド |
---|
| 477 | EVENT *HaltEvent; // 停止イベント |
---|
| 478 | volatile bool Halt; // 停止フラグ |
---|
| 479 | bool NoScreenSaver; // スクリーンセーバーも防止 |
---|
| 480 | |
---|
| 481 | // 以下 Windows Vista 用 |
---|
| 482 | wchar_t ScreenSaveActive[MAX_PATH]; |
---|
| 483 | wchar_t SCRNSAVE_EXE[MAX_PATH]; |
---|
| 484 | } MS_NOSLEEP; |
---|
| 485 | |
---|
| 486 | // 子ウインドウ列挙 |
---|
| 487 | typedef struct ENUM_CHILD_WINDOW_PARAM |
---|
| 488 | { |
---|
| 489 | LIST *o; |
---|
| 490 | bool no_recursion; |
---|
| 491 | bool include_ipcontrol; |
---|
| 492 | } ENUM_CHILD_WINDOW_PARAM; |
---|
| 493 | |
---|
| 494 | // 関数プロトタイプ |
---|
| 495 | void MsInit(); |
---|
| 496 | void MsFree(); |
---|
| 497 | char *MsCutExeNameFromCommandLine(char *str); |
---|
| 498 | wchar_t *MsCutExeNameFromUniCommandLine(wchar_t *str); |
---|
| 499 | |
---|
| 500 | DWORD MsRegAccessMaskFor64Bit(bool force32bit); |
---|
| 501 | DWORD MsRegAccessMaskFor64BitEx(bool force32bit, bool force64bit); |
---|
| 502 | |
---|
| 503 | bool MsRegIsKey(UINT root, char *name); |
---|
| 504 | bool MsRegIsKeyEx(UINT root, char *name, bool force32bit); |
---|
| 505 | bool MsRegIsKeyEx2(UINT root, char *name, bool force32bit, bool force64bit); |
---|
| 506 | |
---|
| 507 | bool MsRegIsValue(UINT root, char *keyname, char *valuename); |
---|
| 508 | bool MsRegIsValueEx(UINT root, char *keyname, char *valuename, bool force32bit); |
---|
| 509 | bool MsRegIsValueEx2(UINT root, char *keyname, char *valuename, bool force32bit, bool force64bit); |
---|
| 510 | |
---|
| 511 | bool MsRegGetValueTypeAndSize(UINT root, char *keyname, char *valuename, UINT *type, UINT *size); |
---|
| 512 | bool MsRegGetValueTypeAndSizeEx(UINT root, char *keyname, char *valuename, UINT *type, UINT *size, bool force32bit); |
---|
| 513 | bool MsRegGetValueTypeAndSizeEx2(UINT root, char *keyname, char *valuename, UINT *type, UINT *size, bool force32bit, bool force64bit); |
---|
| 514 | bool MsRegGetValueTypeAndSizeW(UINT root, char *keyname, char *valuename, UINT *type, UINT *size); |
---|
| 515 | bool MsRegGetValueTypeAndSizeExW(UINT root, char *keyname, char *valuename, UINT *type, UINT *size, bool force32bit); |
---|
| 516 | bool MsRegGetValueTypeAndSizeEx2W(UINT root, char *keyname, char *valuename, UINT *type, UINT *size, bool force32bit, bool force64bit); |
---|
| 517 | |
---|
| 518 | bool MsRegReadValue(UINT root, char *keyname, char *valuename, void **data, UINT *type, UINT *size); |
---|
| 519 | bool MsRegReadValueEx(UINT root, char *keyname, char *valuename, void **data, UINT *type, UINT *size, bool force32bit); |
---|
| 520 | bool MsRegReadValueEx2(UINT root, char *keyname, char *valuename, void **data, UINT *type, UINT *size, bool force32bit, bool force64bit); |
---|
| 521 | bool MsRegReadValueW(UINT root, char *keyname, char *valuename, void **data, UINT *type, UINT *size); |
---|
| 522 | bool MsRegReadValueExW(UINT root, char *keyname, char *valuename, void **data, UINT *type, UINT *size, bool force32bit); |
---|
| 523 | bool MsRegReadValueEx2W(UINT root, char *keyname, char *valuename, void **data, UINT *type, UINT *size, bool force32bit, bool force64bit); |
---|
| 524 | |
---|
| 525 | char *MsRegReadStr(UINT root, char *keyname, char *valuename); |
---|
| 526 | char *MsRegReadStrEx(UINT root, char *keyname, char *valuename, bool force32bit); |
---|
| 527 | char *MsRegReadStrEx2(UINT root, char *keyname, char *valuename, bool force32bit, bool force64bit); |
---|
| 528 | wchar_t *MsRegReadStrW(UINT root, char *keyname, char *valuename); |
---|
| 529 | wchar_t *MsRegReadStrExW(UINT root, char *keyname, char *valuename, bool force32bit); |
---|
| 530 | wchar_t *MsRegReadStrEx2W(UINT root, char *keyname, char *valuename, bool force32bit, bool force64bit); |
---|
| 531 | |
---|
| 532 | UINT MsRegReadInt(UINT root, char *keyname, char *valuename); |
---|
| 533 | UINT MsRegReadIntEx(UINT root, char *keyname, char *valuename, bool force32bit); |
---|
| 534 | UINT MsRegReadIntEx2(UINT root, char *keyname, char *valuename, bool force32bit, bool force64bit); |
---|
| 535 | LIST *MsRegReadStrList(UINT root, char *keyname, char *valuename); |
---|
| 536 | LIST *MsRegReadStrListEx(UINT root, char *keyname, char *valuename, bool force32bit); |
---|
| 537 | LIST *MsRegReadStrListEx2(UINT root, char *keyname, char *valuename, bool force32bit, bool force64bit); |
---|
| 538 | |
---|
| 539 | BUF *MsRegReadBin(UINT root, char *keyname, char *valuename); |
---|
| 540 | BUF *MsRegReadBinEx(UINT root, char *keyname, char *valuename, bool force32bit); |
---|
| 541 | BUF *MsRegReadBinEx2(UINT root, char *keyname, char *valuename, bool force32bit, bool force64bit); |
---|
| 542 | |
---|
| 543 | bool MsRegNewKey(UINT root, char *keyname); |
---|
| 544 | bool MsRegNewKeyEx(UINT root, char *keyname, bool force32bit); |
---|
| 545 | bool MsRegNewKeyEx2(UINT root, char *keyname, bool force32bit, bool force64bit); |
---|
| 546 | |
---|
| 547 | bool MsRegWriteValue(UINT root, char *keyname, char *valuename, UINT type, void *data, UINT size); |
---|
| 548 | bool MsRegWriteValueEx(UINT root, char *keyname, char *valuename, UINT type, void *data, UINT size, bool force32bit); |
---|
| 549 | bool MsRegWriteValueEx2(UINT root, char *keyname, char *valuename, UINT type, void *data, UINT size, bool force32bit, bool force64bit); |
---|
| 550 | bool MsRegWriteValueW(UINT root, char *keyname, char *valuename, UINT type, void *data, UINT size); |
---|
| 551 | bool MsRegWriteValueExW(UINT root, char *keyname, char *valuename, UINT type, void *data, UINT size, bool force32bit); |
---|
| 552 | bool MsRegWriteValueEx2W(UINT root, char *keyname, char *valuename, UINT type, void *data, UINT size, bool force32bit, bool force64bit); |
---|
| 553 | |
---|
| 554 | bool MsRegWriteStr(UINT root, char *keyname, char *valuename, char *str); |
---|
| 555 | bool MsRegWriteStrEx(UINT root, char *keyname, char *valuename, char *str, bool force32bit); |
---|
| 556 | bool MsRegWriteStrEx2(UINT root, char *keyname, char *valuename, char *str, bool force32bit, bool force64bit); |
---|
| 557 | bool MsRegWriteStrExpand(UINT root, char *keyname, char *valuename, char *str); |
---|
| 558 | bool MsRegWriteStrExpandEx(UINT root, char *keyname, char *valuename, char *str, bool force32bit); |
---|
| 559 | bool MsRegWriteStrExpandEx2(UINT root, char *keyname, char *valuename, char *str, bool force32bit, bool force64bit); |
---|
| 560 | bool MsRegWriteStrW(UINT root, char *keyname, char *valuename, wchar_t *str); |
---|
| 561 | bool MsRegWriteStrExW(UINT root, char *keyname, char *valuename, wchar_t *str, bool force32bit); |
---|
| 562 | bool MsRegWriteStrEx2W(UINT root, char *keyname, char *valuename, wchar_t *str, bool force32bit, bool force64bit); |
---|
| 563 | bool MsRegWriteStrExpandW(UINT root, char *keyname, char *valuename, wchar_t *str); |
---|
| 564 | bool MsRegWriteStrExpandExW(UINT root, char *keyname, char *valuename, wchar_t *str, bool force32bit); |
---|
| 565 | bool MsRegWriteStrExpandEx2W(UINT root, char *keyname, char *valuename, wchar_t *str, bool force32bit, bool force64bit); |
---|
| 566 | |
---|
| 567 | bool MsRegWriteInt(UINT root, char *keyname, char *valuename, UINT value); |
---|
| 568 | bool MsRegWriteIntEx(UINT root, char *keyname, char *valuename, UINT value, bool force32bit); |
---|
| 569 | bool MsRegWriteIntEx2(UINT root, char *keyname, char *valuename, UINT value, bool force32bit, bool force64bit); |
---|
| 570 | bool MsRegWriteBin(UINT root, char *keyname, char *valuename, void *data, UINT size); |
---|
| 571 | bool MsRegWriteBinEx(UINT root, char *keyname, char *valuename, void *data, UINT size, bool force32bit); |
---|
| 572 | bool MsRegWriteBinEx2(UINT root, char *keyname, char *valuename, void *data, UINT size, bool force32bit, bool force64bit); |
---|
| 573 | |
---|
| 574 | TOKEN_LIST *MsRegEnumKey(UINT root, char *keyname); |
---|
| 575 | TOKEN_LIST *MsRegEnumKeyEx(UINT root, char *keyname, bool force32bit); |
---|
| 576 | TOKEN_LIST *MsRegEnumKeyEx2(UINT root, char *keyname, bool force32bit, bool force64bit); |
---|
| 577 | TOKEN_LIST *MsRegEnumValue(UINT root, char *keyname); |
---|
| 578 | TOKEN_LIST *MsRegEnumValueEx(UINT root, char *keyname, bool force32bit); |
---|
| 579 | TOKEN_LIST *MsRegEnumValueEx2(UINT root, char *keyname, bool force32bit, bool force64bit); |
---|
| 580 | |
---|
| 581 | bool MsRegDeleteKey(UINT root, char *keyname); |
---|
| 582 | bool MsRegDeleteKeyEx(UINT root, char *keyname, bool force32bit); |
---|
| 583 | bool MsRegDeleteKeyEx2(UINT root, char *keyname, bool force32bit, bool force64bit); |
---|
| 584 | bool MsRegDeleteValue(UINT root, char *keyname, char *valuename); |
---|
| 585 | bool MsRegDeleteValueEx(UINT root, char *keyname, char *valuename, bool force32bit); |
---|
| 586 | bool MsRegDeleteValueEx2(UINT root, char *keyname, char *valuename, bool force32bit, bool force64bit); |
---|
| 587 | |
---|
| 588 | bool MsIsNt(); |
---|
| 589 | bool MsIsAdmin(); |
---|
| 590 | bool MsEnablePrivilege(char *name, bool enable); |
---|
| 591 | void *MsGetCurrentProcess(); |
---|
| 592 | UINT MsGetCurrentProcessId(); |
---|
| 593 | char *MsGetExeFileName(); |
---|
| 594 | char *MsGetExeDirName(); |
---|
| 595 | wchar_t *MsGetExeDirNameW(); |
---|
| 596 | |
---|
| 597 | bool MsShutdown(bool reboot, bool force); |
---|
| 598 | bool MsShutdownEx(bool reboot, bool force, UINT time_limit, char *message); |
---|
| 599 | bool MsCheckLogon(wchar_t *username, char *password); |
---|
| 600 | bool MsIsPasswordEmpty(wchar_t *username); |
---|
| 601 | TOKEN_LIST *MsEnumNetworkAdapters(char *start_with_name, char *start_with_name_2); |
---|
| 602 | TOKEN_LIST *MsEnumNetworkAdaptersSen(); |
---|
| 603 | bool MsGetSenDeiverFilename(char *name, UINT size, char *instance_name); |
---|
| 604 | bool MsMakeNewSenDriverFilename(char *name, UINT size); |
---|
| 605 | void MsGenerateSenDriverFilenameFromInt(char *name, UINT size, UINT n); |
---|
| 606 | TOKEN_LIST *MsEnumSenDriverFilenames(); |
---|
| 607 | char *MsGetNetworkAdapterGuid(char *tag_name, char *instance_name); |
---|
| 608 | wchar_t *MsGetNetworkConnectionName(char *guid); |
---|
| 609 | char *MsGetNetworkConfigRegKeyNameFromGuid(char *guid); |
---|
| 610 | char *MsGetNetworkConfigRegKeyNameFromInstanceName(char *tag_name, char *instance_name); |
---|
| 611 | void MsSetNetworkConfig(char *tag_name, char *instance_name, char *friendly_name, bool show_icon); |
---|
| 612 | void MsInitNetworkConfig(char *tag_name, char *instance_name, char *connection_tag_name); |
---|
| 613 | |
---|
| 614 | char *MsGetSpecialDir(int id); |
---|
| 615 | wchar_t *MsGetSpecialDirW(int id); |
---|
| 616 | void MsGetSpecialDirs(); |
---|
| 617 | bool MsCheckIsAdmin(); |
---|
| 618 | void MsInitTempDir(); |
---|
| 619 | void MsFreeTempDir(); |
---|
| 620 | void MsGenLockFile(wchar_t *name, UINT size, wchar_t *temp_dir); |
---|
| 621 | void MsDeleteTempDir(); |
---|
| 622 | void MsDeleteAllFile(char *dir); |
---|
| 623 | void MsDeleteAllFileW(wchar_t *dir); |
---|
| 624 | char *MsCreateTempFileName(char *name); |
---|
| 625 | char *MsCreateTempFileNameByExt(char *ext); |
---|
| 626 | IO *MsCreateTempFile(char *name); |
---|
| 627 | IO *MsCreateTempFileByExt(char *ext); |
---|
| 628 | |
---|
| 629 | bool MsShowNetworkConfiguration(HWND hWnd); |
---|
| 630 | |
---|
| 631 | bool MsInstallVLan(char *tag_name, char *connection_tag_name, char *instance_name); |
---|
| 632 | bool MsUpgradeVLan(char *tag_name, char *connection_tag_name, char *instance_name); |
---|
| 633 | bool MsEnableVLan(char *instance_name); |
---|
| 634 | bool MsDisableVLan(char *instance_name); |
---|
| 635 | bool MsUninstallVLan(char *instance_name); |
---|
| 636 | bool MsIsVLanEnabled(char *instance_name); |
---|
| 637 | void MsRestartVLan(char *instance_name); |
---|
| 638 | bool MsIsVLanExists(char *tag_name, char *instance_name); |
---|
| 639 | bool MsStartDriverInstall(char *instance_name, UCHAR *mac_address, char *sen_sys); |
---|
| 640 | void MsFinishDriverInstall(char *instance_name, char *sen_sys); |
---|
| 641 | void MsGetDriverPath(char *instance_name, wchar_t *src_inf, wchar_t *src_sys, wchar_t *dest_inf, wchar_t *dest_sys, char *sen_sys); |
---|
| 642 | void MsGetDriverPathA(char *instance_name, char *src_inf, char *src_sys, char *dest_inf, char *dest_sys, char *sen_sys); |
---|
| 643 | void MsGenMacAddress(UCHAR *mac); |
---|
| 644 | char *MsGetMacAddress(char *tag_name, char *instance_name); |
---|
| 645 | void MsSetMacAddress(char *tag_name, char *instance_name, char *mac_address); |
---|
| 646 | char *MsGetDriverVersion(char *tag_name, char *instance_name); |
---|
| 647 | char *MsGetDriverFileName(char *tag_name, char *instance_name); |
---|
| 648 | void MsTest(); |
---|
| 649 | void MsInitGlobalNetworkConfig(); |
---|
| 650 | void MsSetThreadPriorityHigh(); |
---|
| 651 | void MsSetThreadPriorityLow(); |
---|
| 652 | void MsSetThreadPriorityIdle(); |
---|
| 653 | void MsSetThreadPriorityRealtime(); |
---|
| 654 | void MsRestoreThreadPriority(); |
---|
| 655 | char *MsGetLocalAppDataDir(); |
---|
| 656 | char *MsGetCommonAppDataDir(); |
---|
| 657 | char *MsGetWindowsDir(); |
---|
| 658 | char *MsGetSystem32Dir(); |
---|
| 659 | char *MsGetTempDir(); |
---|
| 660 | char *MsGetWindowsDrive(); |
---|
| 661 | char *MsGetProgramFilesDir(); |
---|
| 662 | char *MsGetCommonStartMenuDir(); |
---|
| 663 | char *MsGetCommonProgramsDir(); |
---|
| 664 | char *MsGetCommonStartupDir(); |
---|
| 665 | char *MsGetCommonAppDataDir(); |
---|
| 666 | char *MsGetCommonDesktopDir(); |
---|
| 667 | char *MsGetPersonalStartMenuDir(); |
---|
| 668 | char *MsGetPersonalProgramsDir(); |
---|
| 669 | char *MsGetPersonalStartupDir(); |
---|
| 670 | char *MsGetPersonalAppDataDir(); |
---|
| 671 | char *MsGetPersonalDesktopDir(); |
---|
| 672 | char *MsGetMyDocumentsDir(); |
---|
| 673 | char *MsGetMyTempDir(); |
---|
| 674 | char *MsGetUserName(); |
---|
| 675 | char *MsGetUserNameEx(); |
---|
| 676 | char *MsGetWinTempDir(); |
---|
| 677 | wchar_t *MsGetWindowsDirW(); |
---|
| 678 | wchar_t *MsGetExeFileNameW(); |
---|
| 679 | wchar_t *MsGetExeFileDirW(); |
---|
| 680 | wchar_t *MsGetWindowDirW(); |
---|
| 681 | wchar_t *MsGetSystem32DirW(); |
---|
| 682 | wchar_t *MsGetTempDirW(); |
---|
| 683 | wchar_t *MsGetWindowsDriveW(); |
---|
| 684 | wchar_t *MsGetProgramFilesDirW(); |
---|
| 685 | wchar_t *MsGetCommonStartMenuDirW(); |
---|
| 686 | wchar_t *MsGetCommonProgramsDirW(); |
---|
| 687 | wchar_t *MsGetCommonStartupDirW(); |
---|
| 688 | wchar_t *MsGetCommonAppDataDirW(); |
---|
| 689 | wchar_t *MsGetCommonDesktopDirW(); |
---|
| 690 | wchar_t *MsGetPersonalStartMenuDirW(); |
---|
| 691 | wchar_t *MsGetPersonalProgramsDirW(); |
---|
| 692 | wchar_t *MsGetPersonalStartupDirW(); |
---|
| 693 | wchar_t *MsGetPersonalAppDataDirW(); |
---|
| 694 | wchar_t *MsGetPersonalDesktopDirW(); |
---|
| 695 | wchar_t *MsGetMyDocumentsDirW(); |
---|
| 696 | wchar_t *MsGetLocalAppDataDirW(); |
---|
| 697 | wchar_t *MsGetMyTempDirW(); |
---|
| 698 | wchar_t *MsGetUserNameW(); |
---|
| 699 | wchar_t *MsGetUserNameExW(); |
---|
| 700 | wchar_t *MsGetWinTempDirW(); |
---|
| 701 | UINT MsGetProcessId(); |
---|
| 702 | void MsTerminateProcess(); |
---|
| 703 | bool MsIsServiceInstalled(char *name); |
---|
| 704 | bool MsInstallService(char *name, char *title, wchar_t *description, char *path); |
---|
| 705 | bool MsInstallServiceExW(char *name, wchar_t *title, wchar_t *description, wchar_t *path, UINT *error_code); |
---|
| 706 | bool MsInstallServiceW(char *name, wchar_t *title, wchar_t *description, wchar_t *path); |
---|
| 707 | bool MsUpdateServiceConfig(char *name); |
---|
| 708 | bool MsUninstallService(char *name); |
---|
| 709 | bool MsStartService(char *name); |
---|
| 710 | bool MsStartServiceEx(char *name, UINT *error_code); |
---|
| 711 | bool MsStopService(char *name); |
---|
| 712 | bool MsIsServiceRunning(char *name); |
---|
| 713 | bool MsIsTerminalServiceInstalled(); |
---|
| 714 | bool MsIsUserSwitchingInstalled(); |
---|
| 715 | bool MsIsTerminalServiceMultiUserInstalled(); |
---|
| 716 | UINT MsGetCurrentTerminalSessionId(); |
---|
| 717 | bool MsIsTerminalSessionActive(UINT session_id); |
---|
| 718 | bool MsIsCurrentTerminalSessionActive(); |
---|
| 719 | bool MsIsCurrentDesktopAvailableForVnc(); |
---|
| 720 | wchar_t *MsGetSessionUserName(UINT session_id); |
---|
| 721 | UINT MsService(char *name, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop, UINT icon); |
---|
| 722 | void MsTestModeW(wchar_t *title, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop); |
---|
| 723 | void MsTestMode(char *title, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop); |
---|
| 724 | void MsServiceMode(SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop); |
---|
| 725 | void MsUserModeW(wchar_t *title, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop, UINT icon); |
---|
| 726 | void MsUserMode(char *title, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop, UINT icon); |
---|
| 727 | bool MsIsUserMode(); |
---|
| 728 | void MsTestOnly(); |
---|
| 729 | void MsStopUserModeFromService(); |
---|
| 730 | char *MsGetPenCoreDllFileName(); |
---|
| 731 | void MsPlaySound(char *name); |
---|
| 732 | void MsSetThreadSingleCpu(); |
---|
| 733 | void MsWin9xTest(); |
---|
| 734 | bool MsCheckVLanDeviceIdFromRootEnum(char *name); |
---|
| 735 | bool MsInstallVLan9x(char *instance_name); |
---|
| 736 | void MsUpdateCompatibleIDs(char *instance_name); |
---|
| 737 | LIST *MsGetProcessList(); |
---|
| 738 | LIST *MsGetProcessList9x(); |
---|
| 739 | LIST *MsGetProcessListNt(); |
---|
| 740 | void MsFreeProcessList(LIST *o); |
---|
| 741 | void MsPrintProcessList(LIST *o); |
---|
| 742 | int MsCompareProcessList(void *p1, void *p2); |
---|
| 743 | MS_PROCESS *MsSearchProcessById(LIST *o, UINT id); |
---|
| 744 | void MsGetCurrentProcessExeName(char *name, UINT size); |
---|
| 745 | void MsGetCurrentProcessExeNameW(wchar_t *name, UINT size); |
---|
| 746 | bool MsKillProcess(UINT id); |
---|
| 747 | void MsKillOtherInstance(); |
---|
| 748 | void MsKillOtherInstanceEx(char *exclude_svcname); |
---|
| 749 | bool MsGetShortPathNameA(char *long_path, char *short_path, UINT short_path_size); |
---|
| 750 | bool MsGetShortPathNameW(wchar_t *long_path, wchar_t *short_path, UINT short_path_size); |
---|
| 751 | void MsWriteCallingServiceManagerProcessId(char *svcname, UINT pid); |
---|
| 752 | UINT MsReadCallingServiceManagerProcessId(char *svcname, bool current_user); |
---|
| 753 | |
---|
| 754 | |
---|
| 755 | MS_ADAPTER_LIST *MsCreateAdapterListInner(); |
---|
| 756 | MS_ADAPTER_LIST *MsCreateAdapterListInnerEx(bool no_info); |
---|
| 757 | void MsFreeAdapter(MS_ADAPTER *a); |
---|
| 758 | void MsFreeAdapterList(MS_ADAPTER_LIST *o); |
---|
| 759 | wchar_t *MsGetAdapterTypeStr(UINT type); |
---|
| 760 | wchar_t *MsGetAdapterStatusStr(UINT status); |
---|
| 761 | MS_ADAPTER *MsCloneAdapter(MS_ADAPTER *a); |
---|
| 762 | MS_ADAPTER_LIST *MsCloneAdapterList(MS_ADAPTER_LIST *o); |
---|
| 763 | void MsInitAdapterListModule(); |
---|
| 764 | void MsFreeAdapterListModule(); |
---|
| 765 | MS_ADAPTER_LIST *MsCreateAdapterList(); |
---|
| 766 | MS_ADAPTER_LIST *MsCreateAdapterListEx(bool no_info); |
---|
| 767 | void MsGetAdapterTcpIpInformation(MS_ADAPTER *a); |
---|
| 768 | MS_ADAPTER *MsGetAdapter(char *title); |
---|
| 769 | |
---|
| 770 | void *MsLoadLibrary(char *name); |
---|
| 771 | void *MsLoadLibraryW(wchar_t *name); |
---|
| 772 | void *MsLoadLibraryAsDataFile(char *name); |
---|
| 773 | void *MsLoadLibraryAsDataFileW(wchar_t *name); |
---|
| 774 | |
---|
| 775 | void MsPrintTick(); |
---|
| 776 | bool MsDisableIme(); |
---|
| 777 | |
---|
| 778 | void MsGetTcpConfig(MS_TCP *tcp); |
---|
| 779 | void MsSetTcpConfig(MS_TCP *tcp); |
---|
| 780 | void MsSaveTcpConfigReg(MS_TCP *tcp); |
---|
| 781 | bool MsLoadTcpConfigReg(MS_TCP *tcp); |
---|
| 782 | bool MsIsTcpConfigSupported(); |
---|
| 783 | void MsApplyTcpConfig(); |
---|
| 784 | bool MsIsShouldShowTcpConfigApp(); |
---|
| 785 | void MsDeleteTcpConfigReg(); |
---|
| 786 | |
---|
| 787 | UINT MsGetConsoleWidth(); |
---|
| 788 | UINT MsSetConsoleWidth(UINT size); |
---|
| 789 | NO_WARNING *MsInitNoWarning(); |
---|
| 790 | void MsFreeNoWarning(NO_WARNING *nw); |
---|
| 791 | void MsNoWarningThreadProc(THREAD *thread, void *param); |
---|
| 792 | char *MsNoWarningSoundInit(); |
---|
| 793 | void MsNoWarningSoundFree(char *s); |
---|
| 794 | bool MsCloseWarningWindow(UINT thread_id); |
---|
| 795 | LIST *MsEnumChildWindows(LIST *o, HWND hWnd); |
---|
| 796 | void MsAddWindowToList(LIST *o, HWND hWnd); |
---|
| 797 | UINT MsGetThreadLocale(); |
---|
| 798 | LIST *NewWindowList(); |
---|
| 799 | int CmpWindowList(void *p1, void *p2); |
---|
| 800 | void AddWindow(LIST *o, HWND hWnd); |
---|
| 801 | void FreeWindowList(LIST *o); |
---|
| 802 | LIST *EnumAllChildWindow(HWND hWnd); |
---|
| 803 | LIST *EnumAllChildWindowEx(HWND hWnd, bool no_recursion, bool include_ipcontrol, bool no_self); |
---|
| 804 | LIST *EnumAllWindow(); |
---|
| 805 | LIST *EnumAllWindowEx(bool no_recursion, bool include_ipcontrol); |
---|
| 806 | LIST *EnumAllTopWindow(); |
---|
| 807 | |
---|
| 808 | bool MsExecDriverInstaller(char *arg); |
---|
| 809 | bool MsIsVista(); |
---|
| 810 | bool MsIsWin2000(); |
---|
| 811 | bool MsIsWin2000OrGreater(); |
---|
| 812 | void MsRegistWindowsFirewall(char *title); |
---|
| 813 | void MsRegistWindowsFirewallEx(char *title, char *exe); |
---|
| 814 | void MsRegistWindowsFirewallEx2(char *title, char *exe); |
---|
| 815 | bool MsIs64BitWindows(); |
---|
| 816 | bool MsIsX64(); |
---|
| 817 | bool MsIsIA64(); |
---|
| 818 | void *MsDisableWow64FileSystemRedirection(); |
---|
| 819 | void MsRestoreWow64FileSystemRedirection(void *p); |
---|
| 820 | void MsSetWow64FileSystemRedirectionEnable(bool enable); |
---|
| 821 | |
---|
| 822 | bool MsCheckFileDigitalSignature(HWND hWnd, char *name, bool *danger); |
---|
| 823 | bool MsCheckFileDigitalSignatureW(HWND hWnd, wchar_t *name, bool *danger); |
---|
| 824 | |
---|
| 825 | bool MsGetProcessExeName(char *path, UINT size, UINT id); |
---|
| 826 | bool MsGetProcessExeNameW(wchar_t *path, UINT size, UINT id); |
---|
| 827 | bool MsGetWindowOwnerProcessExeName(char *path, UINT size, HWND hWnd); |
---|
| 828 | bool MsGetWindowOwnerProcessExeNameW(wchar_t *path, UINT size, HWND hWnd); |
---|
| 829 | |
---|
| 830 | void *MsRunAsUserEx(char *filename, char *arg, bool hide); |
---|
| 831 | void *MsRunAsUserExW(wchar_t *filename, wchar_t *arg, bool hide); |
---|
| 832 | void *MsRunAsUserExInner(char *filename, char *arg, bool hide); |
---|
| 833 | void *MsRunAsUserExInnerW(wchar_t *filename, wchar_t *arg, bool hide); |
---|
| 834 | |
---|
| 835 | UINT MsGetCursorPosHash(); |
---|
| 836 | bool MsIsProcessExists(char *exename); |
---|
| 837 | bool MsIsProcessExistsW(wchar_t *exename); |
---|
| 838 | |
---|
| 839 | void MsGetComputerName(char *name, UINT size); |
---|
| 840 | void MsNoSleepThread(THREAD *thread, void *param); |
---|
| 841 | void MsNoSleepThreadVista(THREAD *thread, void *param); |
---|
| 842 | UINT64 MsGetScreenSaverTimeout(); |
---|
| 843 | void *MsNoSleepStart(bool no_screensaver); |
---|
| 844 | void MsNoSleepEnd(void *p); |
---|
| 845 | bool MsIsRemoteDesktopAvailable(); |
---|
| 846 | bool MsIsRemoteDesktopCanEnableByRegistory(); |
---|
| 847 | bool MsIsRemoteDesktopEnabled(); |
---|
| 848 | bool MsEnableRemoteDesktop(); |
---|
| 849 | |
---|
| 850 | void MsSetFileToHidden(char *name); |
---|
| 851 | void MsSetFileToHiddenW(wchar_t *name); |
---|
| 852 | bool MsGetFileVersion(char *name, UINT *v1, UINT *v2, UINT *v3, UINT *v4); |
---|
| 853 | bool MsGetFileVersionW(wchar_t *name, UINT *v1, UINT *v2, UINT *v3, UINT *v4); |
---|
| 854 | |
---|
| 855 | bool MsExtractCabinetFileFromExe(char *exe, char *cab); |
---|
| 856 | bool MsExtractCabinetFileFromExeW(wchar_t *exe, wchar_t *cab); |
---|
| 857 | BUF *MsExtractResourceFromExe(char *exe, char *type, char *name); |
---|
| 858 | BUF *MsExtractResourceFromExeW(wchar_t *exe, char *type, char *name); |
---|
| 859 | bool MsExtractCab(char *cab_name, char *dest_dir_name); |
---|
| 860 | bool MsExtractCabW(wchar_t *cab_name, wchar_t *dest_dir_name); |
---|
| 861 | bool MsGetCabarcExeFilename(char *name, UINT size); |
---|
| 862 | bool MsGetCabarcExeFilenameW(wchar_t *name, UINT size); |
---|
| 863 | bool MsExtractCabFromMsi(char *msi, char *cab); |
---|
| 864 | bool MsExtractCabFromMsiW(wchar_t *msi, wchar_t *cab); |
---|
| 865 | bool MsIsDirectory(char *name); |
---|
| 866 | bool MsIsDirectoryW(wchar_t *name); |
---|
| 867 | bool MsUniIsDirectory(wchar_t *name); |
---|
| 868 | bool MsUniFileDelete(wchar_t *name); |
---|
| 869 | bool MsUniDirectoryDelete(wchar_t *name); |
---|
| 870 | bool MsUniMakeDir(wchar_t *name); |
---|
| 871 | void MsUniMakeDirEx(wchar_t *name); |
---|
| 872 | void MsMakeDirEx(char *name); |
---|
| 873 | bool MsMakeDir(char *name); |
---|
| 874 | bool MsDirectoryDelete(char *name); |
---|
| 875 | bool MsFileDelete(char *name); |
---|
| 876 | bool MsExecute(char *exe, char *arg); |
---|
| 877 | bool MsExecuteW(wchar_t *exe, wchar_t *arg); |
---|
| 878 | bool MsExecuteEx(char *exe, char *arg, void **process_handle); |
---|
| 879 | bool MsExecuteExW(wchar_t *exe, wchar_t *arg, void **process_handle); |
---|
| 880 | UINT MsWaitProcessExit(void *process_handle); |
---|
| 881 | bool MsIsFileLocked(char *name); |
---|
| 882 | bool MsIsFileLockedW(wchar_t *name); |
---|
| 883 | bool MsIsLocalDrive(char *name); |
---|
| 884 | bool MsIsLocalDriveW(wchar_t *name); |
---|
| 885 | void MsUpdateSystem(); |
---|
| 886 | bool MsGetPhysicalMacAddressFromNetbios(void *address); |
---|
| 887 | bool MsGetPhysicalMacAddressFromApi(void *address); |
---|
| 888 | bool MsGetPhysicalMacAddress(void *address); |
---|
| 889 | bool MsIsUseWelcomeLogin(); |
---|
| 890 | UINT64 MsGetHiResCounter(); |
---|
| 891 | double MsGetHiResTimeSpan(UINT64 diff); |
---|
| 892 | UINT64 MsGetHiResTimeSpanUSec(UINT64 diff); |
---|
| 893 | BUF *MsRegSubkeysToBuf(UINT root, char *keyname, bool force32bit, bool force64bit); |
---|
| 894 | void MsBufToRegSubkeys(UINT root, char *keyname, BUF *b, bool overwrite, bool force32bit, bool force64bit); |
---|
| 895 | void MsRegDeleteSubkeys(UINT root, char *keyname, bool force32bit, bool force64bit); |
---|
| 896 | void MsRestartMMCSS(); |
---|
| 897 | bool MsIsMMCSSNetworkThrottlingEnabled(); |
---|
| 898 | void MsSetMMCSSNetworkThrottlingEnable(bool enable); |
---|
| 899 | void MsSetShutdownParameters(UINT level, UINT flag); |
---|
| 900 | void MsChangeIconOnTrayEx2(void *icon, wchar_t *tooltip, wchar_t *info_title, wchar_t *info, UINT info_flags); |
---|
| 901 | bool MsIsTrayInited(); |
---|
| 902 | UINT MsGetClipboardOwnerProcessId(); |
---|
| 903 | void MsDeleteClipboard(); |
---|
| 904 | void *MsInitEventLog(wchar_t *src_name); |
---|
| 905 | void MsFreeEventLog(void *p); |
---|
| 906 | bool MsWriteEventLog(void *p, UINT type, wchar_t *str); |
---|
| 907 | bool MsIsWinXPOrWinVista(); |
---|
| 908 | bool MsGetFileInformation(void *h, void *info); |
---|
| 909 | void MsSetErrorModeToSilent(); |
---|
| 910 | void MsSetEnableMinidump(bool enabled); |
---|
| 911 | void MsWriteMinidump(wchar_t *filename, void *ex); |
---|
| 912 | |
---|
| 913 | // 内部関数 |
---|
| 914 | #ifdef MICROSOFT_C |
---|
| 915 | |
---|
| 916 | LONG CALLBACK MsExceptionHandler(struct _EXCEPTION_POINTERS *ExceptionInfo); |
---|
| 917 | HKEY MsGetRootKeyFromInt(UINT root); |
---|
| 918 | NT_API *MsLoadNtApiFunctions(); |
---|
| 919 | void MsFreeNtApiFunctions(NT_API *nt); |
---|
| 920 | void MsDestroyDevInfo(HDEVINFO info); |
---|
| 921 | HDEVINFO MsGetDevInfoFromDeviceId(SP_DEVINFO_DATA *dev_info_data, char *device_id); |
---|
| 922 | bool MsStartDevice(HDEVINFO info, SP_DEVINFO_DATA *dev_info_data); |
---|
| 923 | bool MsStopDevice(HDEVINFO info, SP_DEVINFO_DATA *dev_info_data); |
---|
| 924 | bool MsDeleteDevice(HDEVINFO info, SP_DEVINFO_DATA *dev_info_data); |
---|
| 925 | bool MsIsDeviceRunning(HDEVINFO info, SP_DEVINFO_DATA *dev_info_data); |
---|
| 926 | void CALLBACK MsServiceDispatcher(DWORD argc, LPTSTR *argv); |
---|
| 927 | void CALLBACK MsServiceHandler(DWORD opcode); |
---|
| 928 | void MsServiceStoperThread(THREAD *t, void *p); |
---|
| 929 | void MsServiceStoperMainThread(THREAD *t, void *p); |
---|
| 930 | void MsServiceStarterMainThread(THREAD *t, void *p); |
---|
| 931 | LRESULT CALLBACK MsUserModeWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); |
---|
| 932 | void MsShowIconOnTray(HWND hWnd, HICON icon, wchar_t *tooltip, UINT msg); |
---|
| 933 | void MsRestoreIconOnTray(); |
---|
| 934 | void MsChangeIconOnTray(HICON icon, wchar_t *tooltip); |
---|
| 935 | void MsChangeIconOnTrayEx(HICON icon, wchar_t *tooltip, wchar_t *info_title, wchar_t *info, UINT info_flags); |
---|
| 936 | void MsHideIconOnTray(); |
---|
| 937 | void MsUserModeTrayMenu(HWND hWnd); |
---|
| 938 | bool MsAppendMenu(HMENU hMenu, UINT flags, UINT_PTR id, wchar_t *str); |
---|
| 939 | bool MsInsertMenu(HMENU hMenu, UINT pos, UINT flags, UINT_PTR id_new_item, wchar_t *lp_new_item); |
---|
| 940 | bool CALLBACK MsEnumChildWindowProc(HWND hWnd, LPARAM lParam); |
---|
| 941 | BOOL CALLBACK EnumTopWindowProc(HWND hWnd, LPARAM lParam); |
---|
| 942 | bool CALLBACK MsEnumThreadWindowProc(HWND hWnd, LPARAM lParam); |
---|
| 943 | HANDLE MsCreateUserToken(); |
---|
| 944 | SID *MsGetSidFromAccountName(char *name); |
---|
| 945 | void MsFreeSid(SID *sid); |
---|
| 946 | |
---|
| 947 | #endif // MICROSOFT_C |
---|
| 948 | |
---|
| 949 | #endif // MICROSOFT_H |
---|
| 950 | |
---|
| 951 | #endif // OS_WIN32 |
---|
| 952 | |
---|