- from win32/include/winapi: various .h The winapi header set cannot be complete no matter what. So lets have just the minimal set necessary to compile the examples. - remove CMake support (hard to keep up to date) - some other files Also, drop useless changes in win32/lib/(win)crt1.c
Unified · Split
| @@ -1 +0,0 @@ | |||
| 1 | language: c | ||
| @@ -1,293 +0,0 @@ | |||
| 1 | project(tcc C) | ||
| 2 | cmake_minimum_required(VERSION 2.6) | ||
| 3 | enable_testing() | ||
| 4 | |||
| 5 | # Detect native platform | ||
| 6 | if(WIN32) | ||
| 7 | set(BUILD_SHARED_LIBS ON) | ||
| 8 | if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM") | ||
| 9 | set(TCC_NATIVE_TARGET "WinCE") | ||
| 10 | elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| 11 | set(TCC_NATIVE_TARGET "Win64") | ||
| 12 | else() | ||
| 13 | set(TCC_NATIVE_TARGET "Win32") | ||
| 14 | endif() | ||
| 15 | else() | ||
| 16 | if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") | ||
| 17 | set(TCC_NATIVE_TARGET "ARM") | ||
| 18 | if(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv5") | ||
| 19 | set(TCC_ARM_VERSION_DEFAULT 5) | ||
| 20 | elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv6") | ||
| 21 | set(TCC_ARM_VERSION_DEFAULT 6) | ||
| 22 | elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv7") | ||
| 23 | set(TCC_ARM_VERSION_DEFAULT 7) | ||
| 24 | else() | ||
| 25 | set(TCC_ARM_VERSION_DEFAULT 4) | ||
| 26 | endif() | ||
| 27 | elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| 28 | set(TCC_NATIVE_TARGET "x86_64") | ||
| 29 | set(TCC_ARCH_DIR "x86_64-linux-gnu") | ||
| 30 | else() | ||
| 31 | set(TCC_NATIVE_TARGET "i386") | ||
| 32 | set(TCC_ARCH_DIR "i386-linux-gnu") | ||
| 33 | endif() | ||
| 34 | endif() | ||
| 35 | |||
| 36 | if(WIN32) | ||
| 37 | set(EXE_PATH ".") | ||
| 38 | set(TCC_LIB_PATH lib) | ||
| 39 | set(NATIVE_LIB_PATH) | ||
| 40 | set(DOC_PATH doc) | ||
| 41 | else() | ||
| 42 | set(EXE_PATH bin) | ||
| 43 | set(TCC_LIB_PATH lib/tcc) | ||
| 44 | set(NATIVE_LIB_PATH lib) | ||
| 45 | set(DOC_PATH share/doc/tcc) | ||
| 46 | endif() | ||
| 47 | |||
| 48 | if(NOT WIN32) | ||
| 49 | if(EXISTS /usr/lib/${TCC_ARCH_DIR}/crti.o) | ||
| 50 | set(CONFIG_LDDIR lib/${TCC_ARCH_DIR}) | ||
| 51 | set(CONFIG_MULTIARCHDIR ${TCC_ARCH_DIR}) | ||
| 52 | elseif(EXISTS /usr/lib64/crti.o) | ||
| 53 | set(CONFIG_LDDIR lib64) | ||
| 54 | endif() | ||
| 55 | endif() | ||
| 56 | |||
| 57 | # Use two variables to keep CMake configuration variable names consistent | ||
| 58 | set(TCC_BCHECK OFF CACHE BOOL "Enable bounds checking") | ||
| 59 | set(CONFIG_TCC_BCHECK ${TCC_BCHECK}) | ||
| 60 | set(TCC_ASSERT OFF CACHE BOOL "Enable assertions") | ||
| 61 | set(CONFIG_TCC_ASSERT ${TCC_ASSERT}) | ||
| 62 | |||
| 63 | set(TCC_BUILD_NATIVE ON CACHE BOOL "Build native compiler") | ||
| 64 | set(TCC_BUILD_I386 OFF CACHE BOOL "Build i386 cross compiler") | ||
| 65 | set(TCC_BUILD_X64 OFF CACHE BOOL "Build x86-64 cross compiler") | ||
| 66 | set(TCC_BUILD_WIN32 OFF CACHE BOOL "Build Windows i386 cross compiler") | ||
| 67 | set(TCC_BUILD_WIN64 OFF CACHE BOOL "Build Windows x86-64 cross compiler") | ||
| 68 | set(TCC_BUILD_WINCE OFF CACHE BOOL "Build Windows CE cross compiler") | ||
| 69 | set(TCC_BUILD_ARM_FPA OFF CACHE BOOL "Build arm-fpa cross compiler") | ||
| 70 | set(TCC_BUILD_ARM_FPA_LD OFF CACHE BOOL "Build arm-fpa-ld cross compiler") | ||
| 71 | set(TCC_BUILD_ARM_VFP OFF CACHE BOOL "Build arm-vfp cross compiler") | ||
| 72 | set(TCC_BUILD_ARM_EABI OFF CACHE BOOL "Build ARM EABI cross compiler") | ||
| 73 | set(TCC_BUILD_ARM_EABIHF OFF CACHE BOOL "Build ARM EABI hardware float cross compiler") | ||
| 74 | set(TCC_BUILD_ARM OFF CACHE BOOL "Build ARM cross compiler") | ||
| 75 | set(TCC_BUILD_C67 OFF CACHE BOOL "Build C67 cross compiler") | ||
| 76 | |||
| 77 | set(TCC_ARM_VERSION ${TCC_ARM_VERSION_DEFAULT} CACHE STRING "ARM target CPU version") | ||
| 78 | set_property(CACHE TCC_ARM_VERSION PROPERTY STRINGS 4 5 6 7) | ||
| 79 | |||
| 80 | if(WIN32) | ||
| 81 | set(CONFIG_TCCDIR ${CMAKE_INSTALL_PREFIX}) | ||
| 82 | else() | ||
| 83 | set(CONFIG_TCCDIR ${CMAKE_INSTALL_PREFIX}/lib/tcc) | ||
| 84 | endif() | ||
| 85 | |||
| 86 | file(STRINGS "VERSION" TCC_VERSION) | ||
| 87 | list(GET TCC_VERSION 0 TCC_VERSION) | ||
| 88 | include_directories(${CMAKE_BINARY_DIR}) | ||
| 89 | configure_file(config.h.in config.h) | ||
| 90 | configure_file(config.texi.in config.texi) | ||
| 91 | |||
| 92 | # Utility variables | ||
| 93 | set(I386_SOURCES i386-gen.c i386-asm.c i386-asm.h i386-tok.h) | ||
| 94 | set(X86_64_SOURCES x86_64-gen.c i386-asm.c x86_64-asm.h) | ||
| 95 | set(ARM_SOURCES arm_gen.c) | ||
| 96 | |||
| 97 | set(LIBTCC1_I386_SOURCES lib/alloca86.S lib/alloca86-bt.S) | ||
| 98 | set(LIBTCC1_WIN_SOURCES win32/lib/crt1.c win32/lib/wincrt1.c win32/lib/dllcrt1.c win32/lib/dllmain.c win32/lib/chkstk.S) | ||
| 99 | if(NOT WIN32) | ||
| 100 | set(LIBTCC1_I386_SOURCES ${LIBTCC1_I386_SOURCES} lib/bcheck.c) | ||
| 101 | endif() | ||
| 102 | |||
| 103 | if(WIN32) | ||
| 104 | add_executable(tiny_impdef win32/tools/tiny_impdef.c) | ||
| 105 | endif() | ||
| 106 | add_executable(tiny_libmaker_32 win32/tools/tiny_libmaker.c) | ||
| 107 | set_target_properties(tiny_libmaker_32 PROPERTIES COMPILE_DEFINITIONS TCC_TARGET_I386) | ||
| 108 | add_executable(tiny_libmaker_64 win32/tools/tiny_libmaker.c) | ||
| 109 | set_target_properties(tiny_libmaker_64 PROPERTIES COMPILE_DEFINITIONS TCC_TARGET_X86_64) | ||
| 110 | |||
| 111 | macro(make_libtcc1 prefix xcc xar defs includes sources) | ||
| 112 | set(libtcc1_prefix) | ||
| 113 | if("${prefix}" STRGREATER "") | ||
| 114 | set(libtcc1_prefix ${prefix}-) | ||
| 115 | endif() | ||
| 116 | set(libtcc1_flags -I${CMAKE_SOURCE_DIR}/include) | ||
| 117 | foreach(i ${defs}) | ||
| 118 | set(libtcc1_flags ${libtcc1_flags} -D${i}) | ||
| 119 | endforeach() | ||
| 120 | foreach(i ${includes}) | ||
| 121 | set(libtcc1_flags ${libtcc1_flags} -I${CMAKE_SOURCE_DIR}/${i}) | ||
| 122 | endforeach() | ||
| 123 | set(libtcc1_objects) | ||
| 124 | foreach(libtcc1_c lib/libtcc1.c ${sources}) | ||
| 125 | string(REGEX MATCH "[^/]+$" libtcc1_o ${libtcc1_c}) | ||
| 126 | string(REGEX MATCH "^[^.]+" libtcc1_o ${libtcc1_o}) | ||
| 127 | set(libtcc1_o ${libtcc1_prefix}${libtcc1_o}.o) | ||
| 128 | add_custom_command(OUTPUT ${libtcc1_o} | ||
| 129 | COMMAND ${xcc} ${libtcc1_flags} -c ${CMAKE_SOURCE_DIR}/${libtcc1_c} -o ${libtcc1_o} | ||
| 130 | DEPENDS ${xcc} ${CMAKE_SOURCE_DIR}/${libtcc1_c} | ||
| 131 | ) | ||
| 132 | list(APPEND libtcc1_objects ${libtcc1_o}) | ||
| 133 | endforeach() | ||
| 134 | add_custom_command(OUTPUT ${libtcc1_prefix}libtcc1.a | ||
| 135 | COMMAND ${xar} ${libtcc1_prefix}libtcc1.a ${libtcc1_objects} | ||
| 136 | DEPENDS ${xar} ${libtcc1_objects} | ||
| 137 | ) | ||
| 138 | add_custom_target(${libtcc1_prefix}libtcc1 ALL DEPENDS ${libtcc1_prefix}libtcc1.a) | ||
| 139 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${libtcc1_prefix}libtcc1.a | ||
| 140 | DESTINATION ${TCC_LIB_PATH}/${prefix} RENAME libtcc1.a) | ||
| 141 | endmacro() | ||
| 142 | |||
| 143 | macro(make_tcc native_name cross_name cross_enabled definitions tcc_sources libtcc_ar libtcc_sources libtcc_includes) | ||
| 144 | if (xx${native_name} STREQUAL xx${TCC_NATIVE_TARGET}) | ||
| 145 | set(TCC_NATIVE_DEFINITIONS ${definitions}) | ||
| 146 | if("${CONFIG_MULTIARCHDIR}" STRGREATER "") | ||
| 147 | set(TCC_NATIVE_DEFINITIONS ${TCC_NATIVE_DEFINITIONS} CONFIG_MULTIARCHDIR="${CONFIG_MULTIARCHDIR}") | ||
| 148 | endif() | ||
| 149 | if("${CONFIG_LDDIR}" STRGREATER "") | ||
| 150 | set(TCC_NATIVE_DEFINITIONS ${TCC_NATIVE_DEFINITIONS} CONFIG_LDDIR="${CONFIG_LDDIR}") | ||
| 151 | endif() | ||
| 152 | |||
| 153 | set(TCC_NATIVE_FLAGS) | ||
| 154 | foreach(make_tcc_def ${TCC_NATIVE_DEFINITIONS}) | ||
| 155 | set(TCC_NATIVE_FLAGS ${TCC_NATIVE_FLAGS} -D${make_tcc_def}) | ||
| 156 | endforeach() | ||
| 157 | |||
| 158 | if (TCC_BUILD_NATIVE) | ||
| 159 | add_library(libtcc | ||
| 160 | libtcc.c | ||
| 161 | tccpp.c | ||
| 162 | tccgen.c | ||
| 163 | tccelf.c | ||
| 164 | tccasm.c | ||
| 165 | tccrun.c | ||
| 166 | tcc.h | ||
| 167 | libtcc.h | ||
| 168 | tcctok.h | ||
| 169 | ${tcc_sources} | ||
| 170 | ) | ||
| 171 | set_target_properties(libtcc PROPERTIES OUTPUT_NAME tcc PREFIX lib) | ||
| 172 | if(WIN32) | ||
| 173 | set_target_properties(libtcc PROPERTIES LINK_FLAGS "-Wl,--output-def,libtcc.def") | ||
| 174 | endif() | ||
| 175 | add_executable(tcc tcc.c) | ||
| 176 | target_link_libraries(tcc libtcc) | ||
| 177 | if(NOT WIN32) | ||
| 178 | target_link_libraries(tcc dl) | ||
| 179 | endif() | ||
| 180 | install(TARGETS tcc libtcc RUNTIME DESTINATION ${EXE_PATH} LIBRARY DESTINATION ${NATIVE_LIB_PATH} ARCHIVE DESTINATION ${NATIVE_LIB_PATH}) | ||
| 181 | set_target_properties(tcc libtcc PROPERTIES COMPILE_DEFINITIONS "${TCC_NATIVE_DEFINITIONS}") | ||
| 182 | |||
| 183 | if("${libtcc_sources}" STRGREATER "") | ||
| 184 | make_libtcc1("" tcc "${libtcc_ar}" "${TCC_NATIVE_DEFINITIONS}" "${libtcc_includes}" "${libtcc_sources}") | ||
| 185 | endif() | ||
| 186 | endif() | ||
| 187 | elseif(${cross_enabled}) | ||
| 188 | add_executable(${cross_name}-tcc tcc.c) | ||
| 189 | set_target_properties(${cross_name}-tcc PROPERTIES COMPILE_DEFINITIONS "ONE_SOURCE;${definitions}") | ||
| 190 | install(TARGETS ${cross_name}-tcc RUNTIME DESTINATION ${EXE_PATH}) | ||
| 191 | |||
| 192 | if("${libtcc_sources}" STRGREATER "") | ||
| 193 | make_libtcc1(${cross_name} "${cross_name}-tcc" "${libtcc_ar}" "${definitions}" "${libtcc_includes}" "${libtcc_sources}") | ||
| 194 | endif() | ||
| 195 | endif() | ||
| 196 | endmacro() | ||
| 197 | |||
| 198 | make_tcc("Win32" i386-w64-mingw32 TCC_BUILD_WIN32 | ||
| 199 | "TCC_TARGET_I386;TCC_TARGET_PE" | ||
| 200 | "${I386_SOURCES};tccpe.c" | ||
| 201 | tiny_libmaker_32 "${LIBTCC1_I386_SOURCES};${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi" | ||
| 202 | ) | ||
| 203 | make_tcc("Win64" x86_64-w64-mingw32 TCC_BUILD_WIN64 | ||
| 204 | "TCC_TARGET_X86_64;TCC_TARGET_PE" | ||
| 205 | "${X86_64_SOURCES};tccpe.c" | ||
| 206 | tiny_libmaker_64 "lib/alloca86_64.S;${LIBTCC1_WIN_SOURCES}" "win32/include;win32/include/winapi" | ||
| 207 | ) | ||
| 208 | make_tcc("WinCE" arm-wince-mingw32ce TCC_BUILD_WINCE | ||
| 209 | "TCC_TARGET_ARM;TCC_ARM_VERSION=${TCC_ARM_VERSION};TCC_TARGET_PE" | ||
| 210 | "${ARM_SOURCES};tccpe.c" | ||
| 211 | "" "" "" | ||
| 212 | ) | ||
| 213 | make_tcc("i386" i386-linux-gnu TCC_BUILD_I386 | ||
| 214 | TCC_TARGET_I386 | ||
| 215 | "${I386_SOURCES}" | ||
| 216 | tiny_libmaker_32 "${LIBTCC1_I386_SOURCES}" "" | ||
| 217 | ) | ||
| 218 | make_tcc("x86_64" x86_64-linux-gnu TCC_BUILD_X64 | ||
| 219 | TCC_TARGET_X86_64 | ||
| 220 | "${X86_64_SOURCES}" | ||
| 221 | tiny_libmaker_64 "lib/alloca86_64.S" "" | ||
| 222 | ) | ||
| 223 | set(ARM_DEFINITIONS TCC_TARGET_ARM TCC_ARM_VERSION=${TCC_ARM_VERSION}) | ||
| 224 | make_tcc("" arm-linux-gnueabihf TCC_BUILD_ARM_EABIHF | ||
| 225 | "${ARM_DEFINITIONS};TCC_ARM_EABI;TCC_ARM_HARDFLOAT" | ||
| 226 | "${ARM_SOURCES}" | ||
| 227 | "" "" "" | ||
| 228 | ) | ||
| 229 | make_tcc("" arm-linux-gnueabi TCC_BUILD_ARM_EABI | ||
| 230 | "${ARM_DEFINITIONS};TCC_ARM_EABI" | ||
| 231 | "${ARM_SOURCES}" | ||
| 232 | "" "" "" | ||
| 233 | ) | ||
| 234 | make_tcc("" arm-linux-fpa TCC_BUILD_ARM_FPA | ||
| 235 | "${ARM_DEFINITIONS}" | ||
| 236 | "${ARM_SOURCES}" | ||
| 237 | "" "" "" | ||
| 238 | ) | ||
| 239 | make_tcc("" arm-linux-fpa-ld TCC_BUILD_ARM_FPA_LD | ||
| 240 | "${ARM_DEFINITIONS};LDOUBLE_SIZE=12" | ||
| 241 | "${ARM_SOURCES}" | ||
| 242 | "" "" "" | ||
| 243 | ) | ||
| 244 | make_tcc("" arm-linux-gnu TCC_BUILD_ARM_VFP | ||
| 245 | "${ARM_DEFINITIONS};TCC_ARM_VFP" | ||
| 246 | "${ARM_SOURCES}" | ||
| 247 | "" "" "" | ||
| 248 | ) | ||
| 249 | make_tcc("" c67 TCC_BUILD_C67 | ||
| 250 | TCC_TARGET_C67 | ||
| 251 | "c67-gen.c;tcccoff.c" | ||
| 252 | "" "" "" | ||
| 253 | ) | ||
| 254 | |||
| 255 | add_subdirectory(tests) | ||
| 256 | |||
| 257 | find_program(MAKEINFO NAMES makeinfo PATHS C:/MinGW/MSYS/1.0/bin) | ||
| 258 | if(MAKEINFO) | ||
| 259 | add_custom_command(OUTPUT tcc-doc.html | ||
| 260 | COMMAND ${MAKEINFO} --no-split --html -o tcc-doc.html ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi | ||
| 261 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi | ||
| 262 | ) | ||
| 263 | set(TCC_DOC_FILES tcc-doc.html) | ||
| 264 | if(NOT WIN32) | ||
| 265 | add_custom_command(OUTPUT tcc-doc.info | ||
| 266 | COMMAND ${MAKEINFO} -o tcc-doc.info ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi | ||
| 267 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tcc-doc.texi | ||
| 268 | ) | ||
| 269 | set(TCC_DOC_FILES ${TCC_DOC_FILES} tcc-doc.info) | ||
| 270 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcc-doc.info DESTINATION share/info) | ||
| 271 | endif() | ||
| 272 | add_custom_target(tcc-doc ALL DEPENDS ${TCC_DOC_FILES}) | ||
| 273 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcc-doc.html DESTINATION ${DOC_PATH}) | ||
| 274 | endif() | ||
| 275 | |||
| 276 | if(WIN32) | ||
| 277 | file(GLOB WIN32_DEFS win32/lib/*.def) | ||
| 278 | install(FILES ${WIN32_DEFS} DESTINATION lib) | ||
| 279 | install(FILES tcclib.h DESTINATION include) | ||
| 280 | install(DIRECTORY include/ DESTINATION include) | ||
| 281 | install(DIRECTORY win32/include/ DESTINATION include) | ||
| 282 | install(DIRECTORY win32/examples/ DESTINATION examples) | ||
| 283 | install(FILES win32/tcc-win32.txt DESTINATION doc) | ||
| 284 | install(FILES ${CMAKE_BINARY_DIR}/libtcc.def DESTINATION libtcc) | ||
| 285 | install(FILES ${CMAKE_BINARY_DIR}/libtcc.dll.a DESTINATION libtcc RENAME libtcc.a) | ||
| 286 | install(FILES libtcc.h DESTINATION libtcc) | ||
| 287 | else() | ||
| 288 | install(FILES libtcc.h tcclib.h DESTINATION include) | ||
| 289 | install(DIRECTORY include/ DESTINATION lib/tcc/include) | ||
| 290 | install(DIRECTORY win32/include/ DESTINATION lib/tcc/win32/include) | ||
| 291 | install(DIRECTORY include/ DESTINATION lib/tcc/win32/include) | ||
| 292 | endif() | ||
| 293 | |||
| @@ -1,125 +0,0 @@ | |||
| 1 | **TinyCC** (or tcc) is short for Tiny C Compiler. | ||
| 2 | |||
| 3 | This a clone of the mob development repo at http://repo.or.cz/tinycc.git | ||
| 4 | |||
| 5 | |Branch |Status | | ||
| 6 | |------------|---------| | ||
| 7 | |mob | [](https://travis-ci.org/wqweto/tinycc) | | ||
| 8 | |dev | [](https://travis-ci.org/wqweto/tinycc) | | ||
| 9 | |||
| 10 | ### License | ||
| 11 | |||
| 12 | Tiny C Compiler project is licensed under [LGPL](https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License) but currently there is an effort to relicense the project under [MIT License](https://en.wikipedia.org/wiki/MIT_License). See RELICENSING file in root for current status. | ||
| 13 | |||
| 14 | ### Branch Policy | ||
| 15 | |||
| 16 | The "dev" branch is the one where all contributions will be merged before reaching "mob". If you plan to propose a patch, please commit into the "dev" branch or its own feature branch. Direct commit to "mob" are not permitted. | ||
| 17 | |||
| 18 | ### Original Fabrice Bellard readme | ||
| 19 | |||
| 20 | ``` | ||
| 21 | Tiny C Compiler - C Scripting Everywhere - The Smallest ANSI C compiler | ||
| 22 | ----------------------------------------------------------------------- | ||
| 23 | |||
| 24 | Features: | ||
| 25 | -------- | ||
| 26 | |||
| 27 | - SMALL! You can compile and execute C code everywhere, for example on | ||
| 28 | rescue disks. | ||
| 29 | |||
| 30 | - FAST! tcc generates optimized x86 code. No byte code | ||
| 31 | overhead. Compile, assemble and link about 7 times faster than 'gcc | ||
| 32 | -O0'. | ||
| 33 | |||
| 34 | - UNLIMITED! Any C dynamic library can be used directly. TCC is | ||
| 35 | heading torward full ISOC99 compliance. TCC can of course compile | ||
| 36 | itself. | ||
| 37 | |||
| 38 | - SAFE! tcc includes an optional memory and bound checker. Bound | ||
| 39 | checked code can be mixed freely with standard code. | ||
| 40 | |||
| 41 | - Compile and execute C source directly. No linking or assembly | ||
| 42 | necessary. Full C preprocessor included. | ||
| 43 | |||
| 44 | - C script supported : just add '#!/usr/local/bin/tcc -run' at the first | ||
| 45 | line of your C source, and execute it directly from the command | ||
| 46 | line. | ||
| 47 | |||
| 48 | Documentation: | ||
| 49 | ------------- | ||
| 50 | |||
| 51 | 1) Installation on a i386/x86_64/arm Linux/OSX/FreeBSD host (for Windows read tcc-win32.txt) | ||
| 52 | |||
| 53 | Note: For OSX and FreeBSD, gmake should be used instead of make. | ||
| 54 | |||
| 55 | ./configure | ||
| 56 | make | ||
| 57 | make test | ||
| 58 | make install | ||
| 59 | |||
| 60 | Alternatively, out-of-tree builds are supported: you may use different | ||
| 61 | directories to hold build objects, kept separate from your source tree: | ||
| 62 | |||
| 63 | mkdir _build | ||
| 64 | cd _build | ||
| 65 | ../configure | ||
| 66 | make | ||
| 67 | make test | ||
| 68 | make install | ||
| 69 | |||
| 70 | Texi2html must be installed to compile the doc. | ||
| 71 | By default, tcc is installed in /usr/local/bin. | ||
| 72 | ./configure --help shows configuration options. | ||
| 73 | |||
| 74 | |||
| 75 | 2) Introduction | ||
| 76 | |||
| 77 | We assume here that you know ANSI C. Look at the example ex1.c to know | ||
| 78 | what the programs look like. | ||
| 79 | |||
| 80 | The include file <tcclib.h> can be used if you want a small basic libc | ||
| 81 | include support (especially useful for floppy disks). Of course, you | ||
| 82 | can also use standard headers, although they are slower to compile. | ||
| 83 | |||
| 84 | You can begin your C script with '#!/usr/local/bin/tcc -run' on the first | ||
| 85 | line and set its execute bits (chmod a+x your_script). Then, you can | ||
| 86 | launch the C code as a shell or perl script :-) The command line | ||
| 87 | arguments are put in 'argc' and 'argv' of the main functions, as in | ||
| 88 | ANSI C. | ||
| 89 | |||
| 90 | 3) Examples | ||
| 91 | |||
| 92 | ex1.c: simplest example (hello world). Can also be launched directly | ||
| 93 | as a script: './ex1.c'. | ||
| 94 | |||
| 95 | ex2.c: more complicated example: find a number with the four | ||
| 96 | operations given a list of numbers (benchmark). | ||
| 97 | |||
| 98 | ex3.c: compute fibonacci numbers (benchmark). | ||
| 99 | |||
| 100 | ex4.c: more complicated: X11 program. Very complicated test in fact | ||
| 101 | because standard headers are being used ! As for ex1.c, can also be launched | ||
| 102 | directly as a script: './ex4.c'. | ||
| 103 | |||
| 104 | ex5.c: 'hello world' with standard glibc headers. | ||
| 105 | |||
| 106 | tcc.c: TCC can of course compile itself. Used to check the code | ||
| 107 | generator. | ||
| 108 | |||
| 109 | tcctest.c: auto test for TCC which tests many subtle possible bugs. Used | ||
| 110 | when doing 'make test'. | ||
| 111 | |||
| 112 | 4) Full Documentation | ||
| 113 | |||
| 114 | Please read tcc-doc.html to have all the features of TCC. | ||
| 115 | |||
| 116 | Additional information is available for the Windows port in tcc-win32.txt. | ||
| 117 | |||
| 118 | License: | ||
| 119 | ------- | ||
| 120 | |||
| 121 | TCC is distributed under the GNU Lesser General Public License (see | ||
| 122 | COPYING file). | ||
| 123 | |||
| 124 | Fabrice Bellard. | ||
| 125 | ``` | ||
| @@ -1,7 +0,0 @@ | |||
| 1 | #define CONFIG_TCCDIR "${CONFIG_TCCDIR}" | ||
| 2 | #define TCC_VERSION "${TCC_VERSION}" | ||
| 3 | |||
| 4 | #cmakedefine CONFIG_WIN32 | ||
| 5 | #cmakedefine CONFIG_WIN64 | ||
| 6 | #cmakedefine CONFIG_TCC_BCHECK | ||
| 7 | #cmakedefine CONFIG_TCC_ASSERT | ||
| @@ -1 +0,0 @@ | |||
| 1 | @set VERSION ${TCC_VERSION} | ||
| @@ -1,138 +0,0 @@ | |||
| 1 | include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) | ||
| 2 | |||
| 3 | set(TCC_CFLAGS -I${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/include -B${CMAKE_BINARY_DIR}) | ||
| 4 | if(WIN32) | ||
| 5 | set(TCC_CFLAGS ${TCC_CFLAGS} -I${CMAKE_SOURCE_DIR}/win32/include) | ||
| 6 | else() | ||
| 7 | set(TCC_MATH_LDFLAGS -lm) | ||
| 8 | set(LIBTCC_EXTRA_LIBS dl) | ||
| 9 | set(LIBTCC_LDFLAGS -ldl -lm -Wl,-rpath=${CMAKE_BINARY_DIR}) | ||
| 10 | endif() | ||
| 11 | |||
| 12 | add_executable(abitest-cc abitest.c) | ||
| 13 | target_link_libraries(abitest-cc libtcc ${LIBTCC_EXTRA_LIBS}) | ||
| 14 | add_test(NAME abitest-cc WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND abitest-cc lib_path=${CMAKE_BINARY_DIR} include=${CMAKE_SOURCE_DIR}/include) | ||
| 15 | |||
| 16 | set(ABITEST_TCC abitest-tcc${CMAKE_EXECUTABLE_SUFFIX}) | ||
| 17 | get_property(LIBTCC_LIB TARGET libtcc PROPERTY LOCATION) | ||
| 18 | add_custom_command(OUTPUT ${ABITEST_TCC} COMMAND tcc ${TCC_CFLAGS} -g ${CMAKE_CURRENT_SOURCE_DIR}/abitest.c ${LIBTCC_LDFLAGS} ${LIBTCC_LIB} -o ${ABITEST_TCC} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/abitest.c) | ||
| 19 | add_custom_target(abitest-tcc-exe ALL DEPENDS ${ABITEST_TCC}) | ||
| 20 | |||
| 21 | add_test(NAME abitest-tcc WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${ABITEST_TCC} lib_path=${CMAKE_BINARY_DIR} include=${CMAKE_SOURCE_DIR}/include) | ||
| 22 | |||
| 23 | set(VLA_TEST vla_test${CMAKE_EXECUTABLE_SUFFIX}) | ||
| 24 | add_custom_command(OUTPUT ${VLA_TEST} COMMAND tcc ${TCC_CFLAGS} -g ${CMAKE_CURRENT_SOURCE_DIR}/vla_test.c -o ${VLA_TEST} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/vla_test.c) | ||
| 25 | add_custom_target(vla_test-exe ALL DEPENDS ${VLA_TEST}) | ||
| 26 | add_test(vla_test vla_test) | ||
| 27 | |||
| 28 | add_executable(tcctest-cc tcctest.c) | ||
| 29 | target_link_libraries(tcctest-cc libtcc) | ||
| 30 | set_target_properties(tcctest-cc PROPERTIES COMPILE_FLAGS -std=gnu99) | ||
| 31 | |||
| 32 | find_package(PythonInterp) | ||
| 33 | if(PYTHONINTERP_FOUND) | ||
| 34 | set(TCC_TEST_CFLAGS ${TCC_CFLAGS} -B${CMAKE_BINARY_DIR} -I${CMAKE_BINARY_DIR}) | ||
| 35 | if(WIN32) | ||
| 36 | set(TCC_TEST_CFLAGS ${TCC_TEST_CFLAGS} -I${CMAKE_SOURCE_DIR}/win32/include/winapi) | ||
| 37 | endif() | ||
| 38 | set(TCC_TEST_SOURCE ${TCC_TEST_CFLAGS} ${TCC_MATH_LDFLAGS} -run ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c) | ||
| 39 | set(TCC_TEST_RUN ${TCC_TEST_CFLAGS} ${TCC_NATIVE_FLAGS} -DONE_SOURCE -run ${CMAKE_SOURCE_DIR}/tcc.c) | ||
| 40 | get_property(TCC TARGET tcc PROPERTY LOCATION) | ||
| 41 | get_property(TCCTESTCC TARGET tcctest-cc PROPERTY LOCATION) | ||
| 42 | set(TCCTEST_PY ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.py ${TCCTESTCC}) | ||
| 43 | add_test(test1 ${TCCTEST_PY} ${TCC} ${TCC_TEST_SOURCE}) | ||
| 44 | add_test(test2 ${TCCTEST_PY} ${TCC} ${TCC_TEST_RUN} ${TCC_TEST_SOURCE}) | ||
| 45 | add_test(test3 ${TCCTEST_PY} ${TCC} ${TCC_TEST_RUN} ${TCC_TEST_RUN} ${TCC_TEST_SOURCE}) | ||
| 46 | |||
| 47 | # Object + link output | ||
| 48 | set(TEST4 test4${CMAKE_EXECUTABLE_SUFFIX}) | ||
| 49 | add_custom_command(OUTPUT test4.o COMMAND tcc ${TCC_TEST_CFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c -c -o test4.o DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c) | ||
| 50 | add_custom_command(OUTPUT ${TEST4} COMMAND tcc ${TCC_TEST_CFLAGS} test4.o -o ${TEST4} DEPENDS tcc test4.o) | ||
| 51 | add_custom_target(test4-exe ALL DEPENDS ${TEST4}) | ||
| 52 | add_test(test4 ${TCCTEST_PY} ${CMAKE_CURRENT_BINARY_DIR}/${TEST4}) | ||
| 53 | |||
| 54 | # Dynamic output | ||
| 55 | set(TEST5 test5${CMAKE_EXECUTABLE_SUFFIX}) | ||
| 56 | add_custom_command(OUTPUT ${TEST5} COMMAND tcc ${TCC_TEST_CFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c -o ${TEST5} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c) | ||
| 57 | add_custom_target(test5-exe ALL DEPENDS ${TEST5}) | ||
| 58 | add_test(test5 ${TCCTEST_PY} ${CMAKE_CURRENT_BINARY_DIR}/${TEST5}) | ||
| 59 | |||
| 60 | if(TCC_BCHECK) | ||
| 61 | # Dynamic output + bound check | ||
| 62 | set(TEST6 test6${CMAKE_EXECUTABLE_SUFFIX}) | ||
| 63 | add_custom_command(OUTPUT ${TEST6} COMMAND tcc ${TCC_TEST_CFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c -b -o ${TEST6} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c) | ||
| 64 | add_custom_target(test6-exe ALL DEPENDS ${TEST6}) | ||
| 65 | add_test(test6 ${TCCTEST_PY} ${CMAKE_CURRENT_BINARY_DIR}/${TEST6}) | ||
| 66 | endif() | ||
| 67 | |||
| 68 | if(0) | ||
| 69 | # Static output | ||
| 70 | set(TEST7 test7${CMAKE_EXECUTABLE_SUFFIX}) | ||
| 71 | add_custom_command(OUTPUT ${TEST7} COMMAND tcc ${TCC_TEST_CFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c -static -o ${TEST7} DEPENDS tcc ${CMAKE_CURRENT_SOURCE_DIR}/tcctest.c) | ||
| 72 | add_custom_target(test7-exe ALL DEPENDS ${TEST7}) | ||
| 73 | add_test(test7 ${TCCTEST_PY} ${CMAKE_CURRENT_BINARY_DIR}/${TEST7}) | ||
| 74 | endif() | ||
| 75 | endif() | ||
| 76 | |||
| 77 | set(MORETESTS | ||
| 78 | 00_assignment | ||
| 79 | 01_comment | ||
| 80 | 02_printf | ||
| 81 | 03_struct | ||
| 82 | 04_for | ||
| 83 | 05_array | ||
| 84 | 06_case | ||
| 85 | 07_function | ||
| 86 | 08_while | ||
| 87 | 09_do_while | ||
| 88 | 10_pointer | ||
| 89 | 11_precedence | ||
| 90 | 12_hashdefine | ||
| 91 | 13_integer_literals | ||
| 92 | 14_if | ||
| 93 | 15_recursion | ||
| 94 | 16_nesting | ||
| 95 | 17_enum | ||
| 96 | 18_include | ||
| 97 | 19_pointer_arithmetic | ||
| 98 | 20_pointer_comparison | ||
| 99 | 21_char_array | ||
| 100 | 22_floating_point | ||
| 101 | 23_type_coercion | ||
| 102 | 24_math_library | ||
| 103 | 25_quicksort | ||
| 104 | 26_character_constants | ||
| 105 | 27_sizeof | ||
| 106 | 28_strings | ||
| 107 | 29_array_address | ||
| 108 | 31_args | ||
| 109 | 32_led | ||
| 110 | 33_ternary_op | ||
| 111 | 35_sizeof | ||
| 112 | 36_array_initialisers | ||
| 113 | 37_sprintf | ||
| 114 | 38_multiple_array_index | ||
| 115 | 39_typedef | ||
| 116 | 40_stdio | ||
| 117 | 41_hashif | ||
| 118 | 42_function_pointer | ||
| 119 | 43_void_param | ||
| 120 | 44_scoped_declarations | ||
| 121 | 45_empty_for | ||
| 122 | 47_switch_return | ||
| 123 | 48_nested_break | ||
| 124 | 49_bracket_evaluation | ||
| 125 | 50_logical_second_arg | ||
| 126 | 51_static | ||
| 127 | 52_unnamed_enum | ||
| 128 | 54_goto | ||
| 129 | 55_lshift_type | ||
| 130 | ) | ||
| 131 | if(WIN32) | ||
| 132 | list(REMOVE_ITEM MORETESTS 24_math_library) | ||
| 133 | list(REMOVE_ITEM MORETESTS 28_strings) | ||
| 134 | endif() | ||
| 135 | foreach(testfile ${MORETESTS}) | ||
| 136 | add_test(NAME ${testfile} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests2 | ||
| 137 | COMMAND tcc ${TCC_CFLAGS} ${TCC_MATH_LDFLAGS} -run ${testfile}.c - arg1 arg2 arg3 arg4 | ${DIFF} - ${testfile}.expect) | ||
| 138 | endforeach() | ||
File renamed without changes.
| @@ -1,22 +0,0 @@ | |||
| 1 | @echo off | ||
| 2 | |||
| 3 | @rem Compute 10th Fibonacci number | ||
| 4 | tcc fib.c | ||
| 5 | fib 10 | ||
| 6 | del fib.exe | ||
| 7 | |||
| 8 | @rem hello_win.c | ||
| 9 | tcc hello_win.c | ||
| 10 | hello_win | ||
| 11 | del hello_win.exe | ||
| 12 | |||
| 13 | @rem 'Hello DLL' example | ||
| 14 | tcc -shared dll.c | ||
| 15 | tcc hello_dll.c dll.def | ||
| 16 | hello_dll | ||
| 17 | del hello_dll.exe dll.def dll.dll | ||
| 18 | |||
| 19 | @rem a console threaded program | ||
| 20 | tcc taxi_simulator.c | ||
| 21 | taxi_simulator | ||
| 22 | del taxi_simulator.exe | ||
| @@ -1,948 +0,0 @@ | |||
| 1 | /* A Windows console program: taxi and passengers simulator */ | ||
| 2 | |||
| 3 | #include <windows.h> | ||
| 4 | #include <wincon.h> | ||
| 5 | #include <stdio.h> | ||
| 6 | #include <conio.h> | ||
| 7 | #include <stdlib.h> | ||
| 8 | #include <time.h> | ||
| 9 | |||
| 10 | void init_scr(); | ||
| 11 | void restore_scr(); | ||
| 12 | void clrscr(); | ||
| 13 | void write_console(const char *msg, DWORD len, COORD coords, DWORD attr); | ||
| 14 | |||
| 15 | int add_br (int n, int addon); | ||
| 16 | |||
| 17 | DWORD WINAPI Si1 (LPVOID parm); // a passengers thread | ||
| 18 | DWORD WINAPI Si2 (LPVOID parm); | ||
| 19 | DWORD WINAPI Si3 (LPVOID parm); | ||
| 20 | DWORD WINAPI Si4 (LPVOID parm); | ||
| 21 | DWORD WINAPI Taxi (LPVOID parm); // a taxi thread | ||
| 22 | |||
| 23 | HANDLE hstdout; | ||
| 24 | HANDLE hproc[5], htaxi, hproc2[5], hproc3[5], hproc4[5], ht2; | ||
| 25 | |||
| 26 | HANDLE hs_br; // a semaphor for br[] | ||
| 27 | HANDLE hs_wc; // a semaphor for write_console() | ||
| 28 | HANDLE hs_ds; // a semaphor for draw_statistics() | ||
| 29 | HANDLE hs_st; // a semaphor for draw_station() | ||
| 30 | |||
| 31 | int br[5]; // a number of the passengers on the taxi stations | ||
| 32 | int w; // a number of the passengers on the taxi, used in taxi() | ||
| 33 | |||
| 34 | DWORD si_attr = FOREGROUND_GREEN | FOREGROUND_INTENSITY; | ||
| 35 | DWORD st_attr = FOREGROUND_GREEN; | ||
| 36 | DWORD tx_attr = FOREGROUND_RED; | ||
| 37 | |||
| 38 | static | ||
| 39 | void draw_statistics() | ||
| 40 | { | ||
| 41 | char msg[100]; | ||
| 42 | COORD coords; | ||
| 43 | |||
| 44 | WaitForSingleObject (hs_ds, INFINITE); | ||
| 45 | |||
| 46 | coords.X = 0; | ||
| 47 | coords.Y = 0; | ||
| 48 | |||
| 49 | sprintf (msg, "station1=%d \n", br[1]); | ||
| 50 | write_console (msg, strlen(msg), coords, si_attr); | ||
| 51 | |||
| 52 | coords.Y++; | ||
| 53 | sprintf (msg, "station2=%d \n", br[2]); | ||
| 54 | write_console (msg, strlen(msg), coords, si_attr); | ||
| 55 | |||
| 56 | coords.Y++; | ||
| 57 | sprintf (msg, "station3=%d \n", br[3]); | ||
| 58 | write_console (msg, strlen(msg), coords, si_attr); | ||
| 59 | |||
| 60 | coords.Y++; | ||
| 61 | sprintf (msg, "station4=%d \n", br[4]); | ||
| 62 | write_console (msg, strlen(msg), coords, si_attr); | ||
| 63 | |||
| 64 | coords.Y++; | ||
| 65 | sprintf (msg, "taxi=%d \n", w); | ||
| 66 | write_console (msg, strlen(msg), coords, si_attr); | ||
| 67 | |||
| 68 | ReleaseSemaphore (hs_ds, 1, NULL); | ||
| 69 | } | ||
| 70 | |||
| 71 | static | ||
| 72 | void draw_station(int station) | ||
| 73 | { | ||
| 74 | char msg[100]; | ||
| 75 | COORD coords; | ||
| 76 | int j; | ||
| 77 | |||
| 78 | WaitForSingleObject (hs_st, INFINITE); | ||
| 79 | |||
| 80 | if (station == 1) | ||
| 81 | { | ||
| 82 | int br1, n, c; | ||
| 83 | |||
| 84 | coords.X = 34; | ||
| 85 | coords.Y = 3; | ||
| 86 | write_console (" st1 ", 5, coords, st_attr); | ||
| 87 | coords.Y++; | ||
| 88 | write_console ("-----", 5, coords, st_attr); | ||
| 89 | |||
| 90 | br1 = add_br (1, 0); | ||
| 91 | coords.X = 40; | ||
| 92 | c = 3; | ||
| 93 | while (c-- > 0) | ||
| 94 | { | ||
| 95 | n = 5; | ||
| 96 | if (br1 < 5) | ||
| 97 | n = br1; | ||
| 98 | |||
| 99 | if (n != 0) | ||
| 100 | for (j = 5; j > 5-n; j--) | ||
| 101 | { | ||
| 102 | coords.Y = j - 1; | ||
| 103 | write_console ("*", 1, coords, si_attr); | ||
| 104 | } | ||
| 105 | |||
| 106 | if (n != 5) | ||
| 107 | for (j = 5-n; j > 0; j--) | ||
| 108 | { | ||
| 109 | coords.Y = j - 1; | ||
| 110 | write_console (" ", 1, coords, si_attr); | ||
| 111 | } | ||
| 112 | |||
| 113 | coords.X++; | ||
| 114 | br1 -= n; | ||
| 115 | } | ||
| 116 | } | ||
| 117 | else | ||
| 118 | if (station == 3) | ||
| 119 | { | ||
| 120 | int br3, n, c; | ||
| 121 | |||
| 122 | coords.X = 34; | ||
| 123 | coords.Y = 20; | ||
| 124 | write_console (" st3 ", 5, coords, st_attr); | ||
| 125 | coords.Y--; | ||
| 126 | write_console ("-----", 5, coords, st_attr); | ||
| 127 | |||
| 128 | br3 = add_br (3, 0); | ||
| 129 | coords.X = 33; | ||
| 130 | c = 3; | ||
| 131 | while (c-- > 0) | ||
| 132 | { | ||
| 133 | n = 5; | ||
| 134 | if (br3 < 5) | ||
| 135 | n = br3; | ||
| 136 | |||
| 137 | if (n != 0) | ||
| 138 | for (j = 0; j < n; j++) | ||
| 139 | { | ||
| 140 | coords.Y = 20 + j; | ||
| 141 | write_console ("*", 1, coords, si_attr); | ||
| 142 | } | ||
| 143 | |||
| 144 | if (n != 5) | ||
| 145 | for (j = n; j < 5; j++) | ||
| 146 | { | ||
| 147 | coords.Y = 20 + j; | ||
| 148 | write_console (" ", 1, coords, si_attr); | ||
| 149 | } | ||
| 150 | |||
| 151 | coords.X--; | ||
| 152 | br3 -= n; | ||
| 153 | } | ||
| 154 | } | ||
| 155 | else | ||
| 156 | if (station == 2) | ||
| 157 | { | ||
| 158 | int br2, n, c; | ||
| 159 | |||
| 160 | coords.X = 69; | ||
| 161 | coords.Y = 11; | ||
| 162 | write_console ("st2", 3, coords, st_attr); | ||
| 163 | coords.X -= 2; | ||
| 164 | for (j = 14; j >= 10; j--) | ||
| 165 | { | ||
| 166 | coords.Y = j; | ||
| 167 | write_console ("|", 1, coords, st_attr); | ||
| 168 | } | ||
| 169 | |||
| 170 | br2 = add_br (2, 0); | ||
| 171 | coords.Y = 13; | ||
| 172 | c = 3; | ||
| 173 | while (c-- > 0) | ||
| 174 | { | ||
| 175 | n = 5; | ||
| 176 | if (br2 < 5) | ||
| 177 | n = br2; | ||
| 178 | |||
| 179 | coords.X = 79; | ||
| 180 | write_console (" ", 1, coords, si_attr); | ||
| 181 | |||
| 182 | coords.Y++; | ||
| 183 | coords.X = 68; | ||
| 184 | write_console ("*****", br2, coords, si_attr); | ||
| 185 | |||
| 186 | coords.X = 68+n; | ||
| 187 | write_console (" ", 11-n, coords, si_attr); | ||
| 188 | |||
| 189 | coords.Y++; | ||
| 190 | coords.X = 79; | ||
| 191 | write_console (" ", 1, coords, si_attr); | ||
| 192 | |||
| 193 | coords.Y--; | ||
| 194 | br2 -= n; | ||
| 195 | } | ||
| 196 | } | ||
| 197 | else | ||
| 198 | if (station == 4) | ||
| 199 | { | ||
| 200 | int br4, n, c; | ||
| 201 | |||
| 202 | coords.X = 7; | ||
| 203 | coords.Y = 13; | ||
| 204 | write_console ("st4", 3, coords, st_attr); | ||
| 205 | coords.X += 4; | ||
| 206 | for (j = 10; j <= 14; j++) | ||
| 207 | { | ||
| 208 | coords.Y = j; | ||
| 209 | write_console ("|", 1, coords, st_attr); | ||
| 210 | } | ||
| 211 | |||
| 212 | coords.Y = 9; | ||
| 213 | br4 = add_br (4, 0); | ||
| 214 | c = 3; | ||
| 215 | while (c-- > 0) | ||
| 216 | { | ||
| 217 | n = 5; | ||
| 218 | if (br4 < 5) | ||
| 219 | n = br4; | ||
| 220 | |||
| 221 | coords.X = 0; | ||
| 222 | write_console (" ", 1, coords, si_attr); | ||
| 223 | |||
| 224 | coords.Y++; | ||
| 225 | write_console (" ", 10, coords, si_attr); | ||
| 226 | |||
| 227 | coords.X = 10 - n; | ||
| 228 | write_console ("**********", n, coords, si_attr); | ||
| 229 | |||
| 230 | coords.Y++; | ||
| 231 | coords.X = 0; | ||
| 232 | write_console (" ", 1, coords, si_attr); | ||
| 233 | |||
| 234 | coords.Y--; | ||
| 235 | br4 -= n; | ||
| 236 | } | ||
| 237 | } | ||
| 238 | |||
| 239 | ReleaseSemaphore (hs_st, 1, NULL); | ||
| 240 | } | ||
| 241 | |||
| 242 | int | ||
| 243 | main (void) | ||
| 244 | { | ||
| 245 | int N; // a passengers on the all stations | ||
| 246 | int i, j; | ||
| 247 | COORD coords; // a cursor coords | ||
| 248 | DWORD len; | ||
| 249 | int br1, br2, br3, br4; // a passengers on the station X | ||
| 250 | |||
| 251 | init_scr(); | ||
| 252 | |||
| 253 | printf ("Taxi and passengers simulator:\n"); | ||
| 254 | while (1) | ||
| 255 | { | ||
| 256 | printf (" enter a max passengers number on the stations (0..20) = "); | ||
| 257 | scanf ("%d", &N); | ||
| 258 | if ((N >= 0) && (N<=20)) | ||
| 259 | break; | ||
| 260 | } | ||
| 261 | while (1) | ||
| 262 | { | ||
| 263 | printf (" enter a passengers on the taxi (0..10) = "); | ||
| 264 | scanf ("%d", &w); | ||
| 265 | if ((w >= 0) && (w<=10)) | ||
| 266 | break; | ||
| 267 | } | ||
| 268 | init_scr(); | ||
| 269 | |||
| 270 | srand (time (0)); | ||
| 271 | br1 = rand () % 6; // passngers on the station1, 0..5 | ||
| 272 | if (br1 > N) | ||
| 273 | br1 = N; | ||
| 274 | |||
| 275 | br2 = rand () % 6; | ||
| 276 | if (br2 > N - br1) | ||
| 277 | br2 = N - br1; | ||
| 278 | |||
| 279 | br3 = rand () % 6; | ||
| 280 | if (br3 > N - br1 - br2) | ||
| 281 | br3 = N - br1 - br2; | ||
| 282 | |||
| 283 | br4 = N - br1 - br2 - br3; | ||
| 284 | while (br4 > 5) | ||
| 285 | { | ||
| 286 | br4--; | ||
| 287 | if (br1 < 5) { br1++; continue; } | ||
| 288 | if (br2 < 5) { br2++; continue; } | ||
| 289 | if (br3 < 5) { br3++; continue; } | ||
| 290 | } | ||
| 291 | |||
| 292 | hs_br = CreateSemaphore (NULL, 1, 1, NULL); | ||
| 293 | hs_wc = CreateSemaphore (NULL, 1, 1, NULL); | ||
| 294 | hs_ds = CreateSemaphore (NULL, 1, 1, NULL); | ||
| 295 | hs_st = CreateSemaphore (NULL, 1, 1, NULL); | ||
| 296 | |||
| 297 | draw_statistics(); | ||
| 298 | for (i=1; i<=4; i++) | ||
| 299 | draw_station(i); | ||
| 300 | |||
| 301 | htaxi = CreateThread (NULL, 4096, Taxi, NULL, 0, NULL); | ||
| 302 | |||
| 303 | for (i = 0; i < br1; i++) { | ||
| 304 | srand(time(0)); | ||
| 305 | Sleep(600*(4+rand()%10)); | ||
| 306 | hproc[i] = CreateThread (NULL, 4096, Si1, NULL, 0, NULL); | ||
| 307 | } | ||
| 308 | |||
| 309 | for (i = 0; i < br2; i++) { | ||
| 310 | srand(time(0)); | ||
| 311 | Sleep(400*(4+rand()%10)); | ||
| 312 | hproc2[i] = CreateThread (NULL, 4096, Si2, NULL, 0, NULL); | ||
| 313 | } | ||
| 314 | |||
| 315 | for (i = 0; i < br3; i++) { | ||
| 316 | srand(time(0)); | ||
| 317 | Sleep(600*(4+rand()%10)); | ||
| 318 | hproc3[i] = CreateThread (NULL, 4096, Si3, NULL, 0, NULL); | ||
| 319 | } | ||
| 320 | |||
| 321 | for (i = 0; i < br4; i++) { | ||
| 322 | srand(time(0)); | ||
| 323 | Sleep(600*(4+rand()%10)); | ||
| 324 | hproc4[i] = CreateThread (NULL, 4096, Si4, NULL, 0, NULL); | ||
| 325 | } | ||
| 326 | |||
| 327 | getch (); | ||
| 328 | restore_scr(); | ||
| 329 | return 0; | ||
| 330 | } | ||
| 331 | |||
| 332 | static | ||
| 333 | void draw_taxi (int orientation, COORD coords) | ||
| 334 | { | ||
| 335 | static int old_orientation; | ||
| 336 | static COORD old_coords; | ||
| 337 | |||
| 338 | if (orientation != 0) { | ||
| 339 | old_orientation = orientation; | ||
| 340 | old_coords = coords; | ||
| 341 | } | ||
| 342 | else { | ||
| 343 | orientation = old_orientation; | ||
| 344 | coords = old_coords; | ||
| 345 | } | ||
| 346 | |||
| 347 | if (orientation == 1) | ||
| 348 | { | ||
| 349 | int f, b, ii; | ||
| 350 | f = 5; | ||
| 351 | if (w < 5) | ||
| 352 | f = w; | ||
| 353 | b = w - f; | ||
| 354 | |||
| 355 | write_console (" ----- ", 8, coords, tx_attr); | ||
| 356 | |||
| 357 | coords.Y++; | ||
| 358 | write_console (" | |", 8, coords, tx_attr); | ||
| 359 | coords.X += 2 + 5 - b; | ||
| 360 | write_console ( "ooooo", b, coords, tx_attr); | ||
| 361 | coords.X -= 2 + 5 - b; | ||
| 362 | |||
| 363 | coords.Y++; | ||
| 364 | write_console (" | |", 8, coords, tx_attr); | ||
| 365 | coords.X += 2 + 5 - f; | ||
| 366 | write_console ( "ooooo", f, coords, tx_attr); | ||
| 367 | coords.X -= 2 + 5 - f; | ||
| 368 | |||
| 369 | coords.Y++; | ||
| 370 | write_console (" ----- ", 8, coords, tx_attr); | ||
| 371 | |||
| 372 | for (ii=0; ii<5; ii++) | ||
| 373 | { | ||
| 374 | coords.Y++; | ||
| 375 | write_console (" ", 8, coords, tx_attr); | ||
| 376 | } | ||
| 377 | } | ||
| 378 | else | ||
| 379 | if (orientation == 2) | ||
| 380 | { | ||
| 381 | COORD coords2; | ||
| 382 | int f, b, ii; | ||
| 383 | |||
| 384 | f = 5; | ||
| 385 | if (f > w) | ||
| 386 | f = w; | ||
| 387 | b = w - f; | ||
| 388 | |||
| 389 | coords2.X = coords.X; | ||
| 390 | coords.Y--; | ||
| 391 | write_console (" ", 7, coords, tx_attr); | ||
| 392 | coords.Y++; | ||
| 393 | write_console (" -- ", 7, coords, tx_attr); | ||
| 394 | |||
| 395 | for (ii=0; ii < 5; ii++) | ||
| 396 | { | ||
| 397 | coords2.Y = coords.Y + 5 - ii; | ||
| 398 | if (f && b) { | ||
| 399 | write_console (" |oo| ", 7, coords2, tx_attr); | ||
| 400 | f--; b--; | ||
| 401 | } | ||
| 402 | else | ||
| 403 | if (f) { | ||
| 404 | write_console (" |o | ", 7, coords2, tx_attr); | ||
| 405 | f--; | ||
| 406 | } | ||
| 407 | else { | ||
| 408 | write_console (" | | ", 7, coords2, tx_attr); | ||
| 409 | } | ||
| 410 | } | ||
| 411 | |||
| 412 | coords.Y += 6; | ||
| 413 | write_console (" -- ", 7, coords, tx_attr); | ||
| 414 | } | ||
| 415 | else | ||
| 416 | if (orientation == 3) | ||
| 417 | { | ||
| 418 | int ii; | ||
| 419 | for (ii=0; ii < 4; ii++) | ||
| 420 | { | ||
| 421 | write_console (" ", 8, coords, tx_attr); | ||
| 422 | coords.Y++; | ||
| 423 | } | ||
| 424 | |||
| 425 | write_console (" ----- ", 8, coords, tx_attr); | ||
| 426 | |||
| 427 | coords.Y++; | ||
| 428 | write_console ("| | ", 8, coords, tx_attr); | ||
| 429 | coords.X++; | ||
| 430 | ii = 5; | ||
| 431 | if (w < 5) | ||
| 432 | ii = w; | ||
| 433 | write_console ( "ooooo", ii, coords, tx_attr); | ||
| 434 | coords.X--; | ||
| 435 | |||
| 436 | coords.Y++; | ||
| 437 | write_console ("| | ", 8, coords, tx_attr); | ||
| 438 | coords.X++; | ||
| 439 | ii = w - ii; | ||
| 440 | write_console ( "ooooo", ii, coords, tx_attr); | ||
| 441 | coords.X--; | ||
| 442 | |||
| 443 | coords.Y++; | ||
| 444 | write_console (" ----- ", 8, coords, tx_attr); | ||
| 445 | } | ||
| 446 | else | ||
| 447 | if (orientation == 4) | ||
| 448 | { | ||
| 449 | int f, b, ii; | ||
| 450 | |||
| 451 | f = 5; | ||
| 452 | if (f > w) | ||
| 453 | f = w; | ||
| 454 | b = w - f; | ||
| 455 | |||
| 456 | write_console (" -- ", 7, coords, tx_attr); | ||
| 457 | |||
| 458 | for (ii=0; ii < 5; ii++) | ||
| 459 | { | ||
| 460 | coords.Y++; | ||
| 461 | if (f && b) { | ||
| 462 | write_console (" |oo| ", 7, coords, tx_attr); | ||
| 463 | f--; b--; | ||
| 464 | } | ||
| 465 | else | ||
| 466 | if (f) { | ||
| 467 | write_console (" | o| ", 7, coords, tx_attr); | ||
| 468 | f--; | ||
| 469 | } | ||
| 470 | else | ||
| 471 | write_console (" | | ", 7, coords, tx_attr); | ||
| 472 | } | ||
| 473 | |||
| 474 | coords.Y++; | ||
| 475 | write_console (" -- ", 7, coords, tx_attr); | ||
| 476 | |||
| 477 | coords.Y++; | ||
| 478 | write_console (" ", 7, coords, tx_attr); | ||
| 479 | } | ||
| 480 | } | ||
| 481 | |||
| 482 | DWORD WINAPI | ||
| 483 | Taxi (LPVOID _unused_thread_parm) | ||
| 484 | { | ||
| 485 | int i, ii, j, k, f, b; | ||
| 486 | int empty_st; | ||
| 487 | COORD coords; | ||
| 488 | DWORD len; | ||
| 489 | char msg[100]; | ||
| 490 | |||
| 491 | for (j = 0; j < 48; j++) // taxi left | ||
| 492 | { | ||
| 493 | coords.X = 59 - j; | ||
| 494 | coords.Y = 11; | ||
| 495 | draw_taxi (3, coords); | ||
| 496 | |||
| 497 | if (j == 23) // station 3 for a passengers exit | ||
| 498 | { | ||
| 499 | int br3 = add_br (3, 0); | ||
| 500 | empty_st = (br3 == 0); | ||
| 501 | |||
| 502 | srand (time (0)); | ||
| 503 | f = rand () % (16 - br3); // passengers can be on the station | ||
| 504 | |||
| 505 | if (w) | ||
| 506 | { | ||
| 507 | while(f) | ||
| 508 | { | ||
| 509 | if (w==0) | ||
| 510 | break; | ||
| 511 | |||
| 512 | f--; | ||
| 513 | w--; | ||
| 514 | add_br (3, 1); | ||
| 515 | draw_statistics(); | ||
| 516 | draw_station(3); | ||
| 517 | draw_taxi(0, coords); | ||
| 518 | Sleep (300); | ||
| 519 | } | ||
| 520 | Sleep (3000); | ||
| 521 | } | ||
| 522 | } | ||
| 523 | |||
| 524 | if (j == 28) // station 3 for enter | ||
| 525 | { | ||
| 526 | int br3 = add_br (3, 0); | ||
| 527 | f = rand () % (11 - w); // passengers into taxi | ||
| 528 | |||
| 529 | |||
| 530 | if (br3 && !empty_st) | ||
| 531 | { | ||
| 532 | while (br3 > 0 && f > 0) | ||
| 533 | { | ||
| 534 | f--; | ||
| 535 | w++; | ||
| 536 | br3 = add_br (3, -1); | ||
| 537 | |||
| 538 | draw_statistics(); | ||
| 539 | draw_station(3); | ||
| 540 | draw_taxi(0, coords); | ||
| 541 | Sleep (300); | ||
| 542 | } | ||
| 543 | Sleep (3000); | ||
| 544 | } | ||
| 545 | } | ||
| 546 | Sleep (300); | ||
| 547 | } | ||
| 548 | |||
| 549 | for (i = 0; i < 10; i++) // taxi up | ||
| 550 | { | ||
| 551 | coords.X = 12; | ||
| 552 | coords.Y = 15 - i; | ||
| 553 | draw_taxi(4, coords); | ||
| 554 | |||
| 555 | if (i == 4) // station 4 for exit | ||
| 556 | { | ||
| 557 | int br4 = add_br (4, 0); | ||
| 558 | empty_st = (br4 == 0); | ||
| 559 | |||
| 560 | srand (time (0)); | ||
| 561 | f = rand () % (16 - br4); | ||
| 562 | |||
| 563 | if (w) | ||
| 564 | { | ||
| 565 | while(f) | ||
| 566 | { | ||
| 567 | if (w==0) | ||
| 568 | break; | ||
| 569 | |||
| 570 | f--; | ||
| 571 | w--; | ||
| 572 | add_br (4, 1); | ||
| 573 | draw_statistics(); | ||
| 574 | draw_station(4); | ||
| 575 | draw_taxi(0, coords); | ||
| 576 | Sleep (300); | ||
| 577 | } | ||
| 578 | Sleep (3000); | ||
| 579 | } | ||
| 580 | } | ||
| 581 | |||
| 582 | if (i == 7) // station 4 for enter | ||
| 583 | { | ||
| 584 | int br4 = add_br (4, 0); | ||
| 585 | f = rand () % (11 - w); | ||
| 586 | |||
| 587 | |||
| 588 | if (br4 && !empty_st) | ||
| 589 | { | ||
| 590 | while (br4 > 0 && f > 0) | ||
| 591 | { | ||
| 592 | f--; | ||
| 593 | w++; | ||
| 594 | br4 = add_br (4, -1); | ||
| 595 | |||
| 596 | draw_statistics(); | ||
| 597 | draw_station(4); | ||
| 598 | draw_taxi(0, coords); | ||
| 599 | Sleep (300); | ||
| 600 | } | ||
| 601 | Sleep (3000); | ||
| 602 | } | ||
| 603 | } | ||
| 604 | Sleep (300); | ||
| 605 | } | ||
| 606 | |||
| 607 | for (k = 0; k < 48; k++) // taxi rigth | ||
| 608 | { | ||
| 609 | coords.X = 12 + k; | ||
| 610 | coords.Y = 5; | ||
| 611 | draw_taxi (1, coords); | ||
| 612 | |||
| 613 | if (k == 19) // station 1 for exit | ||
| 614 | { | ||
| 615 | int br1 = add_br (1, 0); | ||
| 616 | empty_st = (br1 == 0); | ||
| 617 | |||
| 618 | srand (time (0)); | ||
| 619 | f = rand () % (16 - br1); | ||
| 620 | |||
| 621 | if (w) | ||
| 622 | { | ||
| 623 | while(f) | ||
| 624 | { | ||
| 625 | if (w==0) | ||
| 626 | break; | ||
| 627 | |||
| 628 | f--; | ||
| 629 | w--; | ||
| 630 | add_br (1, 1); | ||
| 631 | draw_statistics(); | ||
| 632 | draw_station(1); | ||
| 633 | draw_taxi(0, coords); | ||
| 634 | Sleep (300); | ||
| 635 | } | ||
| 636 | Sleep (3000); | ||
| 637 | } | ||
| 638 | } | ||
| 639 | |||
| 640 | if (k == 23) // station 1 for enter | ||
| 641 | { | ||
| 642 | int br1 = add_br (1, 0); | ||
| 643 | f = rand () % (11 - w); | ||
| 644 | |||
| 645 | if (br1 && !empty_st) | ||
| 646 | { | ||
| 647 | while (br1 > 0 && f > 0) | ||
| 648 | { | ||
| 649 | f--; | ||
| 650 | w++; | ||
| 651 | br1 = add_br (1, -1); | ||
| 652 | |||
| 653 | draw_statistics(); | ||
| 654 | draw_station(1); | ||
| 655 | draw_taxi(0, coords); | ||
| 656 | Sleep (300); | ||
| 657 | } | ||
| 658 | Sleep (3000); | ||
| 659 | } | ||
| 660 | } | ||
| 661 | Sleep (300); | ||
| 662 | } | ||
| 663 | |||
| 664 | for (i = 0; i < 9; i++) // taxi down | ||
| 665 | { | ||
| 666 | coords.X = 60; | ||
| 667 | coords.Y = 3 + i; | ||
| 668 | draw_taxi (2, coords); | ||
| 669 | |||
| 670 | if (i == 4) // station 2 for exit | ||
| 671 | { | ||
| 672 | int br2 = add_br (2, 0); | ||
| 673 | empty_st = (br2 == 0); | ||
| 674 | |||
| 675 | srand (time (0)); | ||
| 676 | f = rand () % (16 - br2); | ||
| 677 | |||
| 678 | if (w) | ||
| 679 | { | ||
| 680 | while(f) | ||
| 681 | { | ||
| 682 | if (w==0) | ||
| 683 | break; | ||
| 684 | |||
| 685 | f--; | ||
| 686 | w--; | ||
| 687 | add_br (2, 1); | ||
| 688 | draw_statistics(); | ||
| 689 | draw_station(2); | ||
| 690 | draw_taxi(0, coords); | ||
| 691 | Sleep (300); | ||
| 692 | } | ||
| 693 | Sleep (3000); | ||
| 694 | } | ||
| 695 | } | ||
| 696 | |||
| 697 | if (i == 6) // station 2 for enter | ||
| 698 | { | ||
| 699 | int br2 = add_br (2, 0); | ||
| 700 | f = rand () % (11 - w); | ||
| 701 | |||
| 702 | if (br2 && !empty_st) | ||
| 703 | { | ||
| 704 | while (br2 > 0 && f > 0) | ||
| 705 | { | ||
| 706 | f--; | ||
| 707 | w++; | ||
| 708 | br2 = add_br (2, -1); | ||
| 709 | |||
| 710 | draw_statistics(); | ||
| 711 | draw_station(2); | ||
| 712 | draw_taxi(0, coords); | ||
| 713 | Sleep (300); | ||
| 714 | } | ||
| 715 | Sleep (3000); | ||
| 716 | } | ||
| 717 | } | ||
| 718 | |||
| 719 | Sleep (300); | ||
| 720 | } | ||
| 721 | |||
| 722 | ht2 = CreateThread (NULL, 4096, Taxi, NULL, 0, NULL); // endless loop | ||
| 723 | return 0; | ||
| 724 | } | ||
| 725 | |||
| 726 | DWORD WINAPI | ||
| 727 | Si1 (LPVOID _unused_thread_parm) // a passengers thread for the station 1 | ||
| 728 | { | ||
| 729 | int a, j, n; | ||
| 730 | COORD coords; | ||
| 731 | |||
| 732 | srand (time (0)); | ||
| 733 | a = 6 + rand () % 74; // a new passengers number, 6..79 | ||
| 734 | |||
| 735 | while (a != 40) | ||
| 736 | { | ||
| 737 | if (a < 40) | ||
| 738 | a++; | ||
| 739 | else | ||
| 740 | a--; | ||
| 741 | |||
| 742 | coords.X = a; | ||
| 743 | coords.Y = 0; | ||
| 744 | |||
| 745 | if (a < 40) | ||
| 746 | write_console (" *", 2, coords, si_attr); | ||
| 747 | else | ||
| 748 | write_console ("* ", 2, coords, si_attr); | ||
| 749 | |||
| 750 | Sleep (1000); | ||
| 751 | } | ||
| 752 | |||
| 753 | add_br (1, 1); | ||
| 754 | draw_station(1); | ||
| 755 | draw_statistics(); | ||
| 756 | |||
| 757 | Sleep (1000); | ||
| 758 | return 0; | ||
| 759 | } | ||
| 760 | |||
| 761 | DWORD WINAPI | ||
| 762 | Si3 (LPVOID _unused_thread_parm) // a passengers thread for the station 3 | ||
| 763 | { | ||
| 764 | int b, j, n; | ||
| 765 | COORD coords; | ||
| 766 | |||
| 767 | srand (time (0)); | ||
| 768 | b = 1 + rand () % 79; | ||
| 769 | |||
| 770 | while (b != 33) | ||
| 771 | { | ||
| 772 | if (b < 33) | ||
| 773 | b++; | ||
| 774 | else | ||
| 775 | b--; | ||
| 776 | |||
| 777 | coords.X = b; | ||
| 778 | coords.Y = 24; | ||
| 779 | |||
| 780 | if (b < 33) | ||
| 781 | write_console (" *", 2, coords, si_attr); | ||
| 782 | else | ||
| 783 | write_console ("* ", 2, coords, si_attr); | ||
| 784 | |||
| 785 | Sleep (1000); | ||
| 786 | } | ||
| 787 | |||
| 788 | add_br (3, 1); | ||
| 789 | draw_station(3); | ||
| 790 | draw_statistics(); | ||
| 791 | |||
| 792 | Sleep (1000); | ||
| 793 | return 0; | ||
| 794 | } | ||
| 795 | |||
| 796 | DWORD WINAPI | ||
| 797 | Si4 (LPVOID _unused_thread_parm) // a passengers thread for the station 4 | ||
| 798 | { | ||
| 799 | |||
| 800 | int c, j, n; | ||
| 801 | COORD coords; | ||
| 802 | |||
| 803 | srand (time (0)); | ||
| 804 | c = 6 + rand () % 19; // a new passengers number, 6..24 | ||
| 805 | |||
| 806 | coords.X = 0; | ||
| 807 | while (c != 10) | ||
| 808 | { | ||
| 809 | coords.Y = c; | ||
| 810 | write_console ("*", 1, coords, si_attr); | ||
| 811 | |||
| 812 | if (c < 10) { | ||
| 813 | c++; | ||
| 814 | coords.Y--; | ||
| 815 | } | ||
| 816 | else { | ||
| 817 | c--; | ||
| 818 | coords.Y++; | ||
| 819 | } | ||
| 820 | write_console (" ", 1, coords, si_attr); | ||
| 821 | |||
| 822 | Sleep (1000); | ||
| 823 | } | ||
| 824 | |||
| 825 | add_br (4, 1); | ||
| 826 | draw_station(4); | ||
| 827 | draw_statistics(); | ||
| 828 | |||
| 829 | Sleep (1000); | ||
| 830 | return 0; | ||
| 831 | } | ||
| 832 | |||
| 833 | DWORD WINAPI | ||
| 834 | Si2 (LPVOID _unused_thread_parm) // a passengers thread for the station 2 | ||
| 835 | { | ||
| 836 | int d, j, n; | ||
| 837 | COORD coords; | ||
| 838 | |||
| 839 | srand (time (0)); | ||
| 840 | d = 1 + rand () % 24; // a new passengers number, 1..24 | ||
| 841 | |||
| 842 | coords.X = 79; | ||
| 843 | while (d != 14) | ||
| 844 | { | ||
| 845 | coords.Y = d; | ||
| 846 | write_console ("*", 1, coords, si_attr); | ||
| 847 | if (d < 14) | ||
| 848 | { | ||
| 849 | d++; | ||
| 850 | coords.Y--; | ||
| 851 | } | ||
| 852 | else | ||
| 853 | { | ||
| 854 | d--; | ||
| 855 | coords.Y++; | ||
| 856 | } | ||
| 857 | write_console (" ", 1, coords, si_attr); | ||
| 858 | Sleep (1000); | ||
| 859 | } | ||
| 860 | |||
| 861 | add_br (2, 1); | ||
| 862 | draw_station(2); | ||
| 863 | draw_statistics(); | ||
| 864 | |||
| 865 | Sleep (1000); | ||
| 866 | return 0; | ||
| 867 | } | ||
| 868 | |||
| 869 | UINT oldcp; // CodePage on the program start | ||
| 870 | CONSOLE_CURSOR_INFO old_ci; | ||
| 871 | |||
| 872 | void init_scr() | ||
| 873 | { | ||
| 874 | hstdout = GetStdHandle (STD_OUTPUT_HANDLE); | ||
| 875 | if (hstdout == INVALID_HANDLE_VALUE) | ||
| 876 | { | ||
| 877 | printf ("Error, can't get console handle\n"); | ||
| 878 | exit (1); | ||
| 879 | } | ||
| 880 | |||
| 881 | if (oldcp == 0) | ||
| 882 | { | ||
| 883 | oldcp = GetConsoleOutputCP(); | ||
| 884 | SetConsoleOutputCP(CP_UTF8); | ||
| 885 | |||
| 886 | GetConsoleCursorInfo (hstdout, &old_ci); | ||
| 887 | } | ||
| 888 | else | ||
| 889 | { | ||
| 890 | CONSOLE_CURSOR_INFO new_ci; | ||
| 891 | |||
| 892 | new_ci.bVisible = FALSE; | ||
| 893 | new_ci.dwSize = old_ci.dwSize; | ||
| 894 | SetConsoleCursorInfo (hstdout, &new_ci); | ||
| 895 | } | ||
| 896 | |||
| 897 | clrscr (); | ||
| 898 | } | ||
| 899 | |||
| 900 | void restore_scr() | ||
| 901 | { | ||
| 902 | SetConsoleOutputCP(oldcp); | ||
| 903 | SetConsoleCursorInfo (hstdout, &old_ci); | ||
| 904 | clrscr (); | ||
| 905 | } | ||
| 906 | |||
| 907 | void clrscr() | ||
| 908 | { | ||
| 909 | CONSOLE_SCREEN_BUFFER_INFO csbi; | ||
| 910 | DWORD nocw; | ||
| 911 | COORD coords; | ||
| 912 | |||
| 913 | SetConsoleTextAttribute (hstdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN); | ||
| 914 | GetConsoleScreenBufferInfo (hstdout, &csbi); | ||
| 915 | |||
| 916 | // printf ("csbi.dwSize.X=%u csbi.dwSize.Y=%u\n", | ||
| 917 | // csbi.dwSize.X, csbi.dwSize.Y); | ||
| 918 | // getch (); | ||
| 919 | |||
| 920 | coords.X=0; coords.Y=0; | ||
| 921 | SetConsoleCursorPosition (hstdout, coords); | ||
| 922 | FillConsoleOutputCharacterA(hstdout, ' ', csbi.dwSize.X * csbi.dwSize.Y, coords, &nocw); | ||
| 923 | } | ||
| 924 | |||
| 925 | void write_console(const char *msg, DWORD len, COORD coords, DWORD attr) | ||
| 926 | { | ||
| 927 | DWORD len2; | ||
| 928 | |||
| 929 | WaitForSingleObject (hs_wc, INFINITE); | ||
| 930 | |||
| 931 | SetConsoleTextAttribute (hstdout, attr); | ||
| 932 | SetConsoleCursorPosition (hstdout, coords); | ||
| 933 | WriteConsole (hstdout, msg, len, &len2, NULL); | ||
| 934 | |||
| 935 | ReleaseSemaphore (hs_wc, 1, NULL); | ||
| 936 | } | ||
| 937 | |||
| 938 | int add_br (int n, int addon) | ||
| 939 | { | ||
| 940 | int new; | ||
| 941 | |||
| 942 | WaitForSingleObject (hs_br, INFINITE); | ||
| 943 | br[n] += addon; | ||
| 944 | new = br[n]; | ||
| 945 | ReleaseSemaphore (hs_br, 1, NULL); | ||
| 946 | |||
| 947 | return new; | ||
| 948 | } | ||
| @@ -1,21 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _BSDTYPES_DEFINED | ||
| 8 | #define _BSDTYPES_DEFINED | ||
| 9 | |||
| 10 | typedef unsigned char u_char; | ||
| 11 | typedef unsigned short u_short; | ||
| 12 | typedef unsigned int u_int; | ||
| 13 | typedef unsigned long u_long; | ||
| 14 | #if defined(__GNUC__) || \ | ||
| 15 | defined(__GNUG__) | ||
| 16 | __extension__ | ||
| 17 | #endif /* gcc / g++ */ | ||
| 18 | typedef unsigned long long u_int64; | ||
| 19 | |||
| 20 | #endif /* _BSDTYPES_DEFINED */ | ||
| 21 | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #if !defined(_INC_CRT_UNICODE_MACROS) | ||
| 8 | /* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */ | ||
| 9 | |||
| 10 | #if defined(UNICODE) | ||
| 11 | # define _INC_CRT_UNICODE_MACROS 1 | ||
| 12 | # define __MINGW_NAME_AW(func) func##W | ||
| 13 | # define __MINGW_NAME_AW_EXT(func,ext) func##W##ext | ||
| 14 | # define __MINGW_NAME_UAW(func) func##_W | ||
| 15 | # define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext | ||
| 16 | # define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */ | ||
| 17 | # define __MINGW_PROCNAMEEXT_AW "W" | ||
| 18 | #else | ||
| 19 | # define _INC_CRT_UNICODE_MACROS 2 | ||
| 20 | # define __MINGW_NAME_AW(func) func##A | ||
| 21 | # define __MINGW_NAME_AW_EXT(func,ext) func##A##ext | ||
| 22 | # define __MINGW_NAME_UAW(func) func##_A | ||
| 23 | # define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext | ||
| 24 | # define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */ | ||
| 25 | # define __MINGW_PROCNAMEEXT_AW "A" | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #define __MINGW_TYPEDEF_AW(type) \ | ||
| 29 | typedef __MINGW_NAME_AW(type) type; | ||
| 30 | #define __MINGW_TYPEDEF_UAW(type) \ | ||
| 31 | typedef __MINGW_NAME_UAW(type) type; | ||
| 32 | |||
| 33 | #endif /* !defined(_INC_CRT_UNICODE_MACROS) */ | ||
| @@ -1,23 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _TIMEVAL_DEFINED | ||
| 8 | #define _TIMEVAL_DEFINED | ||
| 9 | |||
| 10 | struct timeval | ||
| 11 | { | ||
| 12 | long tv_sec; | ||
| 13 | long tv_usec; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) | ||
| 17 | #define timercmp(tvp,uvp,cmp) \ | ||
| 18 | ((tvp)->tv_sec cmp (uvp)->tv_sec || \ | ||
| 19 | ((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)) | ||
| 20 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 | ||
| 21 | |||
| 22 | #endif /* _TIMEVAL_DEFINED */ | ||
| 23 | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef s6_addr | ||
| 8 | |||
| 9 | #include <_bsd_types.h> | ||
| 10 | |||
| 11 | typedef struct in6_addr { | ||
| 12 | union { | ||
| 13 | u_char Byte[16]; | ||
| 14 | u_short Word[8]; | ||
| 15 | } u; | ||
| 16 | } IN6_ADDR, *PIN6_ADDR, *LPIN6_ADDR; | ||
| 17 | |||
| 18 | #define in_addr6 in6_addr | ||
| 19 | |||
| 20 | #define _S6_un u | ||
| 21 | #define _S6_u8 Byte | ||
| 22 | #define s6_addr _S6_un._S6_u8 | ||
| 23 | |||
| 24 | #define s6_bytes u.Byte | ||
| 25 | #define s6_words u.Word | ||
| 26 | |||
| 27 | #endif /* s6_addr */ | ||
| 28 | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef s_addr | ||
| 8 | |||
| 9 | #include <_bsd_types.h> | ||
| 10 | |||
| 11 | typedef struct in_addr { | ||
| 12 | union { | ||
| 13 | struct { u_char s_b1, s_b2, s_b3, s_b4; } S_un_b; | ||
| 14 | struct { u_short s_w1, s_w2; } S_un_w; | ||
| 15 | u_long S_addr; | ||
| 16 | } S_un; | ||
| 17 | } IN_ADDR, *PIN_ADDR, *LPIN_ADDR; | ||
| 18 | |||
| 19 | #define s_addr S_un.S_addr | ||
| 20 | #define s_host S_un.S_un_b.s_b2 | ||
| 21 | #define s_net S_un.S_un_b.s_b1 | ||
| 22 | #define s_imp S_un.S_un_w.s_w2 | ||
| 23 | #define s_impno S_un.S_un_b.s_b4 | ||
| 24 | #define s_lh S_un.S_un_b.s_b3 | ||
| 25 | |||
| 26 | #endif /* s_addr */ | ||
| 27 | |||
| @@ -1,195 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | #ifndef _MSTCPIP_ | ||
| 7 | #define _MSTCPIP_ | ||
| 8 | |||
| 9 | #include <_mingw_unicode.h> | ||
| 10 | |||
| 11 | struct tcp_keepalive { | ||
| 12 | u_long onoff; | ||
| 13 | u_long keepalivetime; | ||
| 14 | u_long keepaliveinterval; | ||
| 15 | }; | ||
| 16 | |||
| 17 | #define SIO_RCVALL _WSAIOW(IOC_VENDOR,1) | ||
| 18 | #define SIO_RCVALL_MCAST _WSAIOW(IOC_VENDOR,2) | ||
| 19 | #define SIO_RCVALL_IGMPMCAST _WSAIOW(IOC_VENDOR,3) | ||
| 20 | #define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4) | ||
| 21 | #define SIO_ABSORB_RTRALERT _WSAIOW(IOC_VENDOR,5) | ||
| 22 | #define SIO_UCAST_IF _WSAIOW(IOC_VENDOR,6) | ||
| 23 | #define SIO_LIMIT_BROADCASTS _WSAIOW(IOC_VENDOR,7) | ||
| 24 | #define SIO_INDEX_BIND _WSAIOW(IOC_VENDOR,8) | ||
| 25 | #define SIO_INDEX_MCASTIF _WSAIOW(IOC_VENDOR,9) | ||
| 26 | #define SIO_INDEX_ADD_MCAST _WSAIOW(IOC_VENDOR,10) | ||
| 27 | #define SIO_INDEX_DEL_MCAST _WSAIOW(IOC_VENDOR,11) | ||
| 28 | |||
| 29 | #define RCVALL_OFF 0 | ||
| 30 | #define RCVALL_ON 1 | ||
| 31 | #define RCVALL_SOCKETLEVELONLY 2 | ||
| 32 | |||
| 33 | #if (_WIN32_WINNT >= 0x0502) | ||
| 34 | #define SOCKET_SETTINGS_GUARANTEE_ENCRYPTION 0x00000001 | ||
| 35 | #define SOCKET_SETTINGS_ALLOW_INSECURE 0x00000002 | ||
| 36 | |||
| 37 | typedef enum _SOCKET_SECURITY_PROTOCOL { | ||
| 38 | SOCKET_SECURITY_PROTOCOL_DEFAULT, | ||
| 39 | SOCKET_SECURITY_PROTOCOL_IPSEC, | ||
| 40 | SOCKET_SECURITY_PROTOCOL_INVALID | ||
| 41 | } SOCKET_SECURITY_PROTOCOL; | ||
| 42 | |||
| 43 | typedef enum _SOCKET_USAGE_TYPE { | ||
| 44 | SYSTEM_CRITICAL_SOCKET = 1 | ||
| 45 | } SOCKET_USAGE_TYPE; | ||
| 46 | |||
| 47 | typedef struct _SOCKET_PEER_TARGET_NAME { | ||
| 48 | SOCKET_SECURITY_PROTOCOL SecurityProtocol; | ||
| 49 | SOCKADDR_STORAGE PeerAddress; | ||
| 50 | ULONG PeerTargetNameStringLen; | ||
| 51 | wchar_t AllStrings[]; | ||
| 52 | } SOCKET_PEER_TARGET_NAME; | ||
| 53 | |||
| 54 | #define SOCKET_INFO_CONNECTION_SECURED 0x00000001 | ||
| 55 | #define SOCKET_INFO_CONNECTION_ENCRYPTED 0x00000002 | ||
| 56 | #define SOCKET_INFO_CONNECTION_IMPERSONATED 0x00000004 | ||
| 57 | |||
| 58 | typedef struct _SOCKET_SECURITY_QUERY_INFO { | ||
| 59 | SOCKET_SECURITY_PROTOCOL SecurityProtocol; | ||
| 60 | ULONG Flags; | ||
| 61 | UINT64 PeerApplicationAccessTokenHandle; | ||
| 62 | UINT64 PeerMachineAccessTokenHandle; | ||
| 63 | } SOCKET_SECURITY_QUERY_INFO; | ||
| 64 | |||
| 65 | typedef struct _SOCKET_SECURITY_QUERY_TEMPLATE { | ||
| 66 | SOCKET_SECURITY_PROTOCOL SecurityProtocol; | ||
| 67 | SOCKADDR_STORAGE PeerAddress; | ||
| 68 | ULONG PeerTokenAccessMask; | ||
| 69 | } SOCKET_SECURITY_QUERY_TEMPLATE; | ||
| 70 | |||
| 71 | typedef struct _SOCKET_SECURITY_SETTINGS { | ||
| 72 | SOCKET_SECURITY_PROTOCOL SecurityProtocol; | ||
| 73 | ULONG SecurityFlags; | ||
| 74 | } SOCKET_SECURITY_SETTINGS; | ||
| 75 | |||
| 76 | #define SOCKET_SETTINGS_IPSEC_SKIP_FILTER_INSTANTIATION 0x00000001 | ||
| 77 | |||
| 78 | typedef struct _SOCKET_SECURITY_SETTINGS_IPSEC { | ||
| 79 | SOCKET_SECURITY_PROTOCOL SecurityProtocol; | ||
| 80 | ULONG SecurityFlags; | ||
| 81 | ULONG IpsecFlags; | ||
| 82 | GUID AuthipMMPolicyKey; | ||
| 83 | GUID AuthipQMPolicyKey; | ||
| 84 | GUID Reserved; | ||
| 85 | UINT64 Reserved2; | ||
| 86 | ULONG UserNameStringLen; | ||
| 87 | ULONG DomainNameStringLen; | ||
| 88 | ULONG PasswordStringLen; | ||
| 89 | wchar_t AllStrings[]; | ||
| 90 | } SOCKET_SECURITY_SETTINGS_IPSEC; | ||
| 91 | |||
| 92 | #define RtlIpv6AddressToString __MINGW_NAME_AW(RtlIpv6AddressToString) | ||
| 93 | #define RtlIpv6AddressToStringEx __MINGW_NAME_AW(RtlIpv6AddressToStringEx) | ||
| 94 | |||
| 95 | LPWSTR NTAPI RtlIpv6AddressToStringA( | ||
| 96 | const IN6_ADDR *Addr, | ||
| 97 | LPSTR S | ||
| 98 | ); | ||
| 99 | |||
| 100 | LPSTR NTAPI RtlIpv6AddressToStringW( | ||
| 101 | const IN6_ADDR *Addr, | ||
| 102 | LPWSTR S | ||
| 103 | ); | ||
| 104 | |||
| 105 | LONG NTAPI RtlIpv6AddressToStringExA( | ||
| 106 | const IN6_ADDR *Address, | ||
| 107 | ULONG ScopeId, | ||
| 108 | USHORT Port, | ||
| 109 | LPSTR AddressString, | ||
| 110 | PULONG AddressStringLength | ||
| 111 | ); | ||
| 112 | |||
| 113 | LONG NTAPI RtlIpv6AddressToStringExW( | ||
| 114 | const IN6_ADDR *Address, | ||
| 115 | ULONG ScopeId, | ||
| 116 | USHORT Port, | ||
| 117 | LPWSTR AddressString, | ||
| 118 | PULONG AddressStringLength | ||
| 119 | ); | ||
| 120 | |||
| 121 | #define RtlIpv4AddressToString __MINGW_NAME_AW(RtlIpv4AddressToString) | ||
| 122 | LPTSTR NTAPI RtlIpv4AddressToStringA( | ||
| 123 | const IN_ADDR *Addr, | ||
| 124 | LPSTR S | ||
| 125 | ); | ||
| 126 | |||
| 127 | LPTSTR NTAPI RtlIpv4AddressToStringW( | ||
| 128 | const IN_ADDR *Addr, | ||
| 129 | LPWSTR S | ||
| 130 | ); | ||
| 131 | |||
| 132 | #define RtlIpv4AddressToStringEx __MINGW_NAME_AW(RtlIpv4AddressToStringEx) | ||
| 133 | LONG NTAPI RtlIpv4AddressToStringExA( | ||
| 134 | const IN_ADDR *Address, | ||
| 135 | USHORT Port, | ||
| 136 | LPSTR AddressString, | ||
| 137 | PULONG AddressStringLength | ||
| 138 | ); | ||
| 139 | |||
| 140 | LONG NTAPI RtlIpv4AddressToStringExW( | ||
| 141 | const IN_ADDR *Address, | ||
| 142 | USHORT Port, | ||
| 143 | LPWSTR AddressString, | ||
| 144 | PULONG AddressStringLength | ||
| 145 | ); | ||
| 146 | |||
| 147 | #define RtlIpv4StringToAddress __MINGW_NAME_AW(RtlIpv4StringToAddress) | ||
| 148 | LONG NTAPI RtlIpv4StringToAddressA( | ||
| 149 | PCSTR S, | ||
| 150 | BOOLEAN Strict, | ||
| 151 | LPSTR *Terminator, | ||
| 152 | IN_ADDR *Addr | ||
| 153 | ); | ||
| 154 | |||
| 155 | LONG NTAPI RtlIpv4StringToAddressW( | ||
| 156 | PCWSTR S, | ||
| 157 | BOOLEAN Strict, | ||
| 158 | LPWSTR *Terminator, | ||
| 159 | IN_ADDR *Addr | ||
| 160 | ); | ||
| 161 | |||
| 162 | #define RtlIpv4StringToAddressEx __MINGW_NAME_AW(RtlIpv4StringToAddressEx) | ||
| 163 | LONG NTAPI RtlIpv4StringToAddressExA( | ||
| 164 | PCSTR AddressString, | ||
| 165 | BOOLEAN Strict, | ||
| 166 | IN_ADDR *Address, | ||
| 167 | PUSHORT Port | ||
| 168 | ); | ||
| 169 | |||
| 170 | LONG NTAPI RtlIpv4StringToAddressExW( | ||
| 171 | PCWSTR AddressString, | ||
| 172 | BOOLEAN Strict, | ||
| 173 | IN_ADDR *Address, | ||
| 174 | PUSHORT Port | ||
| 175 | ); | ||
| 176 | |||
| 177 | #define RtlIpv6StringToAddressEx __MINGW_NAME_AW(RtlIpv6StringToAddressEx) | ||
| 178 | LONG NTAPI RtlIpv6StringToAddressExA( | ||
| 179 | PCSTR AddressString, | ||
| 180 | IN6_ADDR *Address, | ||
| 181 | PULONG ScopeId, | ||
| 182 | PUSHORT Port | ||
| 183 | ); | ||
| 184 | |||
| 185 | LONG NTAPI RtlIpv6StringToAddressExW( | ||
| 186 | PCSTR AddressString, | ||
| 187 | IN6_ADDR *Address, | ||
| 188 | PULONG ScopeId, | ||
| 189 | PUSHORT Port | ||
| 190 | ); | ||
| 191 | |||
| 192 | #endif /*(_WIN32_WINNT >= 0x0502)*/ | ||
| 193 | |||
| 194 | #endif /* _MSTCPIP_ */ | ||
| 195 | |||
| @@ -1,193 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the mingw-w64 runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _MSWSOCK_ | ||
| 8 | #define _MSWSOCK_ | ||
| 9 | |||
| 10 | #include <winsock2.h> | ||
| 11 | |||
| 12 | #ifdef __cplusplus | ||
| 13 | extern "C" { | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #define SO_CONNDATA 0x7000 | ||
| 17 | #define SO_CONNOPT 0x7001 | ||
| 18 | #define SO_DISCDATA 0x7002 | ||
| 19 | #define SO_DISCOPT 0x7003 | ||
| 20 | #define SO_CONNDATALEN 0x7004 | ||
| 21 | #define SO_CONNOPTLEN 0x7005 | ||
| 22 | #define SO_DISCDATALEN 0x7006 | ||
| 23 | #define SO_DISCOPTLEN 0x7007 | ||
| 24 | |||
| 25 | #define SO_OPENTYPE 0x7008 | ||
| 26 | |||
| 27 | #define SO_SYNCHRONOUS_ALERT 0x10 | ||
| 28 | #define SO_SYNCHRONOUS_NONALERT 0x20 | ||
| 29 | |||
| 30 | #define SO_MAXDG 0x7009 | ||
| 31 | #define SO_MAXPATHDG 0x700A | ||
| 32 | #define SO_UPDATE_ACCEPT_CONTEXT 0x700B | ||
| 33 | #define SO_CONNECT_TIME 0x700C | ||
| 34 | #define SO_UPDATE_CONNECT_CONTEXT 0x7010 | ||
| 35 | |||
| 36 | #define TCP_BSDURGENT 0x7000 | ||
| 37 | |||
| 38 | #define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) | ||
| 39 | #if (_WIN32_WINNT < 0x0600) && (_WIN32_WINNT >= 0x0501) | ||
| 40 | #define SIO_SOCKET_CLOSE_NOTIFY _WSAIOW(IOC_VENDOR,13) | ||
| 41 | #endif /* >= XP && < VISTA */ | ||
| 42 | #if (_WIN32_WINNT >= 0x0600) | ||
| 43 | #define SIO_BSP_HANDLE _WSAIOR(IOC_WS2,27) | ||
| 44 | #define SIO_BSP_HANDLE_SELECT _WSAIOR(IOC_WS2,28) | ||
| 45 | #define SIO_BSP_HANDLE_POLL _WSAIOR(IOC_WS2,29) | ||
| 46 | |||
| 47 | #define SIO_EXT_SELECT _WSAIORW(IOC_WS2,30) | ||
| 48 | #define SIO_EXT_POLL _WSAIORW(IOC_WS2,31) | ||
| 49 | #define SIO_EXT_SENDMSG _WSAIORW(IOC_WS2,32) | ||
| 50 | |||
| 51 | #define SIO_BASE_HANDLE _WSAIOR(IOC_WS2,34) | ||
| 52 | #endif /* _WIN32_WINNT >= 0x0600 */ | ||
| 53 | |||
| 54 | #ifndef __MSWSOCK_WS1_SHARED | ||
| 55 | int WINAPI WSARecvEx(SOCKET s,char *buf,int len,int *flags); | ||
| 56 | #endif /* __MSWSOCK_WS1_SHARED */ | ||
| 57 | |||
| 58 | #define TF_DISCONNECT 0x01 | ||
| 59 | #define TF_REUSE_SOCKET 0x02 | ||
| 60 | #define TF_WRITE_BEHIND 0x04 | ||
| 61 | #define TF_USE_DEFAULT_WORKER 0x00 | ||
| 62 | #define TF_USE_SYSTEM_THREAD 0x10 | ||
| 63 | #define TF_USE_KERNEL_APC 0x20 | ||
| 64 | |||
| 65 | #include <psdk_inc/_xmitfile.h> | ||
| 66 | #ifndef __MSWSOCK_WS1_SHARED | ||
| 67 | WINBOOL WINAPI TransmitFile(SOCKET hSocket,HANDLE hFile,DWORD nNumberOfBytesToWrite,DWORD nNumberOfBytesPerSend,LPOVERLAPPED lpOverlapped,LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,DWORD dwReserved); | ||
| 68 | WINBOOL WINAPI AcceptEx(SOCKET sListenSocket,SOCKET sAcceptSocket,PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,LPDWORD lpdwBytesReceived,LPOVERLAPPED lpOverlapped); | ||
| 69 | VOID WINAPI GetAcceptExSockaddrs(PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,struct sockaddr **LocalSockaddr,LPINT LocalSockaddrLength,struct sockaddr **RemoteSockaddr,LPINT RemoteSockaddrLength); | ||
| 70 | #endif /* __MSWSOCK_WS1_SHARED */ | ||
| 71 | |||
| 72 | typedef WINBOOL (WINAPI *LPFN_TRANSMITFILE)(SOCKET hSocket,HANDLE hFile,DWORD nNumberOfBytesToWrite,DWORD nNumberOfBytesPerSend,LPOVERLAPPED lpOverlapped,LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,DWORD dwReserved); | ||
| 73 | |||
| 74 | #define WSAID_TRANSMITFILE {0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}} | ||
| 75 | |||
| 76 | typedef WINBOOL (WINAPI *LPFN_ACCEPTEX)(SOCKET sListenSocket,SOCKET sAcceptSocket,PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,LPDWORD lpdwBytesReceived,LPOVERLAPPED lpOverlapped); | ||
| 77 | |||
| 78 | #define WSAID_ACCEPTEX {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}} | ||
| 79 | |||
| 80 | typedef VOID (WINAPI *LPFN_GETACCEPTEXSOCKADDRS)(PVOID lpOutputBuffer,DWORD dwReceiveDataLength,DWORD dwLocalAddressLength,DWORD dwRemoteAddressLength,struct sockaddr **LocalSockaddr,LPINT LocalSockaddrLength,struct sockaddr **RemoteSockaddr,LPINT RemoteSockaddrLength); | ||
| 81 | |||
| 82 | #define WSAID_GETACCEPTEXSOCKADDRS {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}} | ||
| 83 | |||
| 84 | typedef struct _TRANSMIT_PACKETS_ELEMENT { | ||
| 85 | ULONG dwElFlags; | ||
| 86 | #define TP_ELEMENT_MEMORY 1 | ||
| 87 | #define TP_ELEMENT_FILE 2 | ||
| 88 | #define TP_ELEMENT_EOP 4 | ||
| 89 | ULONG cLength; | ||
| 90 | __C89_NAMELESS union { | ||
| 91 | __C89_NAMELESS struct { | ||
| 92 | LARGE_INTEGER nFileOffset; | ||
| 93 | HANDLE hFile; | ||
| 94 | }; | ||
| 95 | PVOID pBuffer; | ||
| 96 | }; | ||
| 97 | } TRANSMIT_PACKETS_ELEMENT,*PTRANSMIT_PACKETS_ELEMENT,*LPTRANSMIT_PACKETS_ELEMENT; | ||
| 98 | |||
| 99 | #define TP_DISCONNECT TF_DISCONNECT | ||
| 100 | #define TP_REUSE_SOCKET TF_REUSE_SOCKET | ||
| 101 | #define TP_USE_DEFAULT_WORKER TF_USE_DEFAULT_WORKER | ||
| 102 | #define TP_USE_SYSTEM_THREAD TF_USE_SYSTEM_THREAD | ||
| 103 | #define TP_USE_KERNEL_APC TF_USE_KERNEL_APC | ||
| 104 | |||
| 105 | typedef WINBOOL (WINAPI *LPFN_TRANSMITPACKETS) (SOCKET hSocket,LPTRANSMIT_PACKETS_ELEMENT lpPacketArray,DWORD nElementCount,DWORD nSendSize,LPOVERLAPPED lpOverlapped,DWORD dwFlags); | ||
| 106 | |||
| 107 | #define WSAID_TRANSMITPACKETS {0xd9689da0,0x1f90,0x11d3,{0x99,0x71,0x00,0xc0,0x4f,0x68,0xc8,0x76}} | ||
| 108 | |||
| 109 | typedef WINBOOL (WINAPI *LPFN_CONNECTEX)(SOCKET s,const struct sockaddr *name,int namelen,PVOID lpSendBuffer,DWORD dwSendDataLength,LPDWORD lpdwBytesSent,LPOVERLAPPED lpOverlapped); | ||
| 110 | |||
| 111 | #define WSAID_CONNECTEX {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}} | ||
| 112 | |||
| 113 | typedef WINBOOL (WINAPI *LPFN_DISCONNECTEX)(SOCKET s,LPOVERLAPPED lpOverlapped,DWORD dwFlags,DWORD dwReserved); | ||
| 114 | |||
| 115 | #define WSAID_DISCONNECTEX {0x7fda2e11,0x8630,0x436f,{0xa0,0x31,0xf5,0x36,0xa6,0xee,0xc1,0x57}} | ||
| 116 | |||
| 117 | #define DE_REUSE_SOCKET TF_REUSE_SOCKET | ||
| 118 | |||
| 119 | #define NLA_NAMESPACE_GUID {0x6642243a,0x3ba8,0x4aa6,{0xba,0xa5,0x2e,0xb,0xd7,0x1f,0xdd,0x83}} | ||
| 120 | |||
| 121 | #define NLA_SERVICE_CLASS_GUID {0x37e515,0xb5c9,0x4a43,{0xba,0xda,0x8b,0x48,0xa8,0x7a,0xd2,0x39}} | ||
| 122 | |||
| 123 | #define NLA_ALLUSERS_NETWORK 0x00000001 | ||
| 124 | #define NLA_FRIENDLY_NAME 0x00000002 | ||
| 125 | |||
| 126 | typedef enum _NLA_BLOB_DATA_TYPE { | ||
| 127 | NLA_RAW_DATA = 0,NLA_INTERFACE = 1,NLA_802_1X_LOCATION = 2,NLA_CONNECTIVITY = 3,NLA_ICS = 4 | ||
| 128 | } NLA_BLOB_DATA_TYPE,*PNLA_BLOB_DATA_TYPE; | ||
| 129 | |||
| 130 | typedef enum _NLA_CONNECTIVITY_TYPE { | ||
| 131 | NLA_NETWORK_AD_HOC = 0,NLA_NETWORK_MANAGED = 1,NLA_NETWORK_UNMANAGED = 2,NLA_NETWORK_UNKNOWN = 3 | ||
| 132 | } NLA_CONNECTIVITY_TYPE,*PNLA_CONNECTIVITY_TYPE; | ||
| 133 | |||
| 134 | typedef enum _NLA_INTERNET { | ||
| 135 | NLA_INTERNET_UNKNOWN = 0,NLA_INTERNET_NO = 1,NLA_INTERNET_YES = 2 | ||
| 136 | } NLA_INTERNET,*PNLA_INTERNET; | ||
| 137 | |||
| 138 | typedef struct _NLA_BLOB { | ||
| 139 | struct { | ||
| 140 | NLA_BLOB_DATA_TYPE type; | ||
| 141 | DWORD dwSize; | ||
| 142 | DWORD nextOffset; | ||
| 143 | } header; | ||
| 144 | union { | ||
| 145 | CHAR rawData[1]; | ||
| 146 | struct { | ||
| 147 | DWORD dwType; | ||
| 148 | DWORD dwSpeed; | ||
| 149 | CHAR adapterName[1]; | ||
| 150 | } interfaceData; | ||
| 151 | struct { | ||
| 152 | CHAR information[1]; | ||
| 153 | } locationData; | ||
| 154 | struct { | ||
| 155 | NLA_CONNECTIVITY_TYPE type; | ||
| 156 | NLA_INTERNET internet; | ||
| 157 | } connectivity; | ||
| 158 | struct { | ||
| 159 | struct { | ||
| 160 | DWORD speed; | ||
| 161 | DWORD type; | ||
| 162 | DWORD state; | ||
| 163 | WCHAR machineName[256]; | ||
| 164 | WCHAR sharedAdapterName[256]; | ||
| 165 | } remote; | ||
| 166 | } ICS; | ||
| 167 | } data; | ||
| 168 | } NLA_BLOB,*PNLA_BLOB,*LPNLA_BLOB; | ||
| 169 | |||
| 170 | typedef struct _WSACMSGHDR { | ||
| 171 | SIZE_T cmsg_len; | ||
| 172 | INT cmsg_level; | ||
| 173 | INT cmsg_type; | ||
| 174 | } WSACMSGHDR,*PWSACMSGHDR,*LPWSACMSGHDR; | ||
| 175 | |||
| 176 | #define WSA_CMSGHDR_ALIGN(length) (((length) + TYPE_ALIGNMENT(WSACMSGHDR)-1) & (~(TYPE_ALIGNMENT(WSACMSGHDR)-1))) | ||
| 177 | #define WSA_CMSGDATA_ALIGN(length) (((length) + MAX_NATURAL_ALIGNMENT-1) & (~(MAX_NATURAL_ALIGNMENT-1))) | ||
| 178 | #define WSA_CMSG_FIRSTHDR(msg) (((msg)->Control.len >= sizeof(WSACMSGHDR)) ? (LPWSACMSGHDR)(msg)->Control.buf : (LPWSACMSGHDR)NULL) | ||
| 179 | #define WSA_CMSG_NXTHDR(msg,cmsg) ((!(cmsg)) ? WSA_CMSG_FIRSTHDR(msg) : ((((u_char *)(cmsg) + WSA_CMSGHDR_ALIGN((cmsg)->cmsg_len) + sizeof(WSACMSGHDR)) > (u_char *)((msg)->Control.buf) + (msg)->Control.len) ? (LPWSACMSGHDR)NULL : (LPWSACMSGHDR)((u_char *)(cmsg) + WSA_CMSGHDR_ALIGN((cmsg)->cmsg_len)))) | ||
| 180 | #define WSA_CMSG_DATA(cmsg) ((u_char *)(cmsg) + WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR))) | ||
| 181 | #define WSA_CMSG_SPACE(length) (WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR) + WSA_CMSGHDR_ALIGN(length))) | ||
| 182 | #define WSA_CMSG_LEN(length) (WSA_CMSGDATA_ALIGN(sizeof(WSACMSGHDR)) + length) | ||
| 183 | |||
| 184 | #define MSG_TRUNC 0x0100 | ||
| 185 | #define MSG_CTRUNC 0x0200 | ||
| 186 | #define MSG_BCAST 0x0400 | ||
| 187 | #define MSG_MCAST 0x0800 | ||
| 188 | |||
| 189 | #ifdef __cplusplus | ||
| 190 | } | ||
| 191 | #endif | ||
| 192 | |||
| 193 | #endif /* _MSWSOCK_ */ | ||
| @@ -1,26 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef ___WSA_FD_TYPES_H | ||
| 8 | #define ___WSA_FD_TYPES_H | ||
| 9 | |||
| 10 | #include <psdk_inc/_socket_types.h> | ||
| 11 | |||
| 12 | #ifndef FD_SETSIZE | ||
| 13 | #define FD_SETSIZE 64 | ||
| 14 | #endif | ||
| 15 | typedef struct fd_set | ||
| 16 | { | ||
| 17 | u_int fd_count; | ||
| 18 | SOCKET fd_array[FD_SETSIZE]; | ||
| 19 | } fd_set; | ||
| 20 | |||
| 21 | typedef struct fd_set FD_SET; | ||
| 22 | typedef struct fd_set *PFD_SET; | ||
| 23 | typedef struct fd_set *LPFD_SET; | ||
| 24 | |||
| 25 | #endif /* ___WSA_FD_TYPES_H */ | ||
| 26 | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _MINGW_IP_MREQ1_H | ||
| 8 | #define _MINGW_IP_MREQ1_H | ||
| 9 | |||
| 10 | #include <inaddr.h> | ||
| 11 | |||
| 12 | struct ip_mreq { | ||
| 13 | struct in_addr imr_multiaddr; | ||
| 14 | struct in_addr imr_interface; | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif /* _MINGW_IP_MREQ1_H */ | ||
| 18 | |||
| @@ -1,104 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _MINGW_IP_TYPES_H | ||
| 8 | #define _MINGW_IP_TYPES_H | ||
| 9 | |||
| 10 | #include <_bsd_types.h> | ||
| 11 | |||
| 12 | #define h_addr h_addr_list[0] | ||
| 13 | |||
| 14 | struct hostent { | ||
| 15 | char *h_name; | ||
| 16 | char **h_aliases; | ||
| 17 | short h_addrtype; | ||
| 18 | short h_length; | ||
| 19 | char **h_addr_list; | ||
| 20 | }; | ||
| 21 | |||
| 22 | struct netent { | ||
| 23 | char *n_name; | ||
| 24 | char **n_aliases; | ||
| 25 | short n_addrtype; | ||
| 26 | u_long n_net; | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct servent { | ||
| 30 | char *s_name; | ||
| 31 | char **s_aliases; | ||
| 32 | #ifdef _WIN64 | ||
| 33 | char *s_proto; | ||
| 34 | short s_port; | ||
| 35 | #else | ||
| 36 | short s_port; | ||
| 37 | char *s_proto; | ||
| 38 | #endif | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct protoent { | ||
| 42 | char *p_name; | ||
| 43 | char **p_aliases; | ||
| 44 | short p_proto; | ||
| 45 | }; | ||
| 46 | |||
| 47 | typedef struct hostent HOSTENT; | ||
| 48 | typedef struct hostent *PHOSTENT; | ||
| 49 | typedef struct hostent *LPHOSTENT; | ||
| 50 | |||
| 51 | typedef struct servent SERVENT; | ||
| 52 | typedef struct servent *PSERVENT; | ||
| 53 | typedef struct servent *LPSERVENT; | ||
| 54 | |||
| 55 | typedef struct protoent PROTOENT; | ||
| 56 | typedef struct protoent *PPROTOENT; | ||
| 57 | typedef struct protoent *LPPROTOENT; | ||
| 58 | |||
| 59 | |||
| 60 | #include <inaddr.h> | ||
| 61 | |||
| 62 | struct sockaddr_in { | ||
| 63 | short sin_family; | ||
| 64 | u_short sin_port; | ||
| 65 | struct in_addr sin_addr; | ||
| 66 | char sin_zero[8]; | ||
| 67 | }; | ||
| 68 | |||
| 69 | struct sockaddr { | ||
| 70 | u_short sa_family; | ||
| 71 | char sa_data[14]; | ||
| 72 | }; | ||
| 73 | |||
| 74 | struct sockproto { | ||
| 75 | u_short sp_family; | ||
| 76 | u_short sp_protocol; | ||
| 77 | }; | ||
| 78 | |||
| 79 | struct linger { | ||
| 80 | u_short l_onoff; | ||
| 81 | u_short l_linger; | ||
| 82 | }; | ||
| 83 | |||
| 84 | typedef struct sockaddr SOCKADDR; | ||
| 85 | typedef struct sockaddr *PSOCKADDR; | ||
| 86 | typedef struct sockaddr *LPSOCKADDR; | ||
| 87 | |||
| 88 | typedef struct sockaddr_in SOCKADDR_IN; | ||
| 89 | typedef struct sockaddr_in *PSOCKADDR_IN; | ||
| 90 | typedef struct sockaddr_in *LPSOCKADDR_IN; | ||
| 91 | |||
| 92 | typedef struct linger LINGER; | ||
| 93 | typedef struct linger *PLINGER; | ||
| 94 | typedef struct linger *LPLINGER; | ||
| 95 | |||
| 96 | |||
| 97 | #include <_timeval.h> | ||
| 98 | |||
| 99 | typedef struct timeval TIMEVAL; | ||
| 100 | typedef struct timeval *PTIMEVAL; | ||
| 101 | typedef struct timeval *LPTIMEVAL; | ||
| 102 | |||
| 103 | #endif /* _MINGW_IP_TYPES_H */ | ||
| 104 | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef ___WSA_SOCKET_TYPES_H | ||
| 8 | #define ___WSA_SOCKET_TYPES_H | ||
| 9 | |||
| 10 | #if 1 | ||
| 11 | typedef UINT_PTR SOCKET; | ||
| 12 | #else | ||
| 13 | typedef INT_PTR SOCKET; | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #define INVALID_SOCKET (SOCKET)(~0) | ||
| 17 | #define SOCKET_ERROR (-1) | ||
| 18 | |||
| 19 | #endif /* ___WSA_SOCKET_TYPES_H */ | ||
| 20 | |||
| @@ -1,248 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #undef FD_CLR | ||
| 8 | #undef FD_ZERO | ||
| 9 | #undef FD_ISSET | ||
| 10 | #undef FD_SET | ||
| 11 | |||
| 12 | #undef IOCPARM_MASK | ||
| 13 | #undef IOC_VOID | ||
| 14 | #undef IOC_OUT | ||
| 15 | #undef IOC_IN | ||
| 16 | #undef IOC_INOUT | ||
| 17 | |||
| 18 | #undef _IO | ||
| 19 | #undef _IOR | ||
| 20 | #undef _IOW | ||
| 21 | |||
| 22 | #undef FIONREAD | ||
| 23 | #undef FIONBIO | ||
| 24 | #undef FIOASYNC | ||
| 25 | |||
| 26 | #undef SIOCSHIWAT | ||
| 27 | #undef SIOCGHIWAT | ||
| 28 | #undef SIOCSLOWAT | ||
| 29 | #undef SIOCGLOWAT | ||
| 30 | #undef SIOCATMARK | ||
| 31 | |||
| 32 | #undef IPPROTO_IP | ||
| 33 | #undef IPPROTO_ICMP | ||
| 34 | #undef IPPROTO_IGMP | ||
| 35 | #undef IPPROTO_GGP | ||
| 36 | #undef IPPROTO_TCP | ||
| 37 | #undef IPPROTO_PUP | ||
| 38 | #undef IPPROTO_UDP | ||
| 39 | #undef IPPROTO_IDP | ||
| 40 | #undef IPPROTO_ND | ||
| 41 | |||
| 42 | #undef IPPROTO_RAW | ||
| 43 | #undef IPPROTO_MAX | ||
| 44 | |||
| 45 | #undef IPPORT_ECHO | ||
| 46 | #undef IPPORT_DISCARD | ||
| 47 | #undef IPPORT_SYSTAT | ||
| 48 | #undef IPPORT_DAYTIME | ||
| 49 | #undef IPPORT_NETSTAT | ||
| 50 | #undef IPPORT_FTP | ||
| 51 | #undef IPPORT_TELNET | ||
| 52 | #undef IPPORT_SMTP | ||
| 53 | #undef IPPORT_TIMESERVER | ||
| 54 | #undef IPPORT_NAMESERVER | ||
| 55 | #undef IPPORT_WHOIS | ||
| 56 | #undef IPPORT_MTP | ||
| 57 | |||
| 58 | #undef IPPORT_TFTP | ||
| 59 | #undef IPPORT_RJE | ||
| 60 | #undef IPPORT_FINGER | ||
| 61 | #undef IPPORT_TTYLINK | ||
| 62 | #undef IPPORT_SUPDUP | ||
| 63 | |||
| 64 | #undef IPPORT_EXECSERVER | ||
| 65 | #undef IPPORT_LOGINSERVER | ||
| 66 | #undef IPPORT_CMDSERVER | ||
| 67 | #undef IPPORT_EFSSERVER | ||
| 68 | |||
| 69 | #undef IPPORT_BIFFUDP | ||
| 70 | #undef IPPORT_WHOSERVER | ||
| 71 | #undef IPPORT_ROUTESERVER | ||
| 72 | |||
| 73 | #undef IPPORT_RESERVED | ||
| 74 | |||
| 75 | #undef IMPLINK_IP | ||
| 76 | #undef IMPLINK_LOWEXPER | ||
| 77 | #undef IMPLINK_HIGHEXPER | ||
| 78 | |||
| 79 | #undef IN_CLASSA | ||
| 80 | #undef IN_CLASSA_NET | ||
| 81 | #undef IN_CLASSA_NSHIFT | ||
| 82 | #undef IN_CLASSA_HOST | ||
| 83 | #undef IN_CLASSA_MAX | ||
| 84 | |||
| 85 | #undef IN_CLASSB | ||
| 86 | #undef IN_CLASSB_NET | ||
| 87 | #undef IN_CLASSB_NSHIFT | ||
| 88 | #undef IN_CLASSB_HOST | ||
| 89 | #undef IN_CLASSB_MAX | ||
| 90 | |||
| 91 | #undef IN_CLASSC | ||
| 92 | #undef IN_CLASSC_NET | ||
| 93 | #undef IN_CLASSC_NSHIFT | ||
| 94 | #undef IN_CLASSC_HOST | ||
| 95 | |||
| 96 | #undef INADDR_ANY | ||
| 97 | #undef INADDR_LOOPBACK | ||
| 98 | #undef INADDR_BROADCAST | ||
| 99 | #undef INADDR_NONE | ||
| 100 | |||
| 101 | #undef IP_OPTIONS | ||
| 102 | #undef IP_MULTICAST_IF | ||
| 103 | #undef IP_MULTICAST_TTL | ||
| 104 | #undef IP_MULTICAST_LOOP | ||
| 105 | #undef IP_ADD_MEMBERSHIP | ||
| 106 | #undef IP_DROP_MEMBERSHIP | ||
| 107 | #undef IP_TTL | ||
| 108 | #undef IP_TOS | ||
| 109 | #undef IP_DONTFRAGMENT | ||
| 110 | |||
| 111 | #undef IP_DEFAULT_MULTICAST_TTL | ||
| 112 | #undef IP_DEFAULT_MULTICAST_LOOP | ||
| 113 | #undef IP_MAX_MEMBERSHIPS | ||
| 114 | |||
| 115 | #undef SOCK_STREAM | ||
| 116 | #undef SOCK_DGRAM | ||
| 117 | #undef SOCK_RAW | ||
| 118 | #undef SOCK_RDM | ||
| 119 | #undef SOCK_SEQPACKET | ||
| 120 | |||
| 121 | #undef SO_DEBUG | ||
| 122 | #undef SO_ACCEPTCONN | ||
| 123 | #undef SO_REUSEADDR | ||
| 124 | #undef SO_KEEPALIVE | ||
| 125 | #undef SO_DONTROUTE | ||
| 126 | #undef SO_BROADCAST | ||
| 127 | #undef SO_USELOOPBACK | ||
| 128 | #undef SO_LINGER | ||
| 129 | #undef SO_OOBINLINE | ||
| 130 | |||
| 131 | #undef SO_DONTLINGER | ||
| 132 | |||
| 133 | #undef SO_SNDBUF | ||
| 134 | #undef SO_RCVBUF | ||
| 135 | #undef SO_SNDLOWAT | ||
| 136 | #undef SO_RCVLOWAT | ||
| 137 | #undef SO_SNDTIMEO | ||
| 138 | #undef SO_RCVTIMEO | ||
| 139 | #undef SO_ERROR | ||
| 140 | #undef SO_TYPE | ||
| 141 | |||
| 142 | #undef SO_CONNDATA | ||
| 143 | #undef SO_CONNOPT | ||
| 144 | #undef SO_DISCDATA | ||
| 145 | #undef SO_DISCOPT | ||
| 146 | #undef SO_CONNDATALEN | ||
| 147 | #undef SO_CONNOPTLEN | ||
| 148 | #undef SO_DISCDATALEN | ||
| 149 | #undef SO_DISCOPTLEN | ||
| 150 | |||
| 151 | #undef SO_OPENTYPE | ||
| 152 | |||
| 153 | #undef SO_SYNCHRONOUS_ALERT | ||
| 154 | #undef SO_SYNCHRONOUS_NONALERT | ||
| 155 | |||
| 156 | #undef SO_MAXDG | ||
| 157 | #undef SO_MAXPATHDG | ||
| 158 | #undef SO_UPDATE_ACCEPT_CONTEXT | ||
| 159 | #undef SO_CONNECT_TIME | ||
| 160 | |||
| 161 | #undef TCP_NODELAY | ||
| 162 | #undef TCP_BSDURGENT | ||
| 163 | |||
| 164 | #undef AF_UNSPEC | ||
| 165 | #undef AF_UNIX | ||
| 166 | #undef AF_INET | ||
| 167 | #undef AF_IMPLINK | ||
| 168 | #undef AF_PUP | ||
| 169 | #undef AF_CHAOS | ||
| 170 | #undef AF_IPX | ||
| 171 | #undef AF_NS | ||
| 172 | #undef AF_ISO | ||
| 173 | #undef AF_OSI | ||
| 174 | #undef AF_ECMA | ||
| 175 | #undef AF_DATAKIT | ||
| 176 | #undef AF_CCITT | ||
| 177 | #undef AF_SNA | ||
| 178 | #undef AF_DECnet | ||
| 179 | #undef AF_DLI | ||
| 180 | #undef AF_LAT | ||
| 181 | #undef AF_HYLINK | ||
| 182 | #undef AF_APPLETALK | ||
| 183 | #undef AF_NETBIOS | ||
| 184 | #undef AF_VOICEVIEW | ||
| 185 | #undef AF_FIREFOX | ||
| 186 | #undef AF_UNKNOWN1 | ||
| 187 | #undef AF_BAN | ||
| 188 | |||
| 189 | #undef AF_MAX | ||
| 190 | |||
| 191 | #undef PF_UNSPEC | ||
| 192 | #undef PF_UNIX | ||
| 193 | #undef PF_INET | ||
| 194 | #undef PF_IMPLINK | ||
| 195 | #undef PF_PUP | ||
| 196 | #undef PF_CHAOS | ||
| 197 | #undef PF_NS | ||
| 198 | #undef PF_IPX | ||
| 199 | #undef PF_ISO | ||
| 200 | #undef PF_OSI | ||
| 201 | #undef PF_ECMA | ||
| 202 | #undef PF_DATAKIT | ||
| 203 | #undef PF_CCITT | ||
| 204 | #undef PF_SNA | ||
| 205 | #undef PF_DECnet | ||
| 206 | #undef PF_DLI | ||
| 207 | #undef PF_LAT | ||
| 208 | #undef PF_HYLINK | ||
| 209 | #undef PF_APPLETALK | ||
| 210 | #undef PF_VOICEVIEW | ||
| 211 | #undef PF_FIREFOX | ||
| 212 | #undef PF_UNKNOWN1 | ||
| 213 | #undef PF_BAN | ||
| 214 | |||
| 215 | #undef PF_MAX | ||
| 216 | |||
| 217 | #undef SOL_SOCKET | ||
| 218 | |||
| 219 | #undef SOMAXCONN | ||
| 220 | |||
| 221 | #undef MSG_OOB | ||
| 222 | #undef MSG_PEEK | ||
| 223 | #undef MSG_DONTROUTE | ||
| 224 | |||
| 225 | #undef MSG_MAXIOVLEN | ||
| 226 | |||
| 227 | #undef MSG_PARTIAL | ||
| 228 | |||
| 229 | #undef MAXGETHOSTSTRUCT | ||
| 230 | |||
| 231 | #undef FD_READ | ||
| 232 | #undef FD_WRITE | ||
| 233 | #undef FD_OOB | ||
| 234 | #undef FD_ACCEPT | ||
| 235 | #undef FD_CONNECT | ||
| 236 | #undef FD_CLOSE | ||
| 237 | |||
| 238 | #undef TF_DISCONNECT | ||
| 239 | #undef TF_REUSE_SOCKET | ||
| 240 | #undef TF_WRITE_BEHIND | ||
| 241 | |||
| 242 | #undef WSAMAKEASYNCREPLY | ||
| 243 | #undef WSAMAKESELECTREPLY | ||
| 244 | #undef WSAGETASYNCBUFLEN | ||
| 245 | #undef WSAGETASYNCERROR | ||
| 246 | #undef WSAGETSELECTEVENT | ||
| 247 | #undef WSAGETSELECTERROR | ||
| 248 | |||
| @@ -1,225 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef WSABASEERR | ||
| 8 | |||
| 9 | #define WSABASEERR 10000 | ||
| 10 | |||
| 11 | #define WSAEINTR (WSABASEERR + 4 ) | ||
| 12 | #define WSAEBADF (WSABASEERR + 9 ) | ||
| 13 | #define WSAEACCES (WSABASEERR + 13 ) | ||
| 14 | #define WSAEFAULT (WSABASEERR + 14 ) | ||
| 15 | #define WSAEINVAL (WSABASEERR + 22 ) | ||
| 16 | #define WSAEMFILE (WSABASEERR + 24 ) | ||
| 17 | |||
| 18 | #define WSAEWOULDBLOCK (WSABASEERR + 35 ) | ||
| 19 | #define WSAEINPROGRESS (WSABASEERR + 36 ) | ||
| 20 | #define WSAEALREADY (WSABASEERR + 37 ) | ||
| 21 | #define WSAENOTSOCK (WSABASEERR + 38 ) | ||
| 22 | #define WSAEDESTADDRREQ (WSABASEERR + 39 ) | ||
| 23 | #define WSAEMSGSIZE (WSABASEERR + 40 ) | ||
| 24 | #define WSAEPROTOTYPE (WSABASEERR + 41 ) | ||
| 25 | #define WSAENOPROTOOPT (WSABASEERR + 42 ) | ||
| 26 | #define WSAEPROTONOSUPPORT (WSABASEERR + 43 ) | ||
| 27 | #define WSAESOCKTNOSUPPORT (WSABASEERR + 44 ) | ||
| 28 | #define WSAEOPNOTSUPP (WSABASEERR + 45 ) | ||
| 29 | #define WSAEPFNOSUPPORT (WSABASEERR + 46 ) | ||
| 30 | #define WSAEAFNOSUPPORT (WSABASEERR + 47 ) | ||
| 31 | #define WSAEADDRINUSE (WSABASEERR + 48 ) | ||
| 32 | #define WSAEADDRNOTAVAIL (WSABASEERR + 49 ) | ||
| 33 | #define WSAENETDOWN (WSABASEERR + 50 ) | ||
| 34 | #define WSAENETUNREACH (WSABASEERR + 51 ) | ||
| 35 | #define WSAENETRESET (WSABASEERR + 52 ) | ||
| 36 | #define WSAECONNABORTED (WSABASEERR + 53 ) | ||
| 37 | #define WSAECONNRESET (WSABASEERR + 54 ) | ||
| 38 | #define WSAENOBUFS (WSABASEERR + 55 ) | ||
| 39 | #define WSAEISCONN (WSABASEERR + 56 ) | ||
| 40 | #define WSAENOTCONN (WSABASEERR + 57 ) | ||
| 41 | #define WSAESHUTDOWN (WSABASEERR + 58 ) | ||
| 42 | #define WSAETOOMANYREFS (WSABASEERR + 59 ) | ||
| 43 | #define WSAETIMEDOUT (WSABASEERR + 60 ) | ||
| 44 | #define WSAECONNREFUSED (WSABASEERR + 61 ) | ||
| 45 | #define WSAELOOP (WSABASEERR + 62 ) | ||
| 46 | #define WSAENAMETOOLONG (WSABASEERR + 63 ) | ||
| 47 | #define WSAEHOSTDOWN (WSABASEERR + 64 ) | ||
| 48 | #define WSAEHOSTUNREACH (WSABASEERR + 65 ) | ||
| 49 | #define WSAENOTEMPTY (WSABASEERR + 66 ) | ||
| 50 | #define WSAEPROCLIM (WSABASEERR + 67 ) | ||
| 51 | #define WSAEUSERS (WSABASEERR + 68 ) | ||
| 52 | #define WSAEDQUOT (WSABASEERR + 69 ) | ||
| 53 | #define WSAESTALE (WSABASEERR + 70 ) | ||
| 54 | #define WSAEREMOTE (WSABASEERR + 71 ) | ||
| 55 | |||
| 56 | #define WSASYSNOTREADY (WSABASEERR + 91 ) | ||
| 57 | #define WSAVERNOTSUPPORTED (WSABASEERR + 92 ) | ||
| 58 | #define WSANOTINITIALISED (WSABASEERR + 93 ) | ||
| 59 | |||
| 60 | #define WSAEDISCON (WSABASEERR + 101 ) | ||
| 61 | |||
| 62 | #ifndef WSAHOST_NOT_FOUND | ||
| 63 | #define WSAHOST_NOT_FOUND (WSABASEERR + 1001) | ||
| 64 | #endif | ||
| 65 | #ifndef WSATRY_AGAIN | ||
| 66 | #define WSATRY_AGAIN (WSABASEERR + 1002) | ||
| 67 | #endif | ||
| 68 | #ifndef WSANO_RECOVERY | ||
| 69 | #define WSANO_RECOVERY (WSABASEERR + 1003) | ||
| 70 | #endif | ||
| 71 | #ifndef WSANO_DATA | ||
| 72 | #define WSANO_DATA (WSABASEERR + 1004) | ||
| 73 | #endif | ||
| 74 | |||
| 75 | #endif /* WSABASEERR */ | ||
| 76 | |||
| 77 | #ifdef _WINSOCK2API_ | ||
| 78 | |||
| 79 | #ifndef WSAENOMORE | ||
| 80 | #define WSAENOMORE (WSABASEERR + 102) | ||
| 81 | #endif | ||
| 82 | #ifndef WSAECANCELLED | ||
| 83 | #define WSAECANCELLED (WSABASEERR + 103) | ||
| 84 | #endif | ||
| 85 | #ifndef WSAEINVALIDPROCTABLE | ||
| 86 | #define WSAEINVALIDPROCTABLE (WSABASEERR + 104) | ||
| 87 | #endif | ||
| 88 | #ifndef WSAEINVALIDPROVIDER | ||
| 89 | #define WSAEINVALIDPROVIDER (WSABASEERR + 105) | ||
| 90 | #endif | ||
| 91 | #ifndef WSAEPROVIDERFAILEDINIT | ||
| 92 | #define WSAEPROVIDERFAILEDINIT (WSABASEERR + 106) | ||
| 93 | #endif | ||
| 94 | #ifndef WSASYSCALLFAILURE | ||
| 95 | #define WSASYSCALLFAILURE (WSABASEERR + 107) | ||
| 96 | #endif | ||
| 97 | #ifndef WSASERVICE_NOT_FOUND | ||
| 98 | #define WSASERVICE_NOT_FOUND (WSABASEERR + 108) | ||
| 99 | #endif | ||
| 100 | #ifndef WSATYPE_NOT_FOUND | ||
| 101 | #define WSATYPE_NOT_FOUND (WSABASEERR + 109) | ||
| 102 | #endif | ||
| 103 | #ifndef WSA_E_NO_MORE | ||
| 104 | #define WSA_E_NO_MORE (WSABASEERR + 110) | ||
| 105 | #endif | ||
| 106 | #ifndef WSA_E_CANCELLED | ||
| 107 | #define WSA_E_CANCELLED (WSABASEERR + 111) | ||
| 108 | #endif | ||
| 109 | #ifndef WSAEREFUSED | ||
| 110 | #define WSAEREFUSED (WSABASEERR + 112) | ||
| 111 | #endif | ||
| 112 | #ifndef WSA_QOS_RECEIVERS | ||
| 113 | #define WSA_QOS_RECEIVERS (WSABASEERR + 1005) | ||
| 114 | #endif | ||
| 115 | #ifndef WSA_QOS_SENDERS | ||
| 116 | #define WSA_QOS_SENDERS (WSABASEERR + 1006) | ||
| 117 | #endif | ||
| 118 | #ifndef WSA_QOS_NO_SENDERS | ||
| 119 | #define WSA_QOS_NO_SENDERS (WSABASEERR + 1007) | ||
| 120 | #define WSA_QOS_NO_RECEIVERS (WSABASEERR + 1008) | ||
| 121 | #define WSA_QOS_REQUEST_CONFIRMED (WSABASEERR + 1009) | ||
| 122 | #define WSA_QOS_ADMISSION_FAILURE (WSABASEERR + 1010) | ||
| 123 | #define WSA_QOS_POLICY_FAILURE (WSABASEERR + 1011) | ||
| 124 | #define WSA_QOS_BAD_STYLE (WSABASEERR + 1012) | ||
| 125 | #define WSA_QOS_BAD_OBJECT (WSABASEERR + 1013) | ||
| 126 | #define WSA_QOS_TRAFFIC_CTRL_ERROR (WSABASEERR + 1014) | ||
| 127 | #define WSA_QOS_GENERIC_ERROR (WSABASEERR + 1015) | ||
| 128 | #define WSA_QOS_ESERVICETYPE (WSABASEERR + 1016) | ||
| 129 | #define WSA_QOS_EFLOWSPEC (WSABASEERR + 1017) | ||
| 130 | #define WSA_QOS_EPROVSPECBUF (WSABASEERR + 1018) | ||
| 131 | #endif | ||
| 132 | #ifndef WSA_QOS_EFILTERSTYLE | ||
| 133 | #define WSA_QOS_EFILTERSTYLE (WSABASEERR + 1019) | ||
| 134 | #endif | ||
| 135 | #ifndef WSA_QOS_EFILTERTYPE | ||
| 136 | #define WSA_QOS_EFILTERTYPE (WSABASEERR + 1020) | ||
| 137 | #endif | ||
| 138 | #ifndef WSA_QOS_EFILTERCOUNT | ||
| 139 | #define WSA_QOS_EFILTERCOUNT (WSABASEERR + 1021) | ||
| 140 | #endif | ||
| 141 | #ifndef WSA_QOS_EOBJLENGTH | ||
| 142 | #define WSA_QOS_EOBJLENGTH (WSABASEERR + 1022) | ||
| 143 | #endif | ||
| 144 | #ifndef WSA_QOS_EFLOWCOUNT | ||
| 145 | #define WSA_QOS_EFLOWCOUNT (WSABASEERR + 1023) | ||
| 146 | #endif | ||
| 147 | #ifndef WSA_QOS_EUNKNOWNPSOBJ | ||
| 148 | #define WSA_QOS_EUNKNOWNPSOBJ (WSABASEERR + 1024) | ||
| 149 | #endif | ||
| 150 | #ifndef WSA_QOS_EPOLICYOBJ | ||
| 151 | #define WSA_QOS_EPOLICYOBJ (WSABASEERR + 1025) | ||
| 152 | #endif | ||
| 153 | #ifndef WSA_QOS_EFLOWDESC | ||
| 154 | #define WSA_QOS_EFLOWDESC (WSABASEERR + 1026) | ||
| 155 | #endif | ||
| 156 | #ifndef WSA_QOS_EPSFLOWSPEC | ||
| 157 | #define WSA_QOS_EPSFLOWSPEC (WSABASEERR + 1027) | ||
| 158 | #endif | ||
| 159 | #ifndef WSA_QOS_EPSFILTERSPEC | ||
| 160 | #define WSA_QOS_EPSFILTERSPEC (WSABASEERR + 1028) | ||
| 161 | #endif | ||
| 162 | #ifndef WSA_QOS_ESDMODEOBJ | ||
| 163 | #define WSA_QOS_ESDMODEOBJ (WSABASEERR + 1029) | ||
| 164 | #endif | ||
| 165 | #ifndef WSA_QOS_ESHAPERATEOBJ | ||
| 166 | #define WSA_QOS_ESHAPERATEOBJ (WSABASEERR + 1030) | ||
| 167 | #endif | ||
| 168 | #ifndef WSA_QOS_RESERVED_PETYPE | ||
| 169 | #define WSA_QOS_RESERVED_PETYPE (WSABASEERR + 1031) | ||
| 170 | #endif | ||
| 171 | |||
| 172 | #endif /* _WINSOCK2API_ */ | ||
| 173 | |||
| 174 | #ifndef __WSA_ERR_MACROS_DEFINED | ||
| 175 | #define __WSA_ERR_MACROS_DEFINED | ||
| 176 | #define h_errno WSAGetLastError() | ||
| 177 | #define HOST_NOT_FOUND WSAHOST_NOT_FOUND | ||
| 178 | #define TRY_AGAIN WSATRY_AGAIN | ||
| 179 | #define NO_RECOVERY WSANO_RECOVERY | ||
| 180 | #define NO_DATA WSANO_DATA | ||
| 181 | |||
| 182 | #define WSANO_ADDRESS WSANO_DATA | ||
| 183 | #define NO_ADDRESS WSANO_ADDRESS | ||
| 184 | #endif /* __WSA_ERR_MACROS_DEFINED */ | ||
| 185 | |||
| 186 | #if 0 | ||
| 187 | #define EWOULDBLOCK WSAEWOULDBLOCK | ||
| 188 | #define EINPROGRESS WSAEINPROGRESS | ||
| 189 | #define EALREADY WSAEALREADY | ||
| 190 | #define ENOTSOCK WSAENOTSOCK | ||
| 191 | #define EDESTADDRREQ WSAEDESTADDRREQ | ||
| 192 | #define EMSGSIZE WSAEMSGSIZE | ||
| 193 | #define EPROTOTYPE WSAEPROTOTYPE | ||
| 194 | #define ENOPROTOOPT WSAENOPROTOOPT | ||
| 195 | #define EPROTONOSUPPORT WSAEPROTONOSUPPORT | ||
| 196 | #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT | ||
| 197 | #define EOPNOTSUPP WSAEOPNOTSUPP | ||
| 198 | #define EPFNOSUPPORT WSAEPFNOSUPPORT | ||
| 199 | #define EAFNOSUPPORT WSAEAFNOSUPPORT | ||
| 200 | #define EADDRINUSE WSAEADDRINUSE | ||
| 201 | #define EADDRNOTAVAIL WSAEADDRNOTAVAIL | ||
| 202 | #define ENETDOWN WSAENETDOWN | ||
| 203 | #define ENETUNREACH WSAENETUNREACH | ||
| 204 | #define ENETRESET WSAENETRESET | ||
| 205 | #define ECONNABORTED WSAECONNABORTED | ||
| 206 | #define ECONNRESET WSAECONNRESET | ||
| 207 | #define ENOBUFS WSAENOBUFS | ||
| 208 | #define EISCONN WSAEISCONN | ||
| 209 | #define ENOTCONN WSAENOTCONN | ||
| 210 | #define ESHUTDOWN WSAESHUTDOWN | ||
| 211 | #define ETOOMANYREFS WSAETOOMANYREFS | ||
| 212 | #define ETIMEDOUT WSAETIMEDOUT | ||
| 213 | #define ECONNREFUSED WSAECONNREFUSED | ||
| 214 | #define ELOOP WSAELOOP | ||
| 215 | #define ENAMETOOLONG WSAENAMETOOLONG | ||
| 216 | #define EHOSTDOWN WSAEHOSTDOWN | ||
| 217 | #define EHOSTUNREACH WSAEHOSTUNREACH | ||
| 218 | #define ENOTEMPTY WSAENOTEMPTY | ||
| 219 | #define EPROCLIM WSAEPROCLIM | ||
| 220 | #define EUSERS WSAEUSERS | ||
| 221 | #define EDQUOT WSAEDQUOT | ||
| 222 | #define ESTALE WSAESTALE | ||
| 223 | #define EREMOTE WSAEREMOTE | ||
| 224 | #endif /* #if 0 */ | ||
| 225 | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __MINGW_WSADATA_H | ||
| 8 | #define __MINGW_WSADATA_H | ||
| 9 | |||
| 10 | #define WSADESCRIPTION_LEN 256 | ||
| 11 | #define WSASYS_STATUS_LEN 128 | ||
| 12 | |||
| 13 | typedef struct WSAData { | ||
| 14 | WORD wVersion; | ||
| 15 | WORD wHighVersion; | ||
| 16 | #ifdef _WIN64 | ||
| 17 | unsigned short iMaxSockets; | ||
| 18 | unsigned short iMaxUdpDg; | ||
| 19 | char *lpVendorInfo; | ||
| 20 | char szDescription[WSADESCRIPTION_LEN+1]; | ||
| 21 | char szSystemStatus[WSASYS_STATUS_LEN+1]; | ||
| 22 | #else | ||
| 23 | char szDescription[WSADESCRIPTION_LEN+1]; | ||
| 24 | char szSystemStatus[WSASYS_STATUS_LEN+1]; | ||
| 25 | unsigned short iMaxSockets; | ||
| 26 | unsigned short iMaxUdpDg; | ||
| 27 | char *lpVendorInfo; | ||
| 28 | #endif | ||
| 29 | } WSADATA, *LPWSADATA; | ||
| 30 | |||
| 31 | #endif /* __MINGW_WSADATA_H */ | ||
| 32 | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the mingw-w64 runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __MINGW_TRANSMIT_FILE_H | ||
| 8 | #define __MINGW_TRANSMIT_FILE_H | ||
| 9 | |||
| 10 | typedef struct _TRANSMIT_FILE_BUFFERS { | ||
| 11 | LPVOID Head; | ||
| 12 | DWORD HeadLength; | ||
| 13 | LPVOID Tail; | ||
| 14 | DWORD TailLength; | ||
| 15 | } TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS; | ||
| 16 | |||
| 17 | #endif /* __MINGW_TRANSMIT_FILE_H */ | ||
| 18 | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | #ifndef __QOS_H_ | ||
| 7 | #define __QOS_H_ | ||
| 8 | |||
| 9 | typedef ULONG SERVICETYPE; | ||
| 10 | |||
| 11 | #define SERVICETYPE_NOTRAFFIC 0x00000000 | ||
| 12 | #define SERVICETYPE_BESTEFFORT 0x00000001 | ||
| 13 | #define SERVICETYPE_CONTROLLEDLOAD 0x00000002 | ||
| 14 | #define SERVICETYPE_GUARANTEED 0x00000003 | ||
| 15 | |||
| 16 | #define SERVICETYPE_NETWORK_UNAVAILABLE 0x00000004 | ||
| 17 | #define SERVICETYPE_GENERAL_INFORMATION 0x00000005 | ||
| 18 | #define SERVICETYPE_NOCHANGE 0x00000006 | ||
| 19 | #define SERVICETYPE_NONCONFORMING 0x00000009 | ||
| 20 | #define SERVICETYPE_NETWORK_CONTROL 0x0000000A | ||
| 21 | #define SERVICETYPE_QUALITATIVE 0x0000000D | ||
| 22 | |||
| 23 | #define SERVICE_BESTEFFORT 0x80010000 | ||
| 24 | #define SERVICE_CONTROLLEDLOAD 0x80020000 | ||
| 25 | #define SERVICE_GUARANTEED 0x80040000 | ||
| 26 | #define SERVICE_QUALITATIVE 0x80200000 | ||
| 27 | |||
| 28 | #define SERVICE_NO_TRAFFIC_CONTROL 0x81000000 | ||
| 29 | |||
| 30 | #define SERVICE_NO_QOS_SIGNALING 0x40000000 | ||
| 31 | |||
| 32 | typedef struct _flowspec { | ||
| 33 | ULONG TokenRate; | ||
| 34 | ULONG TokenBucketSize; | ||
| 35 | ULONG PeakBandwidth; | ||
| 36 | ULONG Latency; | ||
| 37 | ULONG DelayVariation; | ||
| 38 | SERVICETYPE ServiceType; | ||
| 39 | ULONG MaxSduSize; | ||
| 40 | ULONG MinimumPolicedSize; | ||
| 41 | } FLOWSPEC,*PFLOWSPEC,*LPFLOWSPEC; | ||
| 42 | |||
| 43 | #define QOS_NOT_SPECIFIED 0xFFFFFFFF | ||
| 44 | #define POSITIVE_INFINITY_RATE 0xFFFFFFFE | ||
| 45 | |||
| 46 | typedef struct _QOS_OBJECT_HDR { | ||
| 47 | ULONG ObjectType; | ||
| 48 | ULONG ObjectLength; | ||
| 49 | } QOS_OBJECT_HDR, *LPQOS_OBJECT_HDR; | ||
| 50 | |||
| 51 | #define QOS_GENERAL_ID_BASE 2000 | ||
| 52 | #define QOS_OBJECT_END_OF_LIST (0x00000001 + QOS_GENERAL_ID_BASE) | ||
| 53 | #define QOS_OBJECT_SD_MODE (0x00000002 + QOS_GENERAL_ID_BASE) | ||
| 54 | #define QOS_OBJECT_SHAPING_RATE (0x00000003 + QOS_GENERAL_ID_BASE) | ||
| 55 | #define QOS_OBJECT_DESTADDR (0x00000004 + QOS_GENERAL_ID_BASE) | ||
| 56 | |||
| 57 | typedef struct _QOS_SD_MODE { | ||
| 58 | QOS_OBJECT_HDR ObjectHdr; | ||
| 59 | ULONG ShapeDiscardMode; | ||
| 60 | } QOS_SD_MODE, *LPQOS_SD_MODE; | ||
| 61 | |||
| 62 | #define TC_NONCONF_BORROW 0 | ||
| 63 | #define TC_NONCONF_SHAPE 1 | ||
| 64 | #define TC_NONCONF_DISCARD 2 | ||
| 65 | #define TC_NONCONF_BORROW_PLUS 3 | ||
| 66 | |||
| 67 | typedef struct _QOS_SHAPING_RATE { | ||
| 68 | QOS_OBJECT_HDR ObjectHdr; | ||
| 69 | ULONG ShapingRate; | ||
| 70 | } QOS_SHAPING_RATE, *LPQOS_SHAPING_RATE; | ||
| 71 | |||
| 72 | #endif | ||
| @@ -1,904 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file is part of the mingw-w64 runtime package. | ||
| 3 | * No warranty is given; refer to the file DISCLAIMER within this package. | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef _INC_SHELLAPI | ||
| 7 | #define _INC_SHELLAPI | ||
| 8 | |||
| 9 | #include <_mingw_unicode.h> | ||
| 10 | #include <specstrings.h> | ||
| 11 | |||
| 12 | #ifndef WINSHELLAPI | ||
| 13 | #ifndef _SHELL32_ | ||
| 14 | #define WINSHELLAPI DECLSPEC_IMPORT | ||
| 15 | #else | ||
| 16 | #define WINSHELLAPI | ||
| 17 | #endif | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #ifndef SHSTDAPI | ||
| 21 | #ifndef _SHELL32_ | ||
| 22 | #ifdef __cplusplus | ||
| 23 | #define SHSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE | ||
| 24 | #define SHSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE | ||
| 25 | #else | ||
| 26 | #define SHSTDAPI DECLSPEC_IMPORT HRESULT STDAPICALLTYPE | ||
| 27 | #define SHSTDAPI_(type) DECLSPEC_IMPORT type STDAPICALLTYPE | ||
| 28 | #endif | ||
| 29 | #else | ||
| 30 | #define SHSTDAPI STDAPI | ||
| 31 | #define SHSTDAPI_(type) STDAPI_(type) | ||
| 32 | #endif | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #ifndef SHDOCAPI | ||
| 36 | #ifndef _SHDOCVW_ | ||
| 37 | #ifdef __cplusplus | ||
| 38 | #define SHDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE | ||
| 39 | #define SHDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE | ||
| 40 | #else | ||
| 41 | #define SHDOCAPI DECLSPEC_IMPORT HRESULT STDAPICALLTYPE | ||
| 42 | #define SHDOCAPI_(type) DECLSPEC_IMPORT type STDAPICALLTYPE | ||
| 43 | #endif | ||
| 44 | #else | ||
| 45 | #define SHDOCAPI STDAPI | ||
| 46 | #define SHDOCAPI_(type) STDAPI_(type) | ||
| 47 | #endif | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #ifndef _WIN64 | ||
| 51 | #include <pshpack1.h> | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #ifdef __cplusplus | ||
| 55 | extern "C" { | ||
| 56 | #endif | ||
| 57 | |||
| 58 | #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) | ||
| 59 | DECLARE_HANDLE (HDROP); | ||
| 60 | |||
| 61 | #define DragQueryFile __MINGW_NAME_AW(DragQueryFile) | ||
| 62 | #define ShellExecute __MINGW_NAME_AW(ShellExecute) | ||
| 63 | #define FindExecutable __MINGW_NAME_AW(FindExecutable) | ||
| 64 | #define ShellAbout __MINGW_NAME_AW(ShellAbout) | ||
| 65 | #define ExtractAssociatedIcon __MINGW_NAME_AW(ExtractAssociatedIcon) | ||
| 66 | #define ExtractAssociatedIconEx __MINGW_NAME_AW(ExtractAssociatedIconEx) | ||
| 67 | #define ExtractIcon __MINGW_NAME_AW(ExtractIcon) | ||
| 68 | |||
| 69 | SHSTDAPI_(UINT) DragQueryFileA (HDROP hDrop, UINT iFile, LPSTR lpszFile, UINT cch); | ||
| 70 | SHSTDAPI_(UINT) DragQueryFileW (HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch); | ||
| 71 | SHSTDAPI_(WINBOOL) DragQueryPoint (HDROP hDrop, POINT *ppt); | ||
| 72 | SHSTDAPI_(void) DragFinish (HDROP hDrop); | ||
| 73 | SHSTDAPI_(void) DragAcceptFiles (HWND hWnd, WINBOOL fAccept); | ||
| 74 | SHSTDAPI_(HINSTANCE) ShellExecuteA (HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd); | ||
| 75 | SHSTDAPI_(HINSTANCE) ShellExecuteW (HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd); | ||
| 76 | SHSTDAPI_(HINSTANCE) FindExecutableA (LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult); | ||
| 77 | SHSTDAPI_(HINSTANCE) FindExecutableW (LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult); | ||
| 78 | SHSTDAPI_(LPWSTR *) CommandLineToArgvW (LPCWSTR lpCmdLine, int *pNumArgs); | ||
| 79 | SHSTDAPI_(INT) ShellAboutA (HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon); | ||
| 80 | SHSTDAPI_(INT) ShellAboutW (HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon); | ||
| 81 | SHSTDAPI_(HICON) DuplicateIcon (HINSTANCE hInst, HICON hIcon); | ||
| 82 | SHSTDAPI_(HICON) ExtractAssociatedIconA (HINSTANCE hInst, LPSTR pszIconPath, WORD *piIcon); | ||
| 83 | SHSTDAPI_(HICON) ExtractAssociatedIconW (HINSTANCE hInst, LPWSTR pszIconPath, WORD *piIcon); | ||
| 84 | SHSTDAPI_(HICON) ExtractAssociatedIconExA (HINSTANCE hInst, LPSTR pszIconPath, WORD *piIconIndex, WORD *piIconId); | ||
| 85 | SHSTDAPI_(HICON) ExtractAssociatedIconExW (HINSTANCE hInst, LPWSTR pszIconPath, WORD *piIconIndex, WORD *piIconId); | ||
| 86 | SHSTDAPI_(HICON) ExtractIconA (HINSTANCE hInst, LPCSTR pszExeFileName, UINT nIconIndex); | ||
| 87 | SHSTDAPI_(HICON) ExtractIconW (HINSTANCE hInst, LPCWSTR pszExeFileName, UINT nIconIndex); | ||
| 88 | |||
| 89 | typedef struct _DRAGINFOA { | ||
| 90 | UINT uSize; | ||
| 91 | POINT pt; | ||
| 92 | WINBOOL fNC; | ||
| 93 | LPSTR lpFileList; | ||
| 94 | DWORD grfKeyState; | ||
| 95 | } DRAGINFOA,*LPDRAGINFOA; | ||
| 96 | |||
| 97 | typedef struct _DRAGINFOW { | ||
| 98 | UINT uSize; | ||
| 99 | POINT pt; | ||
| 100 | WINBOOL fNC; | ||
| 101 | LPWSTR lpFileList; | ||
| 102 | DWORD grfKeyState; | ||
| 103 | } DRAGINFOW,*LPDRAGINFOW; | ||
| 104 | |||
| 105 | __MINGW_TYPEDEF_AW(DRAGINFO) | ||
| 106 | __MINGW_TYPEDEF_AW(LPDRAGINFO) | ||
| 107 | |||
| 108 | #define ABM_NEW 0x00000000 | ||
| 109 | #define ABM_REMOVE 0x00000001 | ||
| 110 | #define ABM_QUERYPOS 0x00000002 | ||
| 111 | #define ABM_SETPOS 0x00000003 | ||
| 112 | #define ABM_GETSTATE 0x00000004 | ||
| 113 | #define ABM_GETTASKBARPOS 0x00000005 | ||
| 114 | #define ABM_ACTIVATE 0x00000006 | ||
| 115 | #define ABM_GETAUTOHIDEBAR 0x00000007 | ||
| 116 | #define ABM_SETAUTOHIDEBAR 0x00000008 | ||
| 117 | |||
| 118 | #define ABM_WINDOWPOSCHANGED 0x0000009 | ||
| 119 | #define ABM_SETSTATE 0x0000000a | ||
| 120 | #if NTDDI_VERSION >= 0x06020000 | ||
| 121 | #define ABM_GETAUTOHIDEBAREX 0x0000000b | ||
| 122 | #define ABM_SETAUTOHIDEBAREX 0x0000000c | ||
| 123 | #endif | ||
| 124 | |||
| 125 | #define ABN_STATECHANGE 0x0000000 | ||
| 126 | #define ABN_POSCHANGED 0x0000001 | ||
| 127 | #define ABN_FULLSCREENAPP 0x0000002 | ||
| 128 | #define ABN_WINDOWARRANGE 0x0000003 | ||
| 129 | |||
| 130 | #define ABS_AUTOHIDE 0x0000001 | ||
| 131 | #define ABS_ALWAYSONTOP 0x0000002 | ||
| 132 | |||
| 133 | #define ABE_LEFT 0 | ||
| 134 | #define ABE_TOP 1 | ||
| 135 | #define ABE_RIGHT 2 | ||
| 136 | #define ABE_BOTTOM 3 | ||
| 137 | |||
| 138 | typedef struct _AppBarData { | ||
| 139 | DWORD cbSize; | ||
| 140 | HWND hWnd; | ||
| 141 | UINT uCallbackMessage; | ||
| 142 | UINT uEdge; | ||
| 143 | RECT rc; | ||
| 144 | LPARAM lParam; | ||
| 145 | } APPBARDATA,*PAPPBARDATA; | ||
| 146 | |||
| 147 | SHSTDAPI_(UINT_PTR) SHAppBarMessage (DWORD dwMessage, PAPPBARDATA pData); | ||
| 148 | SHSTDAPI_(DWORD) DoEnvironmentSubstA (LPSTR pszSrc, UINT cchSrc); | ||
| 149 | SHSTDAPI_(DWORD) DoEnvironmentSubstW (LPWSTR pszSrc, UINT cchSrc); | ||
| 150 | SHSTDAPI_(UINT) ExtractIconExA (LPCSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons); | ||
| 151 | SHSTDAPI_(UINT) ExtractIconExW (LPCWSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons); | ||
| 152 | |||
| 153 | #define DoEnvironmentSubst __MINGW_NAME_AW(DoEnvironmentSubst) | ||
| 154 | #define ExtractIconEx __MINGW_NAME_AW(ExtractIconEx) | ||
| 155 | |||
| 156 | #define EIRESID(x) (-1 * (int)(x)) | ||
| 157 | |||
| 158 | #define FO_MOVE 0x1 | ||
| 159 | #define FO_COPY 0x2 | ||
| 160 | #define FO_DELETE 0x3 | ||
| 161 | #define FO_RENAME 0x4 | ||
| 162 | |||
| 163 | #define FOF_MULTIDESTFILES 0x1 | ||
| 164 | #define FOF_CONFIRMMOUSE 0x2 | ||
| 165 | #define FOF_SILENT 0x4 | ||
| 166 | #define FOF_RENAMEONCOLLISION 0x8 | ||
| 167 | #define FOF_NOCONFIRMATION 0x10 | ||
| 168 | #define FOF_WANTMAPPINGHANDLE 0x20 | ||
| 169 | #define FOF_ALLOWUNDO 0x40 | ||
| 170 | #define FOF_FILESONLY 0x80 | ||
| 171 | #define FOF_SIMPLEPROGRESS 0x100 | ||
| 172 | #define FOF_NOCONFIRMMKDIR 0x200 | ||
| 173 | #define FOF_NOERRORUI 0x400 | ||
| 174 | #define FOF_NOCOPYSECURITYATTRIBS 0x800 | ||
| 175 | #define FOF_NORECURSION 0x1000 | ||
| 176 | #define FOF_NO_CONNECTED_ELEMENTS 0x2000 | ||
| 177 | #define FOF_WANTNUKEWARNING 0x4000 | ||
| 178 | #define FOF_NORECURSEREPARSE 0x8000 | ||
| 179 | |||
| 180 | #define FOF_NO_UI (FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR) | ||
| 181 | |||
| 182 | typedef WORD FILEOP_FLAGS; | ||
| 183 | |||
| 184 | #define PO_DELETE 0x0013 | ||
| 185 | #define PO_RENAME 0x0014 | ||
| 186 | #define PO_PORTCHANGE 0x0020 | ||
| 187 | |||
| 188 | #define PO_REN_PORT 0x0034 | ||
| 189 | |||
| 190 | typedef WORD PRINTEROP_FLAGS; | ||
| 191 | |||
| 192 | typedef struct _SHFILEOPSTRUCTA { | ||
| 193 | HWND hwnd; | ||
| 194 | UINT wFunc; | ||
| 195 | LPCSTR pFrom; | ||
| 196 | LPCSTR pTo; | ||
| 197 | FILEOP_FLAGS fFlags; | ||
| 198 | WINBOOL fAnyOperationsAborted; | ||
| 199 | LPVOID hNameMappings; | ||
| 200 | PCSTR lpszProgressTitle; | ||
| 201 | } SHFILEOPSTRUCTA,*LPSHFILEOPSTRUCTA; | ||
| 202 | |||
| 203 | typedef struct _SHFILEOPSTRUCTW { | ||
| 204 | HWND hwnd; | ||
| 205 | UINT wFunc; | ||
| 206 | LPCWSTR pFrom; | ||
| 207 | LPCWSTR pTo; | ||
| 208 | FILEOP_FLAGS fFlags; | ||
| 209 | WINBOOL fAnyOperationsAborted; | ||
| 210 | LPVOID hNameMappings; | ||
| 211 | PCWSTR lpszProgressTitle; | ||
| 212 | } SHFILEOPSTRUCTW,*LPSHFILEOPSTRUCTW; | ||
| 213 | |||
| 214 | __MINGW_TYPEDEF_AW(SHFILEOPSTRUCT) | ||
| 215 | __MINGW_TYPEDEF_AW(LPSHFILEOPSTRUCT) | ||
| 216 | |||
| 217 | SHSTDAPI_(int) SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp); | ||
| 218 | SHSTDAPI_(int) SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp); | ||
| 219 | |||
| 220 | #define SHFileOperation __MINGW_NAME_AW(SHFileOperation) | ||
| 221 | |||
| 222 | SHSTDAPI_(void) SHFreeNameMappings (HANDLE hNameMappings); | ||
| 223 | |||
| 224 | typedef struct _SHNAMEMAPPINGA { | ||
| 225 | LPSTR pszOldPath; | ||
| 226 | LPSTR pszNewPath; | ||
| 227 | int cchOldPath; | ||
| 228 | int cchNewPath; | ||
| 229 | } SHNAMEMAPPINGA,*LPSHNAMEMAPPINGA; | ||
| 230 | |||
| 231 | typedef struct _SHNAMEMAPPINGW { | ||
| 232 | LPWSTR pszOldPath; | ||
| 233 | LPWSTR pszNewPath; | ||
| 234 | int cchOldPath; | ||
| 235 | int cchNewPath; | ||
| 236 | } SHNAMEMAPPINGW,*LPSHNAMEMAPPINGW; | ||
| 237 | |||
| 238 | |||
| 239 | __MINGW_TYPEDEF_AW(SHNAMEMAPPING) | ||
| 240 | __MINGW_TYPEDEF_AW(LPSHNAMEMAPPING) | ||
| 241 | |||
| 242 | #define SE_ERR_FNF 2 | ||
| 243 | #define SE_ERR_PNF 3 | ||
| 244 | #define SE_ERR_ACCESSDENIED 5 | ||
| 245 | #define SE_ERR_OOM 8 | ||
| 246 | #define SE_ERR_DLLNOTFOUND 32 | ||
| 247 | |||
| 248 | #define SE_ERR_SHARE 26 | ||
| 249 | #define SE_ERR_ASSOCINCOMPLETE 27 | ||
| 250 | #define SE_ERR_DDETIMEOUT 28 | ||
| 251 | #define SE_ERR_DDEFAIL 29 | ||
| 252 | #define SE_ERR_DDEBUSY 30 | ||
| 253 | #define SE_ERR_NOASSOC 31 | ||
| 254 | |||
| 255 | #define SEE_MASK_DEFAULT 0x0 | ||
| 256 | #define SEE_MASK_CLASSNAME 0x1 | ||
| 257 | #define SEE_MASK_CLASSKEY 0x3 | ||
| 258 | |||
| 259 | #define SEE_MASK_IDLIST 0x4 | ||
| 260 | #define SEE_MASK_INVOKEIDLIST 0xc | ||
| 261 | #if NTDDI_VERSION < 0x06000000 | ||
| 262 | #define SEE_MASK_ICON 0x10 | ||
| 263 | #endif | ||
| 264 | #define SEE_MASK_HOTKEY 0x20 | ||
| 265 | #define SEE_MASK_NOCLOSEPROCESS 0x40 | ||
| 266 | #define SEE_MASK_CONNECTNETDRV 0x80 | ||
| 267 | #define SEE_MASK_NOASYNC 0x100 | ||
| 268 | #define SEE_MASK_FLAG_DDEWAIT SEE_MASK_NOASYNC | ||
| 269 | #define SEE_MASK_DOENVSUBST 0x200 | ||
| 270 | #define SEE_MASK_FLAG_NO_UI 0x400 | ||
| 271 | #define SEE_MASK_UNICODE 0x4000 | ||
| 272 | #define SEE_MASK_NO_CONSOLE 0x8000 | ||
| 273 | #define SEE_MASK_ASYNCOK 0x100000 | ||
| 274 | #define SEE_MASK_HMONITOR 0x200000 | ||
| 275 | #define SEE_MASK_NOZONECHECKS 0x800000 | ||
| 276 | #define SEE_MASK_NOQUERYCLASSSTORE 0x1000000 | ||
| 277 | #define SEE_MASK_WAITFORINPUTIDLE 0x2000000 | ||
| 278 | #define SEE_MASK_FLAG_LOG_USAGE 0x4000000 | ||
| 279 | #if NTDDI_VERSION >= 0x06020000 | ||
| 280 | #define SEE_MASK_FLAG_HINST_IS_SITE 0x8000000 | ||
| 281 | #endif | ||
| 282 | |||
| 283 | #ifndef DUMMYUNIONNAME | ||
| 284 | #ifdef NONAMELESSUNION | ||
| 285 | #define DUMMYUNIONNAME u | ||
| 286 | #define DUMMYUNIONNAME2 u2 | ||
| 287 | #define DUMMYUNIONNAME3 u3 | ||
| 288 | #define DUMMYUNIONNAME4 u4 | ||
| 289 | #define DUMMYUNIONNAME5 u5 | ||
| 290 | #else | ||
| 291 | #define DUMMYUNIONNAME | ||
| 292 | #define DUMMYUNIONNAME2 | ||
| 293 | #define DUMMYUNIONNAME3 | ||
| 294 | #define DUMMYUNIONNAME4 | ||
| 295 | #define DUMMYUNIONNAME5 | ||
| 296 | #endif | ||
| 297 | #endif | ||
| 298 | |||
| 299 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) | ||
| 300 | |||
| 301 | typedef struct _SHELLEXECUTEINFOA { | ||
| 302 | DWORD cbSize; | ||
| 303 | ULONG fMask; | ||
| 304 | HWND hwnd; | ||
| 305 | LPCSTR lpVerb; | ||
| 306 | LPCSTR lpFile; | ||
| 307 | LPCSTR lpParameters; | ||
| 308 | LPCSTR lpDirectory; | ||
| 309 | int nShow; | ||
| 310 | HINSTANCE hInstApp; | ||
| 311 | void *lpIDList; | ||
| 312 | LPCSTR lpClass; | ||
| 313 | HKEY hkeyClass; | ||
| 314 | DWORD dwHotKey; | ||
| 315 | __C89_NAMELESS union { | ||
| 316 | HANDLE hIcon; | ||
| 317 | HANDLE hMonitor; | ||
| 318 | } DUMMYUNIONNAME; | ||
| 319 | HANDLE hProcess; | ||
| 320 | } SHELLEXECUTEINFOA,*LPSHELLEXECUTEINFOA; | ||
| 321 | |||
| 322 | typedef struct _SHELLEXECUTEINFOW { | ||
| 323 | DWORD cbSize; | ||
| 324 | ULONG fMask; | ||
| 325 | HWND hwnd; | ||
| 326 | LPCWSTR lpVerb; | ||
| 327 | LPCWSTR lpFile; | ||
| 328 | LPCWSTR lpParameters; | ||
| 329 | LPCWSTR lpDirectory; | ||
| 330 | int nShow; | ||
| 331 | HINSTANCE hInstApp; | ||
| 332 | void *lpIDList; | ||
| 333 | LPCWSTR lpClass; | ||
| 334 | HKEY hkeyClass; | ||
| 335 | DWORD dwHotKey; | ||
| 336 | __C89_NAMELESS union { | ||
| 337 | HANDLE hIcon; | ||
| 338 | HANDLE hMonitor; | ||
| 339 | } DUMMYUNIONNAME; | ||
| 340 | HANDLE hProcess; | ||
| 341 | } SHELLEXECUTEINFOW,*LPSHELLEXECUTEINFOW; | ||
| 342 | |||
| 343 | __MINGW_TYPEDEF_AW(SHELLEXECUTEINFO) | ||
| 344 | __MINGW_TYPEDEF_AW(LPSHELLEXECUTEINFO) | ||
| 345 | |||
| 346 | SHSTDAPI_(WINBOOL) ShellExecuteExA (SHELLEXECUTEINFOA *pExecInfo); | ||
| 347 | SHSTDAPI_(WINBOOL) ShellExecuteExW (SHELLEXECUTEINFOW *pExecInfo); | ||
| 348 | |||
| 349 | #define ShellExecuteEx __MINGW_NAME_AW(ShellExecuteEx) | ||
| 350 | |||
| 351 | typedef struct _SHCREATEPROCESSINFOW { | ||
| 352 | DWORD cbSize; | ||
| 353 | ULONG fMask; | ||
| 354 | HWND hwnd; | ||
| 355 | LPCWSTR pszFile; | ||
| 356 | LPCWSTR pszParameters; | ||
| 357 | LPCWSTR pszCurrentDirectory; | ||
| 358 | HANDLE hUserToken; | ||
| 359 | LPSECURITY_ATTRIBUTES lpProcessAttributes; | ||
| 360 | LPSECURITY_ATTRIBUTES lpThreadAttributes; | ||
| 361 | WINBOOL bInheritHandles; | ||
| 362 | DWORD dwCreationFlags; | ||
| 363 | LPSTARTUPINFOW lpStartupInfo; | ||
| 364 | LPPROCESS_INFORMATION lpProcessInformation; | ||
| 365 | } SHCREATEPROCESSINFOW,*PSHCREATEPROCESSINFOW; | ||
| 366 | |||
| 367 | SHSTDAPI_(WINBOOL) SHCreateProcessAsUserW (PSHCREATEPROCESSINFOW pscpi); | ||
| 368 | |||
| 369 | #if NTDDI_VERSION >= 0x06000000 | ||
| 370 | SHSTDAPI SHEvaluateSystemCommandTemplate (PCWSTR pszCmdTemplate, PWSTR *ppszApplication, PWSTR *ppszCommandLine, PWSTR *ppszParameters); | ||
| 371 | |||
| 372 | typedef enum ASSOCCLASS { | ||
| 373 | ASSOCCLASS_SHELL_KEY = 0, | ||
| 374 | ASSOCCLASS_PROGID_KEY, | ||
| 375 | ASSOCCLASS_PROGID_STR, | ||
| 376 | ASSOCCLASS_CLSID_KEY, | ||
| 377 | ASSOCCLASS_CLSID_STR, | ||
| 378 | ASSOCCLASS_APP_KEY, | ||
| 379 | ASSOCCLASS_APP_STR, | ||
| 380 | ASSOCCLASS_SYSTEM_STR, | ||
| 381 | ASSOCCLASS_FOLDER, | ||
| 382 | ASSOCCLASS_STAR, | ||
| 383 | #if NTDDI_VERSION >= 0x06020000 | ||
| 384 | ASSOCCLASS_FIXED_PROGID_STR, | ||
| 385 | ASSOCCLASS_PROTOCOL_STR, | ||
| 386 | #endif | ||
| 387 | } ASSOCCLASS; | ||
| 388 | |||
| 389 | typedef struct ASSOCIATIONELEMENT { | ||
| 390 | ASSOCCLASS ac; | ||
| 391 | HKEY hkClass; | ||
| 392 | PCWSTR pszClass; | ||
| 393 | } ASSOCIATIONELEMENT; | ||
| 394 | |||
| 395 | SHSTDAPI AssocCreateForClasses (const ASSOCIATIONELEMENT *rgClasses, ULONG cClasses, REFIID riid, void **ppv); | ||
| 396 | #endif | ||
| 397 | |||
| 398 | typedef struct _SHQUERYRBINFO { | ||
| 399 | DWORD cbSize; | ||
| 400 | __MINGW_EXTENSION __int64 i64Size; | ||
| 401 | __MINGW_EXTENSION __int64 i64NumItems; | ||
| 402 | } SHQUERYRBINFO,*LPSHQUERYRBINFO; | ||
| 403 | |||
| 404 | #define SHERB_NOCONFIRMATION 0x00000001 | ||
| 405 | #define SHERB_NOPROGRESSUI 0x00000002 | ||
| 406 | #define SHERB_NOSOUND 0x00000004 | ||
| 407 | |||
| 408 | SHSTDAPI SHQueryRecycleBinA (LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo); | ||
| 409 | SHSTDAPI SHQueryRecycleBinW (LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo); | ||
| 410 | |||
| 411 | #define SHQueryRecycleBin __MINGW_NAME_AW(SHQueryRecycleBin) | ||
| 412 | |||
| 413 | SHSTDAPI SHEmptyRecycleBinA (HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags); | ||
| 414 | SHSTDAPI SHEmptyRecycleBinW (HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags); | ||
| 415 | |||
| 416 | #define SHEmptyRecycleBin __MINGW_NAME_AW(SHEmptyRecycleBin) | ||
| 417 | |||
| 418 | #if NTDDI_VERSION >= 0x06000000 | ||
| 419 | typedef enum { | ||
| 420 | QUNS_NOT_PRESENT = 1, | ||
| 421 | QUNS_BUSY = 2, | ||
| 422 | QUNS_RUNNING_D3D_FULL_SCREEN = 3, | ||
| 423 | QUNS_PRESENTATION_MODE = 4, | ||
| 424 | QUNS_ACCEPTS_NOTIFICATIONS = 5 | ||
| 425 | #if NTDDI_VERSION >= 0x06010000 | ||
| 426 | , QUNS_QUIET_TIME = 6 | ||
| 427 | #endif | ||
| 428 | #if NTDDI_VERSION >= 0x06020000 | ||
| 429 | , QUNS_APP = 7 | ||
| 430 | #endif | ||
| 431 | } QUERY_USER_NOTIFICATION_STATE; | ||
| 432 | |||
| 433 | SHSTDAPI SHQueryUserNotificationState (QUERY_USER_NOTIFICATION_STATE *pquns); | ||
| 434 | #endif | ||
| 435 | |||
| 436 | #if NTDDI_VERSION >= 0x06010000 | ||
| 437 | SHSTDAPI SHGetPropertyStoreForWindow (HWND hwnd, REFIID riid, void **ppv); | ||
| 438 | #endif | ||
| 439 | |||
| 440 | #endif /* WINAPI_PARTITION_DESKTOP. */ | ||
| 441 | |||
| 442 | typedef struct _NOTIFYICONDATAA { | ||
| 443 | DWORD cbSize; | ||
| 444 | HWND hWnd; | ||
| 445 | UINT uID; | ||
| 446 | UINT uFlags; | ||
| 447 | UINT uCallbackMessage; | ||
| 448 | HICON hIcon; | ||
| 449 | CHAR szTip[128]; | ||
| 450 | DWORD dwState; | ||
| 451 | DWORD dwStateMask; | ||
| 452 | CHAR szInfo[256]; | ||
| 453 | __C89_NAMELESS union { | ||
| 454 | UINT uTimeout; | ||
| 455 | UINT uVersion; | ||
| 456 | } DUMMYUNIONNAME; | ||
| 457 | CHAR szInfoTitle[64]; | ||
| 458 | DWORD dwInfoFlags; | ||
| 459 | GUID guidItem; | ||
| 460 | #if NTDDI_VERSION >= 0x06000000 | ||
| 461 | HICON hBalloonIcon; | ||
| 462 | #endif | ||
| 463 | } NOTIFYICONDATAA,*PNOTIFYICONDATAA; | ||
| 464 | |||
| 465 | typedef struct _NOTIFYICONDATAW { | ||
| 466 | DWORD cbSize; | ||
| 467 | HWND hWnd; | ||
| 468 | UINT uID; | ||
| 469 | UINT uFlags; | ||
| 470 | UINT uCallbackMessage; | ||
| 471 | HICON hIcon; | ||
| 472 | WCHAR szTip[128]; | ||
| 473 | DWORD dwState; | ||
| 474 | DWORD dwStateMask; | ||
| 475 | WCHAR szInfo[256]; | ||
| 476 | __C89_NAMELESS union { | ||
| 477 | UINT uTimeout; | ||
| 478 | UINT uVersion; | ||
| 479 | } DUMMYUNIONNAME; | ||
| 480 | WCHAR szInfoTitle[64]; | ||
| 481 | DWORD dwInfoFlags; | ||
| 482 | GUID guidItem; | ||
| 483 | #if NTDDI_VERSION >= 0x06000000 | ||
| 484 | HICON hBalloonIcon; | ||
| 485 | #endif | ||
| 486 | } NOTIFYICONDATAW,*PNOTIFYICONDATAW; | ||
| 487 | |||
| 488 | __MINGW_TYPEDEF_AW(NOTIFYICONDATA) | ||
| 489 | __MINGW_TYPEDEF_AW(PNOTIFYICONDATA) | ||
| 490 | |||
| 491 | #define NOTIFYICONDATAA_V1_SIZE FIELD_OFFSET (NOTIFYICONDATAA, szTip[64]) | ||
| 492 | #define NOTIFYICONDATAW_V1_SIZE FIELD_OFFSET (NOTIFYICONDATAW, szTip[64]) | ||
| 493 | #define NOTIFYICONDATAA_V2_SIZE FIELD_OFFSET (NOTIFYICONDATAA, guidItem) | ||
| 494 | #define NOTIFYICONDATAW_V2_SIZE FIELD_OFFSET (NOTIFYICONDATAW, guidItem) | ||
| 495 | #define NOTIFYICONDATAA_V3_SIZE FIELD_OFFSET (NOTIFYICONDATAA, hBalloonIcon) | ||
| 496 | #define NOTIFYICONDATAW_V3_SIZE FIELD_OFFSET (NOTIFYICONDATAW, hBalloonIcon) | ||
| 497 | |||
| 498 | #define NOTIFYICONDATA_V1_SIZE __MINGW_NAME_AW_EXT(NOTIFYICONDATA,_V1_SIZE) | ||
| 499 | #define NOTIFYICONDATA_V2_SIZE __MINGW_NAME_AW_EXT(NOTIFYICONDATA,_V2_SIZE) | ||
| 500 | #define NOTIFYICONDATA_V3_SIZE __MINGW_NAME_AW_EXT(NOTIFYICONDATA,_V3_SIZE) | ||
| 501 | |||
| 502 | #define NIN_SELECT (WM_USER + 0) | ||
| 503 | #define NINF_KEY 0x1 | ||
| 504 | #define NIN_KEYSELECT (NIN_SELECT | NINF_KEY) | ||
| 505 | |||
| 506 | #define NIN_BALLOONSHOW (WM_USER + 2) | ||
| 507 | #define NIN_BALLOONHIDE (WM_USER + 3) | ||
| 508 | #define NIN_BALLOONTIMEOUT (WM_USER + 4) | ||
| 509 | #define NIN_BALLOONUSERCLICK (WM_USER + 5) | ||
| 510 | #if NTDDI_VERSION >= 0x06000000 | ||
| 511 | #define NIN_POPUPOPEN (WM_USER + 6) | ||
| 512 | #define NIN_POPUPCLOSE (WM_USER + 7) | ||
| 513 | #endif | ||
| 514 | |||
| 515 | #define NIM_ADD 0x00000000 | ||
| 516 | #define NIM_MODIFY 0x00000001 | ||
| 517 | #define NIM_DELETE 0x00000002 | ||
| 518 | #define NIM_SETFOCUS 0x00000003 | ||
| 519 | #define NIM_SETVERSION 0x00000004 | ||
| 520 | |||
| 521 | #define NOTIFYICON_VERSION 3 | ||
| 522 | #if NTDDI_VERSION >= 0x06000000 | ||
| 523 | #define NOTIFYICON_VERSION_4 4 | ||
| 524 | #endif | ||
| 525 | |||
| 526 | #define NIF_MESSAGE 0x00000001 | ||
| 527 | #define NIF_ICON 0x00000002 | ||
| 528 | #define NIF_TIP 0x00000004 | ||
| 529 | #define NIF_STATE 0x00000008 | ||
| 530 | #define NIF_INFO 0x00000010 | ||
| 531 | #if _WIN32_IE >= 0x600 | ||
| 532 | #define NIF_GUID 0x00000020 | ||
| 533 | #endif | ||
| 534 | #if NTDDI_VERSION >= 0x06000000 | ||
| 535 | #define NIF_REALTIME 0x00000040 | ||
| 536 | #define NIF_SHOWTIP 0x00000080 | ||
| 537 | #endif | ||
| 538 | |||
| 539 | #define NIS_HIDDEN 0x00000001 | ||
| 540 | #define NIS_SHAREDICON 0x00000002 | ||
| 541 | |||
| 542 | #define NIIF_NONE 0x00000000 | ||
| 543 | #define NIIF_INFO 0x00000001 | ||
| 544 | #define NIIF_WARNING 0x00000002 | ||
| 545 | #define NIIF_ERROR 0x00000003 | ||
| 546 | #define NIIF_USER 0x00000004 | ||
| 547 | #define NIIF_ICON_MASK 0x0000000f | ||
| 548 | #define NIIF_NOSOUND 0x00000010 | ||
| 549 | #if NTDDI_VERSION >= 0x06000000 | ||
| 550 | #define NIIF_LARGE_ICON 0x00000020 | ||
| 551 | #endif | ||
| 552 | #if NTDDI_VERSION >= 0x06010000 | ||
| 553 | #define NIIF_RESPECT_QUIET_TIME 0x00000080 | ||
| 554 | #endif | ||
| 555 | |||
| 556 | typedef struct _NOTIFYICONIDENTIFIER { | ||
| 557 | DWORD cbSize; | ||
| 558 | HWND hWnd; | ||
| 559 | UINT uID; | ||
| 560 | GUID guidItem; | ||
| 561 | } NOTIFYICONIDENTIFIER,*PNOTIFYICONIDENTIFIER; | ||
| 562 | |||
| 563 | SHSTDAPI_(WINBOOL) Shell_NotifyIconA (DWORD dwMessage, PNOTIFYICONDATAA lpData); | ||
| 564 | SHSTDAPI_(WINBOOL) Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW lpData); | ||
| 565 | |||
| 566 | #define Shell_NotifyIcon __MINGW_NAME_AW(Shell_NotifyIcon) | ||
| 567 | |||
| 568 | #if NTDDI_VERSION >= 0x06010000 | ||
| 569 | SHSTDAPI Shell_NotifyIconGetRect (const NOTIFYICONIDENTIFIER *identifier, RECT *iconLocation); | ||
| 570 | #endif | ||
| 571 | |||
| 572 | #ifndef SHFILEINFO_DEFINED | ||
| 573 | #define SHFILEINFO_DEFINED | ||
| 574 | |||
| 575 | typedef struct _SHFILEINFOA { | ||
| 576 | HICON hIcon; | ||
| 577 | int iIcon; | ||
| 578 | DWORD dwAttributes; | ||
| 579 | CHAR szDisplayName[MAX_PATH]; | ||
| 580 | CHAR szTypeName[80]; | ||
| 581 | } SHFILEINFOA; | ||
| 582 | |||
| 583 | typedef struct _SHFILEINFOW { | ||
| 584 | HICON hIcon; | ||
| 585 | int iIcon; | ||
| 586 | DWORD dwAttributes; | ||
| 587 | WCHAR szDisplayName[MAX_PATH]; | ||
| 588 | WCHAR szTypeName[80]; | ||
| 589 | } SHFILEINFOW; | ||
| 590 | |||
| 591 | __MINGW_TYPEDEF_AW(SHFILEINFO) | ||
| 592 | #endif | ||
| 593 | |||
| 594 | #define SHGFI_ICON 0x000000100 | ||
| 595 | #define SHGFI_DISPLAYNAME 0x000000200 | ||
| 596 | #define SHGFI_TYPENAME 0x000000400 | ||
| 597 | #define SHGFI_ATTRIBUTES 0x000000800 | ||
| 598 | #define SHGFI_ICONLOCATION 0x000001000 | ||
| 599 | #define SHGFI_EXETYPE 0x000002000 | ||
| 600 | #define SHGFI_SYSICONINDEX 0x000004000 | ||
| 601 | #define SHGFI_LINKOVERLAY 0x000008000 | ||
| 602 | #define SHGFI_SELECTED 0x000010000 | ||
| 603 | #define SHGFI_ATTR_SPECIFIED 0x000020000 | ||
| 604 | |||
| 605 | #define SHGFI_LARGEICON 0x000000000 | ||
| 606 | #define SHGFI_SMALLICON 0x000000001 | ||
| 607 | #define SHGFI_OPENICON 0x000000002 | ||
| 608 | #define SHGFI_SHELLICONSIZE 0x000000004 | ||
| 609 | #define SHGFI_PIDL 0x000000008 | ||
| 610 | #define SHGFI_USEFILEATTRIBUTES 0x000000010 | ||
| 611 | |||
| 612 | #define SHGFI_ADDOVERLAYS 0x000000020 | ||
| 613 | #define SHGFI_OVERLAYINDEX 0x000000040 | ||
| 614 | |||
| 615 | SHSTDAPI_(DWORD_PTR) SHGetFileInfoA (LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA *psfi, UINT cbFileInfo, UINT uFlags); | ||
| 616 | SHSTDAPI_(DWORD_PTR) SHGetFileInfoW (LPCWSTR pszPath, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags); | ||
| 617 | |||
| 618 | #define SHGetFileInfo __MINGW_NAME_AW(SHGetFileInfo) | ||
| 619 | |||
| 620 | #if NTDDI_VERSION >= 0x06000000 | ||
| 621 | typedef struct _SHSTOCKICONINFO { | ||
| 622 | DWORD cbSize; | ||
| 623 | HICON hIcon; | ||
| 624 | int iSysImageIndex; | ||
| 625 | int iIcon; | ||
| 626 | WCHAR szPath[MAX_PATH]; | ||
| 627 | } SHSTOCKICONINFO; | ||
| 628 | |||
| 629 | #define SHGSI_ICONLOCATION 0 | ||
| 630 | #define SHGSI_ICON SHGFI_ICON | ||
| 631 | #define SHGSI_SYSICONINDEX SHGFI_SYSICONINDEX | ||
| 632 | #define SHGSI_LINKOVERLAY SHGFI_LINKOVERLAY | ||
| 633 | #define SHGSI_SELECTED SHGFI_SELECTED | ||
| 634 | #define SHGSI_LARGEICON SHGFI_LARGEICON | ||
| 635 | #define SHGSI_SMALLICON SHGFI_SMALLICON | ||
| 636 | #define SHGSI_SHELLICONSIZE SHGFI_SHELLICONSIZE | ||
| 637 | |||
| 638 | typedef enum SHSTOCKICONID { | ||
| 639 | SIID_DOCNOASSOC = 0, | ||
| 640 | SIID_DOCASSOC = 1, | ||
| 641 | SIID_APPLICATION = 2, | ||
| 642 | SIID_FOLDER = 3, | ||
| 643 | SIID_FOLDEROPEN = 4, | ||
| 644 | SIID_DRIVE525 = 5, | ||
| 645 | SIID_DRIVE35 = 6, | ||
| 646 | SIID_DRIVEREMOVE = 7, | ||
| 647 | SIID_DRIVEFIXED = 8, | ||
| 648 | SIID_DRIVENET = 9, | ||
| 649 | SIID_DRIVENETDISABLED = 10, | ||
| 650 | SIID_DRIVECD = 11, | ||
| 651 | SIID_DRIVERAM = 12, | ||
| 652 | SIID_WORLD = 13, | ||
| 653 | SIID_SERVER = 15, | ||
| 654 | SIID_PRINTER = 16, | ||
| 655 | SIID_MYNETWORK = 17, | ||
| 656 | SIID_FIND = 22, | ||
| 657 | SIID_HELP = 23, | ||
| 658 | SIID_SHARE = 28, | ||
| 659 | SIID_LINK = 29, | ||
| 660 | SIID_SLOWFILE = 30, | ||
| 661 | SIID_RECYCLER = 31, | ||
| 662 | SIID_RECYCLERFULL = 32, | ||
| 663 | SIID_MEDIACDAUDIO = 40, | ||
| 664 | SIID_LOCK = 47, | ||
| 665 | SIID_AUTOLIST = 49, | ||
| 666 | SIID_PRINTERNET = 50, | ||
| 667 | SIID_SERVERSHARE = 51, | ||
| 668 | SIID_PRINTERFAX = 52, | ||
| 669 | SIID_PRINTERFAXNET = 53, | ||
| 670 | SIID_PRINTERFILE = 54, | ||
| 671 | SIID_STACK = 55, | ||
| 672 | SIID_MEDIASVCD = 56, | ||
| 673 | SIID_STUFFEDFOLDER = 57, | ||
| 674 | SIID_DRIVEUNKNOWN = 58, | ||
| 675 | SIID_DRIVEDVD = 59, | ||
| 676 | SIID_MEDIADVD = 60, | ||
| 677 | SIID_MEDIADVDRAM = 61, | ||
| 678 | SIID_MEDIADVDRW = 62, | ||
| 679 | SIID_MEDIADVDR = 63, | ||
| 680 | SIID_MEDIADVDROM = 64, | ||
| 681 | SIID_MEDIACDAUDIOPLUS = 65, | ||
| 682 | SIID_MEDIACDRW = 66, | ||
| 683 | SIID_MEDIACDR = 67, | ||
| 684 | SIID_MEDIACDBURN = 68, | ||
| 685 | SIID_MEDIABLANKCD = 69, | ||
| 686 | SIID_MEDIACDROM = 70, | ||
| 687 | SIID_AUDIOFILES = 71, | ||
| 688 | SIID_IMAGEFILES = 72, | ||
| 689 | SIID_VIDEOFILES = 73, | ||
| 690 | SIID_MIXEDFILES = 74, | ||
| 691 | SIID_FOLDERBACK = 75, | ||
| 692 | SIID_FOLDERFRONT = 76, | ||
| 693 | SIID_SHIELD = 77, | ||
| 694 | SIID_WARNING = 78, | ||
| 695 | SIID_INFO = 79, | ||
| 696 | SIID_ERROR = 80, | ||
| 697 | SIID_KEY = 81, | ||
| 698 | SIID_SOFTWARE = 82, | ||
| 699 | SIID_RENAME = 83, | ||
| 700 | SIID_DELETE = 84, | ||
| 701 | SIID_MEDIAAUDIODVD = 85, | ||
| 702 | SIID_MEDIAMOVIEDVD = 86, | ||
| 703 | SIID_MEDIAENHANCEDCD = 87, | ||
| 704 | SIID_MEDIAENHANCEDDVD = 88, | ||
| 705 | SIID_MEDIAHDDVD = 89, | ||
| 706 | SIID_MEDIABLURAY = 90, | ||
| 707 | SIID_MEDIAVCD = 91, | ||
| 708 | SIID_MEDIADVDPLUSR = 92, | ||
| 709 | SIID_MEDIADVDPLUSRW = 93, | ||
| 710 | SIID_DESKTOPPC = 94, | ||
| 711 | SIID_MOBILEPC = 95, | ||
| 712 | SIID_USERS = 96, | ||
| 713 | SIID_MEDIASMARTMEDIA = 97, | ||
| 714 | SIID_MEDIACOMPACTFLASH = 98, | ||
| 715 | SIID_DEVICECELLPHONE = 99, | ||
| 716 | SIID_DEVICECAMERA = 100, | ||
| 717 | SIID_DEVICEVIDEOCAMERA = 101, | ||
| 718 | SIID_DEVICEAUDIOPLAYER = 102, | ||
| 719 | SIID_NETWORKCONNECT = 103, | ||
| 720 | SIID_INTERNET = 104, | ||
| 721 | SIID_ZIPFILE = 105, | ||
| 722 | SIID_SETTINGS = 106, | ||
| 723 | |||
| 724 | SIID_DRIVEHDDVD = 132, | ||
| 725 | SIID_DRIVEBD = 133, | ||
| 726 | SIID_MEDIAHDDVDROM = 134, | ||
| 727 | SIID_MEDIAHDDVDR = 135, | ||
| 728 | SIID_MEDIAHDDVDRAM = 136, | ||
| 729 | SIID_MEDIABDROM = 137, | ||
| 730 | SIID_MEDIABDR = 138, | ||
| 731 | SIID_MEDIABDRE = 139, | ||
| 732 | SIID_CLUSTEREDDRIVE = 140, | ||
| 733 | |||
| 734 | SIID_MAX_ICONS = 175 | ||
| 735 | } SHSTOCKICONID; | ||
| 736 | |||
| 737 | #define SIID_INVALID ((SHSTOCKICONID)-1) | ||
| 738 | |||
| 739 | SHSTDAPI SHGetStockIconInfo (SHSTOCKICONID siid, UINT uFlags, SHSTOCKICONINFO *psii); | ||
| 740 | #endif | ||
| 741 | |||
| 742 | #define SHGetDiskFreeSpace SHGetDiskFreeSpaceEx | ||
| 743 | |||
| 744 | SHSTDAPI_(WINBOOL) SHGetDiskFreeSpaceExA (LPCSTR pszDirectoryName, ULARGE_INTEGER *pulFreeBytesAvailableToCaller, ULARGE_INTEGER *pulTotalNumberOfBytes, ULARGE_INTEGER *pulTotalNumberOfFreeBytes); | ||
| 745 | SHSTDAPI_(WINBOOL) SHGetDiskFreeSpaceExW (LPCWSTR pszDirectoryName, ULARGE_INTEGER *pulFreeBytesAvailableToCaller, ULARGE_INTEGER *pulTotalNumberOfBytes, ULARGE_INTEGER *pulTotalNumberOfFreeBytes); | ||
| 746 | SHSTDAPI_(WINBOOL) SHGetNewLinkInfoA (LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, WINBOOL *pfMustCopy, UINT uFlags); | ||
| 747 | SHSTDAPI_(WINBOOL) SHGetNewLinkInfoW (LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, WINBOOL *pfMustCopy, UINT uFlags); | ||
| 748 | |||
| 749 | #define SHGetDiskFreeSpaceEx __MINGW_NAME_AW(SHGetDiskFreeSpaceEx) | ||
| 750 | #define SHGetNewLinkInfo __MINGW_NAME_AW(SHGetNewLinkInfo) | ||
| 751 | |||
| 752 | #define SHGNLI_PIDL 0x000000001 | ||
| 753 | #define SHGNLI_PREFIXNAME 0x000000002 | ||
| 754 | #define SHGNLI_NOUNIQUE 0x000000004 | ||
| 755 | #define SHGNLI_NOLNK 0x000000008 | ||
| 756 | #if _WIN32_IE >= 0x0600 | ||
| 757 | #define SHGNLI_NOLOCNAME 0x000000010 | ||
| 758 | #endif | ||
| 759 | #if NTDDI_VERSION >= 0x06010000 | ||
| 760 | #define SHGNLI_USEURLEXT 0x000000020 | ||
| 761 | #endif | ||
| 762 | |||
| 763 | #define PRINTACTION_OPEN 0 | ||
| 764 | #define PRINTACTION_PROPERTIES 1 | ||
| 765 | #define PRINTACTION_NETINSTALL 2 | ||
| 766 | #define PRINTACTION_NETINSTALLLINK 3 | ||
| 767 | #define PRINTACTION_TESTPAGE 4 | ||
| 768 | #define PRINTACTION_OPENNETPRN 5 | ||
| 769 | #define PRINTACTION_DOCUMENTDEFAULTS 6 | ||
| 770 | #define PRINTACTION_SERVERPROPERTIES 7 | ||
| 771 | |||
| 772 | SHSTDAPI_(WINBOOL) SHInvokePrinterCommandA (HWND hwnd, UINT uAction, LPCSTR lpBuf1, LPCSTR lpBuf2, WINBOOL fModal); | ||
| 773 | SHSTDAPI_(WINBOOL) SHInvokePrinterCommandW (HWND hwnd, UINT uAction, LPCWSTR lpBuf1, LPCWSTR lpBuf2, WINBOOL fModal); | ||
| 774 | |||
| 775 | #define SHInvokePrinterCommand __MINGW_NAME_AW(SHInvokePrinterCommand) | ||
| 776 | |||
| 777 | #if NTDDI_VERSION >= 0x06000000 | ||
| 778 | typedef struct _OPEN_PRINTER_PROPS_INFOA { | ||
| 779 | DWORD dwSize; | ||
| 780 | LPSTR pszSheetName; | ||
| 781 | UINT uSheetIndex; | ||
| 782 | DWORD dwFlags; | ||
| 783 | WINBOOL bModal; | ||
| 784 | } OPEN_PRINTER_PROPS_INFOA,*POPEN_PRINTER_PROPS_INFOA; | ||
| 785 | |||
| 786 | typedef struct _OPEN_PRINTER_PROPS_INFOW { | ||
| 787 | DWORD dwSize; | ||
| 788 | LPWSTR pszSheetName; | ||
| 789 | UINT uSheetIndex; | ||
| 790 | DWORD dwFlags; | ||
| 791 | WINBOOL bModal; | ||
| 792 | } OPEN_PRINTER_PROPS_INFOW,*POPEN_PRINTER_PROPS_INFOW; | ||
| 793 | |||
| 794 | __MINGW_TYPEDEF_AW(OPEN_PRINTER_PROPS_INFO) | ||
| 795 | __MINGW_TYPEDEF_AW(POPEN_PRINTER_PROPS_INFO) | ||
| 796 | #define PRINT_PROP_FORCE_NAME 0x01 | ||
| 797 | #endif | ||
| 798 | |||
| 799 | SHSTDAPI SHLoadNonloadedIconOverlayIdentifiers (void); | ||
| 800 | SHSTDAPI SHIsFileAvailableOffline (PCWSTR pwszPath, DWORD *pdwStatus); | ||
| 801 | |||
| 802 | #define OFFLINE_STATUS_LOCAL 0x0001 | ||
| 803 | #define OFFLINE_STATUS_REMOTE 0x0002 | ||
| 804 | #define OFFLINE_STATUS_INCOMPLETE 0x0004 | ||
| 805 | |||
| 806 | SHSTDAPI SHSetLocalizedName (PCWSTR pszPath, PCWSTR pszResModule, int idsRes); | ||
| 807 | |||
| 808 | #if NTDDI_VERSION >= 0x06000000 | ||
| 809 | SHSTDAPI SHRemoveLocalizedName (PCWSTR pszPath); | ||
| 810 | SHSTDAPI SHGetLocalizedName (PCWSTR pszPath, PWSTR pszResModule, UINT cch, int *pidsRes); | ||
| 811 | #endif | ||
| 812 | |||
| 813 | #ifndef _SHLWAPI_ | ||
| 814 | #define LWSTDAPIV_(type) EXTERN_C DECLSPEC_IMPORT type STDAPIVCALLTYPE | ||
| 815 | #else | ||
| 816 | #define LWSTDAPIV_(type) STDAPIV_ (type) | ||
| 817 | #endif | ||
| 818 | |||
| 819 | LWSTDAPIV_ (int) ShellMessageBoxA (HINSTANCE hAppInst, HWND hWnd, LPCSTR lpcText, LPCSTR lpcTitle, UINT fuStyle,...); | ||
| 820 | LWSTDAPIV_ (int) ShellMessageBoxW (HINSTANCE hAppInst, HWND hWnd, LPCWSTR lpcText, LPCWSTR lpcTitle, UINT fuStyle,...); | ||
| 821 | |||
| 822 | #define ShellMessageBox __MINGW_NAME_AW(ShellMessageBox) | ||
| 823 | |||
| 824 | SHSTDAPI_(WINBOOL) IsLFNDriveA (LPCSTR pszPath); | ||
| 825 | SHSTDAPI_(WINBOOL) IsLFNDriveW (LPCWSTR pszPath); | ||
| 826 | |||
| 827 | #define IsLFNDrive __MINGW_NAME_AW(IsLFNDrive) | ||
| 828 | |||
| 829 | #if _WIN32_IE >= 0x0600 | ||
| 830 | STDAPI SHEnumerateUnreadMailAccountsA (HKEY hKeyUser, DWORD dwIndex, LPSTR pszMailAddress, int cchMailAddress); | ||
| 831 | STDAPI SHEnumerateUnreadMailAccountsW (HKEY hKeyUser, DWORD dwIndex, LPWSTR pszMailAddress, int cchMailAddress); | ||
| 832 | STDAPI SHGetUnreadMailCountA (HKEY hKeyUser, LPCSTR pszMailAddress, DWORD *pdwCount, FILETIME *pFileTime, LPSTR pszShellExecuteCommand, int cchShellExecuteCommand); | ||
| 833 | STDAPI SHGetUnreadMailCountW (HKEY hKeyUser, LPCWSTR pszMailAddress, DWORD *pdwCount, FILETIME *pFileTime, LPWSTR pszShellExecuteCommand, int cchShellExecuteCommand); | ||
| 834 | STDAPI SHSetUnreadMailCountA (LPCSTR pszMailAddress, DWORD dwCount, LPCSTR pszShellExecuteCommand); | ||
| 835 | STDAPI SHSetUnreadMailCountW (LPCWSTR pszMailAddress, DWORD dwCount, LPCWSTR pszShellExecuteCommand); | ||
| 836 | |||
| 837 | #define SHEnumerateUnreadMailAccounts __MINGW_NAME_AW(SHEnumerateUnreadMailAccounts) | ||
| 838 | #define SHGetUnreadMailCount __MINGW_NAME_AW(SHGetUnreadMailCount) | ||
| 839 | #define SHSetUnreadMailCount __MINGW_NAME_AW(SHSetUnreadMailCount) | ||
| 840 | |||
| 841 | #endif | ||
| 842 | #if _WIN32_IE >= 0x0601 | ||
| 843 | STDAPI_ (WINBOOL) SHTestTokenMembership (HANDLE hToken, ULONG ulRID); | ||
| 844 | #endif | ||
| 845 | |||
| 846 | #if _WIN32_IE >= 0x0600 | ||
| 847 | SHSTDAPI SHGetImageList (int iImageList, REFIID riid, void **ppvObj); | ||
| 848 | |||
| 849 | #define SHIL_LARGE 0 | ||
| 850 | #define SHIL_SMALL 1 | ||
| 851 | #define SHIL_EXTRALARGE 2 | ||
| 852 | #define SHIL_SYSSMALL 3 | ||
| 853 | #if NTDDI_VERSION >= 0x06000000 | ||
| 854 | #define SHIL_JUMBO 4 | ||
| 855 | #define SHIL_LAST SHIL_JUMBO | ||
| 856 | #else | ||
| 857 | #define SHIL_LAST SHIL_SYSSMALL | ||
| 858 | #endif | ||
| 859 | |||
| 860 | typedef HRESULT (STDMETHODCALLTYPE *PFNCANSHAREFOLDERW) (PCWSTR pszPath); | ||
| 861 | typedef HRESULT (STDMETHODCALLTYPE *PFNSHOWSHAREFOLDERUIW) (HWND hwndParent, PCWSTR pszPath); | ||
| 862 | |||
| 863 | #endif | ||
| 864 | #endif | ||
| 865 | |||
| 866 | #ifdef __cplusplus | ||
| 867 | } | ||
| 868 | #endif | ||
| 869 | |||
| 870 | #ifndef _WIN64 | ||
| 871 | #include <poppack.h> | ||
| 872 | #endif | ||
| 873 | |||
| 874 | #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) | ||
| 875 | #if NTDDI_VERSION >= 0x06000000 | ||
| 876 | |||
| 877 | #define WC_NETADDRESS L"msctls_netaddress" | ||
| 878 | |||
| 879 | SHSTDAPI_(WINBOOL) InitNetworkAddressControl (void); | ||
| 880 | |||
| 881 | #define NCM_GETADDRESS (WM_USER+1) | ||
| 882 | #define NetAddr_GetAddress(hwnd, pv) (HRESULT)SNDMSG (hwnd, NCM_GETADDRESS, 0,(LPARAM)pv) | ||
| 883 | |||
| 884 | typedef struct tagNC_ADDRESS { | ||
| 885 | struct NET_ADDRESS_INFO_ *pAddrInfo; | ||
| 886 | USHORT PortNumber; | ||
| 887 | BYTE PrefixLength; | ||
| 888 | } NC_ADDRESS,*PNC_ADDRESS; | ||
| 889 | |||
| 890 | #define NCM_SETALLOWTYPE (WM_USER+2) | ||
| 891 | #define NetAddr_SetAllowType(hwnd, addrMask) (HRESULT)SNDMSG (hwnd, NCM_SETALLOWTYPE,(WPARAM)addrMask, 0) | ||
| 892 | |||
| 893 | #define NCM_GETALLOWTYPE (WM_USER+3) | ||
| 894 | #define NetAddr_GetAllowType(hwnd) (DWORD)SNDMSG (hwnd, NCM_GETALLOWTYPE, 0, 0) | ||
| 895 | |||
| 896 | #define NCM_DISPLAYERRORTIP (WM_USER+4) | ||
| 897 | #define NetAddr_DisplayErrorTip(hwnd) (HRESULT)SNDMSG (hwnd, NCM_DISPLAYERRORTIP, 0, 0) | ||
| 898 | #endif | ||
| 899 | |||
| 900 | #if NTDDI_VERSION >= 0x06000000 | ||
| 901 | STDAPI SHGetDriveMedia (PCWSTR pszDrive, DWORD *pdwMediaContent); | ||
| 902 | #endif | ||
| 903 | #endif | ||
| 904 | #endif | ||
| @@ -1,79 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER within this package. | ||
| 5 | */ | ||
| 6 | #ifndef __TVOUT__ | ||
| 7 | #define __TVOUT__ | ||
| 8 | |||
| 9 | #include <guiddef.h> | ||
| 10 | |||
| 11 | typedef struct _VIDEOPARAMETERS { | ||
| 12 | GUID Guid; | ||
| 13 | ULONG dwOffset; | ||
| 14 | ULONG dwCommand; | ||
| 15 | ULONG dwFlags; | ||
| 16 | ULONG dwMode; | ||
| 17 | ULONG dwTVStandard; | ||
| 18 | ULONG dwAvailableModes; | ||
| 19 | ULONG dwAvailableTVStandard; | ||
| 20 | ULONG dwFlickerFilter; | ||
| 21 | ULONG dwOverScanX; | ||
| 22 | ULONG dwOverScanY; | ||
| 23 | ULONG dwMaxUnscaledX; | ||
| 24 | ULONG dwMaxUnscaledY; | ||
| 25 | ULONG dwPositionX; | ||
| 26 | ULONG dwPositionY; | ||
| 27 | ULONG dwBrightness; | ||
| 28 | ULONG dwContrast; | ||
| 29 | ULONG dwCPType; | ||
| 30 | ULONG dwCPCommand; | ||
| 31 | ULONG dwCPStandard; | ||
| 32 | ULONG dwCPKey; | ||
| 33 | ULONG bCP_APSTriggerBits; | ||
| 34 | UCHAR bOEMCopyProtection[256]; | ||
| 35 | } VIDEOPARAMETERS,*PVIDEOPARAMETERS,*LPVIDEOPARAMETERS; | ||
| 36 | |||
| 37 | #define VP_COMMAND_GET 0x0001 | ||
| 38 | #define VP_COMMAND_SET 0x0002 | ||
| 39 | |||
| 40 | #define VP_FLAGS_TV_MODE 0x0001 | ||
| 41 | #define VP_FLAGS_TV_STANDARD 0x0002 | ||
| 42 | #define VP_FLAGS_FLICKER 0x0004 | ||
| 43 | #define VP_FLAGS_OVERSCAN 0x0008 | ||
| 44 | #define VP_FLAGS_MAX_UNSCALED 0x0010 | ||
| 45 | #define VP_FLAGS_POSITION 0x0020 | ||
| 46 | #define VP_FLAGS_BRIGHTNESS 0x0040 | ||
| 47 | #define VP_FLAGS_CONTRAST 0x0080 | ||
| 48 | #define VP_FLAGS_COPYPROTECT 0x0100 | ||
| 49 | |||
| 50 | #define VP_MODE_WIN_GRAPHICS 0x0001 | ||
| 51 | #define VP_MODE_TV_PLAYBACK 0x0002 | ||
| 52 | |||
| 53 | #define VP_TV_STANDARD_NTSC_M 0x0001 | ||
| 54 | #define VP_TV_STANDARD_NTSC_M_J 0x0002 | ||
| 55 | #define VP_TV_STANDARD_PAL_B 0x0004 | ||
| 56 | #define VP_TV_STANDARD_PAL_D 0x0008 | ||
| 57 | #define VP_TV_STANDARD_PAL_H 0x0010 | ||
| 58 | #define VP_TV_STANDARD_PAL_I 0x0020 | ||
| 59 | #define VP_TV_STANDARD_PAL_M 0x0040 | ||
| 60 | #define VP_TV_STANDARD_PAL_N 0x0080 | ||
| 61 | #define VP_TV_STANDARD_SECAM_B 0x0100 | ||
| 62 | #define VP_TV_STANDARD_SECAM_D 0x0200 | ||
| 63 | #define VP_TV_STANDARD_SECAM_G 0x0400 | ||
| 64 | #define VP_TV_STANDARD_SECAM_H 0x0800 | ||
| 65 | #define VP_TV_STANDARD_SECAM_K 0x1000 | ||
| 66 | #define VP_TV_STANDARD_SECAM_K1 0x2000 | ||
| 67 | #define VP_TV_STANDARD_SECAM_L 0x4000 | ||
| 68 | #define VP_TV_STANDARD_WIN_VGA 0x8000 | ||
| 69 | #define VP_TV_STANDARD_NTSC_433 0x00010000 | ||
| 70 | #define VP_TV_STANDARD_PAL_G 0x00020000 | ||
| 71 | #define VP_TV_STANDARD_PAL_60 0x00040000 | ||
| 72 | #define VP_TV_STANDARD_SECAM_L1 0x00080000 | ||
| 73 | |||
| 74 | #define VP_CP_TYPE_APS_TRIGGER 0x0001 | ||
| 75 | #define VP_CP_TYPE_MACROVISION 0x0002 | ||
| 76 | #define VP_CP_CMD_ACTIVATE 0x0001 | ||
| 77 | #define VP_CP_CMD_DEACTIVATE 0x0002 | ||
| 78 | #define VP_CP_CMD_CHANGE 0x0004 | ||
| 79 | #endif | ||
| @@ -1,1253 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _WINSOCK2API_ | ||
| 8 | #define _WINSOCK2API_ | ||
| 9 | |||
| 10 | #include <_mingw_unicode.h> | ||
| 11 | |||
| 12 | #ifndef _WINSOCKAPI_ | ||
| 13 | #define _WINSOCKAPI_ | ||
| 14 | #else | ||
| 15 | #warning Please include winsock2.h before windows.h | ||
| 16 | #endif | ||
| 17 | |||
| 18 | #ifndef INCL_WINSOCK_API_TYPEDEFS | ||
| 19 | #define INCL_WINSOCK_API_TYPEDEFS 0 | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #ifndef _INC_WINDOWS | ||
| 23 | #include <windows.h> | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #ifndef MAKEWORD | ||
| 27 | #define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8)) | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #ifndef WINSOCK_VERSION | ||
| 31 | #define WINSOCK_VERSION MAKEWORD(2,2) | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #ifndef WINSOCK_API_LINKAGE | ||
| 35 | #ifdef DECLSPEC_IMPORT | ||
| 36 | #define WINSOCK_API_LINKAGE DECLSPEC_IMPORT | ||
| 37 | #else | ||
| 38 | #define WINSOCK_API_LINKAGE | ||
| 39 | #endif | ||
| 40 | #endif /* WINSOCK_API_LINKAGE */ | ||
| 41 | #define WSAAPI WINAPI | ||
| 42 | |||
| 43 | /* undefine macros from winsock.h */ | ||
| 44 | #include <psdk_inc/_ws1_undef.h> | ||
| 45 | |||
| 46 | #include <_timeval.h> | ||
| 47 | #include <_bsd_types.h> | ||
| 48 | #include <inaddr.h> | ||
| 49 | #include <psdk_inc/_socket_types.h> | ||
| 50 | #include <psdk_inc/_fd_types.h> | ||
| 51 | #include <psdk_inc/_ip_types.h> | ||
| 52 | #include <psdk_inc/_wsadata.h> | ||
| 53 | #include <ws2def.h> /* FIXME: include order */ | ||
| 54 | |||
| 55 | #ifdef __cplusplus | ||
| 56 | extern "C" { | ||
| 57 | #endif | ||
| 58 | |||
| 59 | extern int WINAPI __WSAFDIsSet(SOCKET,fd_set *); | ||
| 60 | |||
| 61 | #define FD_CLR(fd,set) \ | ||
| 62 | do { \ | ||
| 63 | u_int __i; \ | ||
| 64 | for(__i = 0; __i < ((fd_set *)(set))->fd_count; __i++) { \ | ||
| 65 | if (((fd_set *)(set))->fd_array[__i] == fd) { \ | ||
| 66 | while (__i < ((fd_set *)(set))->fd_count - 1) { \ | ||
| 67 | ((fd_set *)(set))->fd_array[__i] = \ | ||
| 68 | ((fd_set *)(set))->fd_array[__i + 1]; \ | ||
| 69 | __i++; \ | ||
| 70 | } \ | ||
| 71 | ((fd_set *)(set))->fd_count--; \ | ||
| 72 | break; \ | ||
| 73 | } \ | ||
| 74 | } \ | ||
| 75 | } while(0) | ||
| 76 | |||
| 77 | #define FD_ZERO(set) (((fd_set *)(set))->fd_count = 0) | ||
| 78 | |||
| 79 | #define FD_ISSET(fd,set) __WSAFDIsSet((SOCKET)(fd),(fd_set *)(set)) | ||
| 80 | |||
| 81 | #define FD_SET(fd,set) \ | ||
| 82 | do { \ | ||
| 83 | u_int __i; \ | ||
| 84 | for(__i = 0; __i < ((fd_set *)(set))->fd_count; __i++) { \ | ||
| 85 | if (((fd_set *)(set))->fd_array[__i] == (fd)) { \ | ||
| 86 | break; \ | ||
| 87 | } \ | ||
| 88 | } \ | ||
| 89 | if (__i == ((fd_set *)(set))->fd_count) { \ | ||
| 90 | if (((fd_set *)(set))->fd_count < FD_SETSIZE) { \ | ||
| 91 | ((fd_set *)(set))->fd_array[__i] = (fd); \ | ||
| 92 | ((fd_set *)(set))->fd_count++; \ | ||
| 93 | } \ | ||
| 94 | } \ | ||
| 95 | } while(0) | ||
| 96 | |||
| 97 | #define IOCPARM_MASK 0x7f | ||
| 98 | #define IOC_VOID 0x20000000 | ||
| 99 | #define IOC_OUT 0x40000000 | ||
| 100 | #define IOC_IN 0x80000000 | ||
| 101 | #define IOC_INOUT (IOC_IN|IOC_OUT) | ||
| 102 | |||
| 103 | #define _IO(x,y) (IOC_VOID|((x)<<8)|(y)) | ||
| 104 | #define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) | ||
| 105 | #define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) | ||
| 106 | |||
| 107 | #define FIONREAD _IOR('f',127,u_long) | ||
| 108 | #define FIONBIO _IOW('f',126,u_long) | ||
| 109 | #define FIOASYNC _IOW('f',125,u_long) | ||
| 110 | |||
| 111 | #define SIOCSHIWAT _IOW('s',0,u_long) | ||
| 112 | #define SIOCGHIWAT _IOR('s',1,u_long) | ||
| 113 | #define SIOCSLOWAT _IOW('s',2,u_long) | ||
| 114 | #define SIOCGLOWAT _IOR('s',3,u_long) | ||
| 115 | #define SIOCATMARK _IOR('s',7,u_long) | ||
| 116 | |||
| 117 | #define IPPROTO_IP 0 | ||
| 118 | #define IPPROTO_HOPOPTS 0 | ||
| 119 | #define IPPROTO_ICMP 1 | ||
| 120 | #define IPPROTO_IGMP 2 | ||
| 121 | #define IPPROTO_GGP 3 | ||
| 122 | #define IPPROTO_IPV4 4 | ||
| 123 | #define IPPROTO_TCP 6 | ||
| 124 | #define IPPROTO_PUP 12 | ||
| 125 | #define IPPROTO_UDP 17 | ||
| 126 | #define IPPROTO_IDP 22 | ||
| 127 | #define IPPROTO_IPV6 41 | ||
| 128 | #define IPPROTO_ROUTING 43 | ||
| 129 | #define IPPROTO_FRAGMENT 44 | ||
| 130 | #define IPPROTO_ESP 50 | ||
| 131 | #define IPPROTO_AH 51 | ||
| 132 | #define IPPROTO_ICMPV6 58 | ||
| 133 | #define IPPROTO_NONE 59 | ||
| 134 | #define IPPROTO_DSTOPTS 60 | ||
| 135 | #define IPPROTO_ND 77 | ||
| 136 | #define IPPROTO_ICLFXBM 78 | ||
| 137 | |||
| 138 | #define IPPROTO_RAW 255 | ||
| 139 | #define IPPROTO_MAX 256 | ||
| 140 | |||
| 141 | #define IPPORT_ECHO 7 | ||
| 142 | #define IPPORT_DISCARD 9 | ||
| 143 | #define IPPORT_SYSTAT 11 | ||
| 144 | #define IPPORT_DAYTIME 13 | ||
| 145 | #define IPPORT_NETSTAT 15 | ||
| 146 | #define IPPORT_FTP 21 | ||
| 147 | #define IPPORT_TELNET 23 | ||
| 148 | #define IPPORT_SMTP 25 | ||
| 149 | #define IPPORT_TIMESERVER 37 | ||
| 150 | #define IPPORT_NAMESERVER 42 | ||
| 151 | #define IPPORT_WHOIS 43 | ||
| 152 | #define IPPORT_MTP 57 | ||
| 153 | |||
| 154 | #define IPPORT_TFTP 69 | ||
| 155 | #define IPPORT_RJE 77 | ||
| 156 | #define IPPORT_FINGER 79 | ||
| 157 | #define IPPORT_TTYLINK 87 | ||
| 158 | #define IPPORT_SUPDUP 95 | ||
| 159 | |||
| 160 | #define IPPORT_EXECSERVER 512 | ||
| 161 | #define IPPORT_LOGINSERVER 513 | ||
| 162 | #define IPPORT_CMDSERVER 514 | ||
| 163 | #define IPPORT_EFSSERVER 520 | ||
| 164 | |||
| 165 | #define IPPORT_BIFFUDP 512 | ||
| 166 | #define IPPORT_WHOSERVER 513 | ||
| 167 | #define IPPORT_ROUTESERVER 520 | ||
| 168 | |||
| 169 | #define IPPORT_RESERVED 1024 | ||
| 170 | |||
| 171 | #define IMPLINK_IP 155 | ||
| 172 | #define IMPLINK_LOWEXPER 156 | ||
| 173 | #define IMPLINK_HIGHEXPER 158 | ||
| 174 | |||
| 175 | |||
| 176 | #define IN_CLASSA(i) (((long)(i) & 0x80000000)==0) | ||
| 177 | #define IN_CLASSA_NET 0xff000000 | ||
| 178 | #define IN_CLASSA_NSHIFT 24 | ||
| 179 | #define IN_CLASSA_HOST 0x00ffffff | ||
| 180 | #define IN_CLASSA_MAX 128 | ||
| 181 | |||
| 182 | #define IN_CLASSB(i) (((long)(i) & 0xc0000000)==0x80000000) | ||
| 183 | #define IN_CLASSB_NET 0xffff0000 | ||
| 184 | #define IN_CLASSB_NSHIFT 16 | ||
| 185 | #define IN_CLASSB_HOST 0x0000ffff | ||
| 186 | #define IN_CLASSB_MAX 65536 | ||
| 187 | |||
| 188 | #define IN_CLASSC(i) (((long)(i) & 0xe0000000)==0xc0000000) | ||
| 189 | #define IN_CLASSC_NET 0xffffff00 | ||
| 190 | #define IN_CLASSC_NSHIFT 8 | ||
| 191 | #define IN_CLASSC_HOST 0x000000ff | ||
| 192 | |||
| 193 | #define IN_CLASSD(i) (((long)(i) & 0xf0000000)==0xe0000000) | ||
| 194 | #define IN_CLASSD_NET 0xf0000000 | ||
| 195 | #define IN_CLASSD_NSHIFT 28 | ||
| 196 | #define IN_CLASSD_HOST 0x0fffffff | ||
| 197 | #define IN_MULTICAST(i) IN_CLASSD(i) | ||
| 198 | |||
| 199 | #define INADDR_ANY (u_long)0x00000000 | ||
| 200 | #define INADDR_LOOPBACK 0x7f000001 | ||
| 201 | #define INADDR_BROADCAST (u_long)0xffffffff | ||
| 202 | #define INADDR_NONE 0xffffffff | ||
| 203 | |||
| 204 | #define ADDR_ANY INADDR_ANY | ||
| 205 | |||
| 206 | #define FROM_PROTOCOL_INFO (-1) | ||
| 207 | |||
| 208 | #define SOCK_STREAM 1 | ||
| 209 | #define SOCK_DGRAM 2 | ||
| 210 | #define SOCK_RAW 3 | ||
| 211 | #define SOCK_RDM 4 | ||
| 212 | #define SOCK_SEQPACKET 5 | ||
| 213 | |||
| 214 | #define SO_DEBUG 0x0001 | ||
| 215 | #define SO_ACCEPTCONN 0x0002 | ||
| 216 | #define SO_REUSEADDR 0x0004 | ||
| 217 | #define SO_KEEPALIVE 0x0008 | ||
| 218 | #define SO_DONTROUTE 0x0010 | ||
| 219 | #define SO_BROADCAST 0x0020 | ||
| 220 | #define SO_USELOOPBACK 0x0040 | ||
| 221 | #define SO_LINGER 0x0080 | ||
| 222 | #define SO_OOBINLINE 0x0100 | ||
| 223 | |||
| 224 | #define SO_DONTLINGER (int)(~SO_LINGER) | ||
| 225 | #define SO_EXCLUSIVEADDRUSE ((int)(~SO_REUSEADDR)) | ||
| 226 | |||
| 227 | #define SO_SNDBUF 0x1001 | ||
| 228 | #define SO_RCVBUF 0x1002 | ||
| 229 | #define SO_SNDLOWAT 0x1003 | ||
| 230 | #define SO_RCVLOWAT 0x1004 | ||
| 231 | #define SO_SNDTIMEO 0x1005 | ||
| 232 | #define SO_RCVTIMEO 0x1006 | ||
| 233 | #define SO_ERROR 0x1007 | ||
| 234 | #define SO_TYPE 0x1008 | ||
| 235 | |||
| 236 | #define SO_GROUP_ID 0x2001 | ||
| 237 | #define SO_GROUP_PRIORITY 0x2002 | ||
| 238 | #define SO_MAX_MSG_SIZE 0x2003 | ||
| 239 | #define SO_PROTOCOL_INFOA 0x2004 | ||
| 240 | #define SO_PROTOCOL_INFOW 0x2005 | ||
| 241 | |||
| 242 | #define SO_PROTOCOL_INFO __MINGW_NAME_AW(SO_PROTOCOL_INFO) | ||
| 243 | |||
| 244 | #define PVD_CONFIG 0x3001 | ||
| 245 | #define SO_CONDITIONAL_ACCEPT 0x3002 | ||
| 246 | |||
| 247 | #define TCP_NODELAY 0x0001 | ||
| 248 | |||
| 249 | #define AF_UNSPEC 0 | ||
| 250 | |||
| 251 | #define AF_UNIX 1 | ||
| 252 | #define AF_INET 2 | ||
| 253 | #define AF_IMPLINK 3 | ||
| 254 | #define AF_PUP 4 | ||
| 255 | #define AF_CHAOS 5 | ||
| 256 | #define AF_NS 6 | ||
| 257 | #define AF_IPX AF_NS | ||
| 258 | #define AF_ISO 7 | ||
| 259 | #define AF_OSI AF_ISO | ||
| 260 | #define AF_ECMA 8 | ||
| 261 | #define AF_DATAKIT 9 | ||
| 262 | #define AF_CCITT 10 | ||
| 263 | #define AF_SNA 11 | ||
| 264 | #define AF_DECnet 12 | ||
| 265 | #define AF_DLI 13 | ||
| 266 | #define AF_LAT 14 | ||
| 267 | #define AF_HYLINK 15 | ||
| 268 | #define AF_APPLETALK 16 | ||
| 269 | #define AF_NETBIOS 17 | ||
| 270 | #define AF_VOICEVIEW 18 | ||
| 271 | #define AF_FIREFOX 19 | ||
| 272 | #define AF_UNKNOWN1 20 | ||
| 273 | #define AF_BAN 21 | ||
| 274 | #define AF_ATM 22 | ||
| 275 | #define AF_INET6 23 | ||
| 276 | #define AF_CLUSTER 24 | ||
| 277 | #define AF_12844 25 | ||
| 278 | #define AF_IRDA 26 | ||
| 279 | #define AF_NETDES 28 | ||
| 280 | #define AF_TCNPROCESS 29 | ||
| 281 | #define AF_TCNMESSAGE 30 | ||
| 282 | #define AF_ICLFXBM 31 | ||
| 283 | #define AF_BTH 32 | ||
| 284 | #define AF_MAX 33 | ||
| 285 | |||
| 286 | #define _SS_MAXSIZE 128 | ||
| 287 | #define _SS_ALIGNSIZE (8) | ||
| 288 | |||
| 289 | #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short)) | ||
| 290 | #define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) + _SS_PAD1SIZE + _SS_ALIGNSIZE)) | ||
| 291 | |||
| 292 | struct sockaddr_storage { | ||
| 293 | short ss_family; | ||
| 294 | char __ss_pad1[_SS_PAD1SIZE]; | ||
| 295 | |||
| 296 | __MINGW_EXTENSION __int64 __ss_align; | ||
| 297 | char __ss_pad2[_SS_PAD2SIZE]; | ||
| 298 | }; | ||
| 299 | |||
| 300 | #define PF_UNSPEC AF_UNSPEC | ||
| 301 | #define PF_UNIX AF_UNIX | ||
| 302 | #define PF_INET AF_INET | ||
| 303 | #define PF_IMPLINK AF_IMPLINK | ||
| 304 | #define PF_PUP AF_PUP | ||
| 305 | #define PF_CHAOS AF_CHAOS | ||
| 306 | #define PF_NS AF_NS | ||
| 307 | #define PF_IPX AF_IPX | ||
| 308 | #define PF_ISO AF_ISO | ||
| 309 | #define PF_OSI AF_OSI | ||
| 310 | #define PF_ECMA AF_ECMA | ||
| 311 | #define PF_DATAKIT AF_DATAKIT | ||
| 312 | #define PF_CCITT AF_CCITT | ||
| 313 | #define PF_SNA AF_SNA | ||
| 314 | #define PF_DECnet AF_DECnet | ||
| 315 | #define PF_DLI AF_DLI | ||
| 316 | #define PF_LAT AF_LAT | ||
| 317 | #define PF_HYLINK AF_HYLINK | ||
| 318 | #define PF_APPLETALK AF_APPLETALK | ||
| 319 | #define PF_VOICEVIEW AF_VOICEVIEW | ||
| 320 | #define PF_FIREFOX AF_FIREFOX | ||
| 321 | #define PF_UNKNOWN1 AF_UNKNOWN1 | ||
| 322 | #define PF_BAN AF_BAN | ||
| 323 | #define PF_ATM AF_ATM | ||
| 324 | #define PF_INET6 AF_INET6 | ||
| 325 | #define PF_BTH AF_BTH | ||
| 326 | |||
| 327 | #define PF_MAX AF_MAX | ||
| 328 | |||
| 329 | #define SOL_SOCKET 0xffff | ||
| 330 | |||
| 331 | #define SOMAXCONN 0x7fffffff | ||
| 332 | |||
| 333 | #define MSG_OOB 0x1 | ||
| 334 | #define MSG_PEEK 0x2 | ||
| 335 | #define MSG_DONTROUTE 0x4 | ||
| 336 | #define MSG_WAITALL 0x8 | ||
| 337 | |||
| 338 | #define MSG_PARTIAL 0x8000 | ||
| 339 | |||
| 340 | #define MSG_INTERRUPT 0x10 | ||
| 341 | |||
| 342 | #define MSG_MAXIOVLEN 16 | ||
| 343 | |||
| 344 | #define MAXGETHOSTSTRUCT 1024 | ||
| 345 | |||
| 346 | #define FD_READ_BIT 0 | ||
| 347 | #define FD_READ (1 << FD_READ_BIT) | ||
| 348 | |||
| 349 | #define FD_WRITE_BIT 1 | ||
| 350 | #define FD_WRITE (1 << FD_WRITE_BIT) | ||
| 351 | |||
| 352 | #define FD_OOB_BIT 2 | ||
| 353 | #define FD_OOB (1 << FD_OOB_BIT) | ||
| 354 | |||
| 355 | #define FD_ACCEPT_BIT 3 | ||
| 356 | #define FD_ACCEPT (1 << FD_ACCEPT_BIT) | ||
| 357 | |||
| 358 | #define FD_CONNECT_BIT 4 | ||
| 359 | #define FD_CONNECT (1 << FD_CONNECT_BIT) | ||
| 360 | |||
| 361 | #define FD_CLOSE_BIT 5 | ||
| 362 | #define FD_CLOSE (1 << FD_CLOSE_BIT) | ||
| 363 | |||
| 364 | #define FD_QOS_BIT 6 | ||
| 365 | #define FD_QOS (1 << FD_QOS_BIT) | ||
| 366 | |||
| 367 | #define FD_GROUP_QOS_BIT 7 | ||
| 368 | #define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT) | ||
| 369 | |||
| 370 | #define FD_ROUTING_INTERFACE_CHANGE_BIT 8 | ||
| 371 | #define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT) | ||
| 372 | |||
| 373 | #define FD_ADDRESS_LIST_CHANGE_BIT 9 | ||
| 374 | #define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT) | ||
| 375 | |||
| 376 | #define FD_MAX_EVENTS 10 | ||
| 377 | #define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1) | ||
| 378 | |||
| 379 | #include <psdk_inc/_wsa_errnos.h> | ||
| 380 | |||
| 381 | #define WSAEVENT HANDLE | ||
| 382 | #define LPWSAEVENT LPHANDLE | ||
| 383 | #define WSAOVERLAPPED OVERLAPPED | ||
| 384 | |||
| 385 | typedef struct _OVERLAPPED *LPWSAOVERLAPPED; | ||
| 386 | |||
| 387 | #define WSA_IO_PENDING (ERROR_IO_PENDING) | ||
| 388 | #define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE) | ||
| 389 | #define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE) | ||
| 390 | #define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER) | ||
| 391 | #define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY) | ||
| 392 | #define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED) | ||
| 393 | |||
| 394 | #define WSA_INVALID_EVENT ((WSAEVENT)NULL) | ||
| 395 | #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS) | ||
| 396 | #define WSA_WAIT_FAILED (WAIT_FAILED) | ||
| 397 | #define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0) | ||
| 398 | #define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION) | ||
| 399 | #define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT) | ||
| 400 | #define WSA_INFINITE (INFINITE) | ||
| 401 | |||
| 402 | typedef struct _WSABUF { | ||
| 403 | u_long len; | ||
| 404 | char *buf; | ||
| 405 | } WSABUF,*LPWSABUF; | ||
| 406 | |||
| 407 | #include <qos.h> | ||
| 408 | |||
| 409 | typedef struct _QualityOfService { | ||
| 410 | FLOWSPEC SendingFlowspec; | ||
| 411 | FLOWSPEC ReceivingFlowspec; | ||
| 412 | WSABUF ProviderSpecific; | ||
| 413 | } QOS,*LPQOS; | ||
| 414 | |||
| 415 | #define CF_ACCEPT 0x0000 | ||
| 416 | #define CF_REJECT 0x0001 | ||
| 417 | #define CF_DEFER 0x0002 | ||
| 418 | |||
| 419 | #define SD_RECEIVE 0x00 | ||
| 420 | #define SD_SEND 0x01 | ||
| 421 | #define SD_BOTH 0x02 | ||
| 422 | |||
| 423 | typedef unsigned int GROUP; | ||
| 424 | |||
| 425 | #define SG_UNCONSTRAINED_GROUP 0x01 | ||
| 426 | #define SG_CONSTRAINED_GROUP 0x02 | ||
| 427 | |||
| 428 | typedef struct _WSANETWORKEVENTS { | ||
| 429 | long lNetworkEvents; | ||
| 430 | int iErrorCode[FD_MAX_EVENTS]; | ||
| 431 | } WSANETWORKEVENTS,*LPWSANETWORKEVENTS; | ||
| 432 | |||
| 433 | #ifndef GUID_DEFINED | ||
| 434 | #include <guiddef.h> | ||
| 435 | #endif | ||
| 436 | |||
| 437 | #define MAX_PROTOCOL_CHAIN 7 | ||
| 438 | |||
| 439 | #define BASE_PROTOCOL 1 | ||
| 440 | #define LAYERED_PROTOCOL 0 | ||
| 441 | |||
| 442 | typedef struct _WSAPROTOCOLCHAIN { | ||
| 443 | int ChainLen; | ||
| 444 | |||
| 445 | DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; | ||
| 446 | } WSAPROTOCOLCHAIN,*LPWSAPROTOCOLCHAIN; | ||
| 447 | |||
| 448 | #define WSAPROTOCOL_LEN 255 | ||
| 449 | |||
| 450 | typedef struct _WSAPROTOCOL_INFOA { | ||
| 451 | DWORD dwServiceFlags1; | ||
| 452 | DWORD dwServiceFlags2; | ||
| 453 | DWORD dwServiceFlags3; | ||
| 454 | DWORD dwServiceFlags4; | ||
| 455 | DWORD dwProviderFlags; | ||
| 456 | GUID ProviderId; | ||
| 457 | DWORD dwCatalogEntryId; | ||
| 458 | WSAPROTOCOLCHAIN ProtocolChain; | ||
| 459 | int iVersion; | ||
| 460 | int iAddressFamily; | ||
| 461 | int iMaxSockAddr; | ||
| 462 | int iMinSockAddr; | ||
| 463 | int iSocketType; | ||
| 464 | int iProtocol; | ||
| 465 | int iProtocolMaxOffset; | ||
| 466 | int iNetworkByteOrder; | ||
| 467 | int iSecurityScheme; | ||
| 468 | DWORD dwMessageSize; | ||
| 469 | DWORD dwProviderReserved; | ||
| 470 | CHAR szProtocol[WSAPROTOCOL_LEN+1]; | ||
| 471 | } WSAPROTOCOL_INFOA,*LPWSAPROTOCOL_INFOA; | ||
| 472 | |||
| 473 | typedef struct _WSAPROTOCOL_INFOW { | ||
| 474 | DWORD dwServiceFlags1; | ||
| 475 | DWORD dwServiceFlags2; | ||
| 476 | DWORD dwServiceFlags3; | ||
| 477 | DWORD dwServiceFlags4; | ||
| 478 | DWORD dwProviderFlags; | ||
| 479 | GUID ProviderId; | ||
| 480 | DWORD dwCatalogEntryId; | ||
| 481 | WSAPROTOCOLCHAIN ProtocolChain; | ||
| 482 | int iVersion; | ||
| 483 | int iAddressFamily; | ||
| 484 | int iMaxSockAddr; | ||
| 485 | int iMinSockAddr; | ||
| 486 | int iSocketType; | ||
| 487 | int iProtocol; | ||
| 488 | int iProtocolMaxOffset; | ||
| 489 | int iNetworkByteOrder; | ||
| 490 | int iSecurityScheme; | ||
| 491 | DWORD dwMessageSize; | ||
| 492 | DWORD dwProviderReserved; | ||
| 493 | WCHAR szProtocol[WSAPROTOCOL_LEN+1]; | ||
| 494 | } WSAPROTOCOL_INFOW,*LPWSAPROTOCOL_INFOW; | ||
| 495 | |||
| 496 | __MINGW_TYPEDEF_AW(WSAPROTOCOL_INFO) | ||
| 497 | __MINGW_TYPEDEF_AW(LPWSAPROTOCOL_INFO) | ||
| 498 | |||
| 499 | #define PFL_MULTIPLE_PROTO_ENTRIES 0x00000001 | ||
| 500 | #define PFL_RECOMMENDED_PROTO_ENTRY 0x00000002 | ||
| 501 | #define PFL_HIDDEN 0x00000004 | ||
| 502 | #define PFL_MATCHES_PROTOCOL_ZERO 0x00000008 | ||
| 503 | |||
| 504 | #define XP1_CONNECTIONLESS 0x00000001 | ||
| 505 | #define XP1_GUARANTEED_DELIVERY 0x00000002 | ||
| 506 | #define XP1_GUARANTEED_ORDER 0x00000004 | ||
| 507 | #define XP1_MESSAGE_ORIENTED 0x00000008 | ||
| 508 | #define XP1_PSEUDO_STREAM 0x00000010 | ||
| 509 | #define XP1_GRACEFUL_CLOSE 0x00000020 | ||
| 510 | #define XP1_EXPEDITED_DATA 0x00000040 | ||
| 511 | #define XP1_CONNECT_DATA 0x00000080 | ||
| 512 | #define XP1_DISCONNECT_DATA 0x00000100 | ||
| 513 | #define XP1_SUPPORT_BROADCAST 0x00000200 | ||
| 514 | #define XP1_SUPPORT_MULTIPOINT 0x00000400 | ||
| 515 | #define XP1_MULTIPOINT_CONTROL_PLANE 0x00000800 | ||
| 516 | #define XP1_MULTIPOINT_DATA_PLANE 0x00001000 | ||
| 517 | #define XP1_QOS_SUPPORTED 0x00002000 | ||
| 518 | #define XP1_INTERRUPT 0x00004000 | ||
| 519 | #define XP1_UNI_SEND 0x00008000 | ||
| 520 | #define XP1_UNI_RECV 0x00010000 | ||
| 521 | #define XP1_IFS_HANDLES 0x00020000 | ||
| 522 | #define XP1_PARTIAL_MESSAGE 0x00040000 | ||
| 523 | |||
| 524 | #define BIGENDIAN 0x0000 | ||
| 525 | #define LITTLEENDIAN 0x0001 | ||
| 526 | |||
| 527 | #define SECURITY_PROTOCOL_NONE 0x0000 | ||
| 528 | |||
| 529 | #define JL_SENDER_ONLY 0x01 | ||
| 530 | #define JL_RECEIVER_ONLY 0x02 | ||
| 531 | #define JL_BOTH 0x04 | ||
| 532 | |||
| 533 | #define WSA_FLAG_OVERLAPPED 0x01 | ||
| 534 | #define WSA_FLAG_MULTIPOINT_C_ROOT 0x02 | ||
| 535 | #define WSA_FLAG_MULTIPOINT_C_LEAF 0x04 | ||
| 536 | #define WSA_FLAG_MULTIPOINT_D_ROOT 0x08 | ||
| 537 | #define WSA_FLAG_MULTIPOINT_D_LEAF 0x10 | ||
| 538 | |||
| 539 | #define IOC_UNIX 0x00000000 | ||
| 540 | #define IOC_WS2 0x08000000 | ||
| 541 | #define IOC_PROTOCOL 0x10000000 | ||
| 542 | #define IOC_VENDOR 0x18000000 | ||
| 543 | |||
| 544 | #define _WSAIO(x,y) (IOC_VOID|(x)|(y)) | ||
| 545 | #define _WSAIOR(x,y) (IOC_OUT|(x)|(y)) | ||
| 546 | #define _WSAIOW(x,y) (IOC_IN|(x)|(y)) | ||
| 547 | #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y)) | ||
| 548 | |||
| 549 | #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1) | ||
| 550 | #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2) | ||
| 551 | #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3) | ||
| 552 | #define SIO_FLUSH _WSAIO(IOC_WS2,4) | ||
| 553 | #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5) | ||
| 554 | #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6) | ||
| 555 | #define SIO_GET_QOS _WSAIORW(IOC_WS2,7) | ||
| 556 | #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8) | ||
| 557 | #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9) | ||
| 558 | #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10) | ||
| 559 | #define SIO_SET_QOS _WSAIOW(IOC_WS2,11) | ||
| 560 | #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12) | ||
| 561 | #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13) | ||
| 562 | #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20) | ||
| 563 | #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21) | ||
| 564 | #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22) | ||
| 565 | #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23) | ||
| 566 | #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24) | ||
| 567 | #define SIO_ADDRESS_LIST_SORT _WSAIORW(IOC_WS2,25) | ||
| 568 | #if (_WIN32_WINNT >= 0x0600) | ||
| 569 | #define SIO_RESERVED_1 _WSAIOW(IOC_WS2,26) | ||
| 570 | #define SIO_RESERVED_2 _WSAIOW(IOC_WS2,33) | ||
| 571 | #endif /* _WIN32_WINNT >= 0x0600 */ | ||
| 572 | |||
| 573 | typedef int (CALLBACK *LPCONDITIONPROC)(LPWSABUF lpCallerId,LPWSABUF lpCallerData,LPQOS lpSQOS,LPQOS lpGQOS,LPWSABUF lpCalleeId,LPWSABUF lpCalleeData,GROUP *g,DWORD_PTR dwCallbackData); | ||
| 574 | typedef void (CALLBACK *LPWSAOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwError,DWORD cbTransferred,LPWSAOVERLAPPED lpOverlapped,DWORD dwFlags); | ||
| 575 | |||
| 576 | #define SIO_NSP_NOTIFY_CHANGE _WSAIOW(IOC_WS2,25) | ||
| 577 | |||
| 578 | typedef enum _WSACOMPLETIONTYPE { | ||
| 579 | NSP_NOTIFY_IMMEDIATELY = 0, | ||
| 580 | NSP_NOTIFY_HWND, | ||
| 581 | NSP_NOTIFY_EVENT, | ||
| 582 | NSP_NOTIFY_PORT, | ||
| 583 | NSP_NOTIFY_APC | ||
| 584 | } WSACOMPLETIONTYPE,*PWSACOMPLETIONTYPE,*LPWSACOMPLETIONTYPE; | ||
| 585 | |||
| 586 | typedef struct _WSACOMPLETION { | ||
| 587 | WSACOMPLETIONTYPE Type; | ||
| 588 | union { | ||
| 589 | struct { | ||
| 590 | HWND hWnd; | ||
| 591 | UINT uMsg; | ||
| 592 | WPARAM context; | ||
| 593 | } WindowMessage; | ||
| 594 | struct { | ||
| 595 | LPWSAOVERLAPPED lpOverlapped; | ||
| 596 | } Event; | ||
| 597 | struct { | ||
| 598 | LPWSAOVERLAPPED lpOverlapped; | ||
| 599 | LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc; | ||
| 600 | } Apc; | ||
| 601 | struct { | ||
| 602 | LPWSAOVERLAPPED lpOverlapped; | ||
| 603 | HANDLE hPort; | ||
| 604 | ULONG_PTR Key; | ||
| 605 | } Port; | ||
| 606 | } Parameters; | ||
| 607 | } WSACOMPLETION,*PWSACOMPLETION,*LPWSACOMPLETION; | ||
| 608 | |||
| 609 | #define TH_NETDEV 0x00000001 | ||
| 610 | #define TH_TAPI 0x00000002 | ||
| 611 | |||
| 612 | typedef struct sockaddr_storage SOCKADDR_STORAGE; | ||
| 613 | typedef struct sockaddr_storage *PSOCKADDR_STORAGE; | ||
| 614 | typedef struct sockaddr_storage *LPSOCKADDR_STORAGE; | ||
| 615 | typedef u_short ADDRESS_FAMILY; | ||
| 616 | |||
| 617 | #ifndef _tagBLOB_DEFINED | ||
| 618 | #define _tagBLOB_DEFINED | ||
| 619 | #define _BLOB_DEFINED | ||
| 620 | #define _LPBLOB_DEFINED | ||
| 621 | typedef struct _BLOB { | ||
| 622 | ULONG cbSize; | ||
| 623 | BYTE *pBlobData; | ||
| 624 | } BLOB,*LPBLOB; | ||
| 625 | #endif /* _tagBLOB_DEFINED */ | ||
| 626 | |||
| 627 | #define SERVICE_MULTIPLE (0x00000001) | ||
| 628 | |||
| 629 | #define NS_ALL (0) | ||
| 630 | |||
| 631 | #define NS_SAP (1) | ||
| 632 | #define NS_NDS (2) | ||
| 633 | #define NS_PEER_BROWSE (3) | ||
| 634 | #define NS_SLP (5) | ||
| 635 | #define NS_DHCP (6) | ||
| 636 | |||
| 637 | #define NS_TCPIP_LOCAL (10) | ||
| 638 | #define NS_TCPIP_HOSTS (11) | ||
| 639 | #define NS_DNS (12) | ||
| 640 | #define NS_NETBT (13) | ||
| 641 | #define NS_WINS (14) | ||
| 642 | #define NS_NLA (15) | ||
| 643 | |||
| 644 | #define NS_NBP (20) | ||
| 645 | |||
| 646 | #define NS_MS (30) | ||
| 647 | #define NS_STDA (31) | ||
| 648 | #define NS_NTDS (32) | ||
| 649 | |||
| 650 | #define NS_X500 (40) | ||
| 651 | #define NS_NIS (41) | ||
| 652 | #define NS_NISPLUS (42) | ||
| 653 | |||
| 654 | #define NS_WRQ (50) | ||
| 655 | |||
| 656 | #define NS_NETDES (60) | ||
| 657 | |||
| 658 | #define RES_UNUSED_1 (0x00000001) | ||
| 659 | #define RES_FLUSH_CACHE (0x00000002) | ||
| 660 | #ifndef RES_SERVICE | ||
| 661 | #define RES_SERVICE (0x00000004) | ||
| 662 | #endif | ||
| 663 | |||
| 664 | #define SERVICE_TYPE_VALUE_IPXPORTA "IpxSocket" | ||
| 665 | #define SERVICE_TYPE_VALUE_IPXPORTW L"IpxSocket" | ||
| 666 | #define SERVICE_TYPE_VALUE_SAPIDA "SapId" | ||
| 667 | #define SERVICE_TYPE_VALUE_SAPIDW L"SapId" | ||
| 668 | |||
| 669 | #define SERVICE_TYPE_VALUE_TCPPORTA "TcpPort" | ||
| 670 | #define SERVICE_TYPE_VALUE_TCPPORTW L"TcpPort" | ||
| 671 | |||
| 672 | #define SERVICE_TYPE_VALUE_UDPPORTA "UdpPort" | ||
| 673 | #define SERVICE_TYPE_VALUE_UDPPORTW L"UdpPort" | ||
| 674 | |||
| 675 | #define SERVICE_TYPE_VALUE_OBJECTIDA "ObjectId" | ||
| 676 | #define SERVICE_TYPE_VALUE_OBJECTIDW L"ObjectId" | ||
| 677 | |||
| 678 | #define SERVICE_TYPE_VALUE_SAPID __MINGW_NAME_AW(SERVICE_TYPE_VALUE_SAPID) | ||
| 679 | #define SERVICE_TYPE_VALUE_TCPPORT __MINGW_NAME_AW(SERVICE_TYPE_VALUE_TCPPORT) | ||
| 680 | #define SERVICE_TYPE_VALUE_UDPPORT __MINGW_NAME_AW(SERVICE_TYPE_VALUE_UDPPORT) | ||
| 681 | #define SERVICE_TYPE_VALUE_OBJECTID __MINGW_NAME_AW(SERVICE_TYPE_VALUE_OBJECTID) | ||
| 682 | |||
| 683 | #ifndef __CSADDR_DEFINED__ | ||
| 684 | #define __CSADDR_DEFINED__ | ||
| 685 | |||
| 686 | typedef struct _SOCKET_ADDRESS { | ||
| 687 | LPSOCKADDR lpSockaddr; | ||
| 688 | INT iSockaddrLength; | ||
| 689 | } SOCKET_ADDRESS,*PSOCKET_ADDRESS,*LPSOCKET_ADDRESS; | ||
| 690 | |||
| 691 | typedef struct _CSADDR_INFO { | ||
| 692 | SOCKET_ADDRESS LocalAddr; | ||
| 693 | SOCKET_ADDRESS RemoteAddr; | ||
| 694 | INT iSocketType; | ||
| 695 | INT iProtocol; | ||
| 696 | } CSADDR_INFO,*PCSADDR_INFO,*LPCSADDR_INFO; | ||
| 697 | #endif /* __CSADDR_DEFINED__ */ | ||
| 698 | |||
| 699 | typedef struct _SOCKET_ADDRESS_LIST { | ||
| 700 | INT iAddressCount; | ||
| 701 | SOCKET_ADDRESS Address[1]; | ||
| 702 | } SOCKET_ADDRESS_LIST,*PSOCKET_ADDRESS_LIST,*LPSOCKET_ADDRESS_LIST; | ||
| 703 | |||
| 704 | typedef struct _AFPROTOCOLS { | ||
| 705 | INT iAddressFamily; | ||
| 706 | INT iProtocol; | ||
| 707 | } AFPROTOCOLS,*PAFPROTOCOLS,*LPAFPROTOCOLS; | ||
| 708 | |||
| 709 | typedef enum _WSAEcomparator { | ||
| 710 | COMP_EQUAL = 0, | ||
| 711 | COMP_NOTLESS | ||
| 712 | } WSAECOMPARATOR,*PWSAECOMPARATOR,*LPWSAECOMPARATOR; | ||
| 713 | |||
| 714 | typedef struct _WSAVersion { | ||
| 715 | DWORD dwVersion; | ||
| 716 | WSAECOMPARATOR ecHow; | ||
| 717 | } WSAVERSION,*PWSAVERSION,*LPWSAVERSION; | ||
| 718 | |||
| 719 | typedef struct _WSAQuerySetA { | ||
| 720 | DWORD dwSize; | ||
| 721 | LPSTR lpszServiceInstanceName; | ||
| 722 | LPGUID lpServiceClassId; | ||
| 723 | LPWSAVERSION lpVersion; | ||
| 724 | LPSTR lpszComment; | ||
| 725 | DWORD dwNameSpace; | ||
| 726 | LPGUID lpNSProviderId; | ||
| 727 | LPSTR lpszContext; | ||
| 728 | DWORD dwNumberOfProtocols; | ||
| 729 | LPAFPROTOCOLS lpafpProtocols; | ||
| 730 | LPSTR lpszQueryString; | ||
| 731 | DWORD dwNumberOfCsAddrs; | ||
| 732 | LPCSADDR_INFO lpcsaBuffer; | ||
| 733 | DWORD dwOutputFlags; | ||
| 734 | LPBLOB lpBlob; | ||
| 735 | } WSAQUERYSETA,*PWSAQUERYSETA,*LPWSAQUERYSETA; | ||
| 736 | |||
| 737 | typedef struct _WSAQuerySetW { | ||
| 738 | DWORD dwSize; | ||
| 739 | LPWSTR lpszServiceInstanceName; | ||
| 740 | LPGUID lpServiceClassId; | ||
| 741 | LPWSAVERSION lpVersion; | ||
| 742 | LPWSTR lpszComment; | ||
| 743 | DWORD dwNameSpace; | ||
| 744 | LPGUID lpNSProviderId; | ||
| 745 | LPWSTR lpszContext; | ||
| 746 | DWORD dwNumberOfProtocols; | ||
| 747 | LPAFPROTOCOLS lpafpProtocols; | ||
| 748 | LPWSTR lpszQueryString; | ||
| 749 | DWORD dwNumberOfCsAddrs; | ||
| 750 | LPCSADDR_INFO lpcsaBuffer; | ||
| 751 | DWORD dwOutputFlags; | ||
| 752 | LPBLOB lpBlob; | ||
| 753 | } WSAQUERYSETW,*PWSAQUERYSETW,*LPWSAQUERYSETW; | ||
| 754 | |||
| 755 | __MINGW_TYPEDEF_AW(WSAQUERYSET) | ||
| 756 | __MINGW_TYPEDEF_AW(PWSAQUERYSET) | ||
| 757 | __MINGW_TYPEDEF_AW(LPWSAQUERYSET) | ||
| 758 | |||
| 759 | #define LUP_DEEP 0x0001 | ||
| 760 | #define LUP_CONTAINERS 0x0002 | ||
| 761 | #define LUP_NOCONTAINERS 0x0004 | ||
| 762 | #define LUP_NEAREST 0x0008 | ||
| 763 | #define LUP_RETURN_NAME 0x0010 | ||
| 764 | #define LUP_RETURN_TYPE 0x0020 | ||
| 765 | #define LUP_RETURN_VERSION 0x0040 | ||
| 766 | #define LUP_RETURN_COMMENT 0x0080 | ||
| 767 | #define LUP_RETURN_ADDR 0x0100 | ||
| 768 | #define LUP_RETURN_BLOB 0x0200 | ||
| 769 | #define LUP_RETURN_ALIASES 0x0400 | ||
| 770 | #define LUP_RETURN_QUERY_STRING 0x0800 | ||
| 771 | #define LUP_RETURN_ALL 0x0FF0 | ||
| 772 | #define LUP_RES_SERVICE 0x8000 | ||
| 773 | |||
| 774 | #define LUP_FLUSHCACHE 0x1000 | ||
| 775 | #define LUP_FLUSHPREVIOUS 0x2000 | ||
| 776 | |||
| 777 | #define LUP_NON_AUTHORITATIVE 0x4000 | ||
| 778 | #define LUP_SECURE 0x8000 | ||
| 779 | #define LUP_RETURN_PREFERRED_NAMES 0x10000 | ||
| 780 | |||
| 781 | #define LUP_ADDRCONFIG 0x100000 | ||
| 782 | #define LUP_DUAL_ADDR 0x200000 | ||
| 783 | #define LUP_FILESERVER 0x400000 | ||
| 784 | |||
| 785 | #define LUP_RES_RESERVICE 0x8000 /* FIXME: not in PSDK anymore?? */ | ||
| 786 | |||
| 787 | #define RESULT_IS_ALIAS 0x0001 | ||
| 788 | #define RESULT_IS_ADDED 0x0010 | ||
| 789 | #define RESULT_IS_CHANGED 0x0020 | ||
| 790 | #define RESULT_IS_DELETED 0x0040 | ||
| 791 | |||
| 792 | typedef enum _WSAESETSERVICEOP { | ||
| 793 | RNRSERVICE_REGISTER = 0, | ||
| 794 | RNRSERVICE_DEREGISTER, | ||
| 795 | RNRSERVICE_DELETE | ||
| 796 | } WSAESETSERVICEOP,*PWSAESETSERVICEOP,*LPWSAESETSERVICEOP; | ||
| 797 | |||
| 798 | typedef struct _WSANSClassInfoA { | ||
| 799 | LPSTR lpszName; | ||
| 800 | DWORD dwNameSpace; | ||
| 801 | DWORD dwValueType; | ||
| 802 | DWORD dwValueSize; | ||
| 803 | LPVOID lpValue; | ||
| 804 | } WSANSCLASSINFOA,*PWSANSCLASSINFOA,*LPWSANSCLASSINFOA; | ||
| 805 | |||
| 806 | typedef struct _WSANSClassInfoW { | ||
| 807 | LPWSTR lpszName; | ||
| 808 | DWORD dwNameSpace; | ||
| 809 | DWORD dwValueType; | ||
| 810 | DWORD dwValueSize; | ||
| 811 | LPVOID lpValue; | ||
| 812 | } WSANSCLASSINFOW,*PWSANSCLASSINFOW,*LPWSANSCLASSINFOW; | ||
| 813 | |||
| 814 | __MINGW_TYPEDEF_AW(WSANSCLASSINFO) | ||
| 815 | __MINGW_TYPEDEF_AW(PWSANSCLASSINFO) | ||
| 816 | __MINGW_TYPEDEF_AW(LPWSANSCLASSINFO) | ||
| 817 | |||
| 818 | typedef struct _WSAServiceClassInfoA { | ||
| 819 | LPGUID lpServiceClassId; | ||
| 820 | LPSTR lpszServiceClassName; | ||
| 821 | DWORD dwCount; | ||
| 822 | LPWSANSCLASSINFOA lpClassInfos; | ||
| 823 | } WSASERVICECLASSINFOA,*PWSASERVICECLASSINFOA,*LPWSASERVICECLASSINFOA; | ||
| 824 | |||
| 825 | typedef struct _WSAServiceClassInfoW { | ||
| 826 | LPGUID lpServiceClassId; | ||
| 827 | LPWSTR lpszServiceClassName; | ||
| 828 | DWORD dwCount; | ||
| 829 | LPWSANSCLASSINFOW lpClassInfos; | ||
| 830 | } WSASERVICECLASSINFOW,*PWSASERVICECLASSINFOW,*LPWSASERVICECLASSINFOW; | ||
| 831 | |||
| 832 | __MINGW_TYPEDEF_AW(WSASERVICECLASSINFO) | ||
| 833 | __MINGW_TYPEDEF_AW(PWSASERVICECLASSINFO) | ||
| 834 | __MINGW_TYPEDEF_AW(LPWSASERVICECLASSINFO) | ||
| 835 | |||
| 836 | typedef struct _WSANAMESPACE_INFOA { | ||
| 837 | GUID NSProviderId; | ||
| 838 | DWORD dwNameSpace; | ||
| 839 | WINBOOL fActive; | ||
| 840 | DWORD dwVersion; | ||
| 841 | LPSTR lpszIdentifier; | ||
| 842 | } WSANAMESPACE_INFOA,*PWSANAMESPACE_INFOA,*LPWSANAMESPACE_INFOA; | ||
| 843 | |||
| 844 | typedef struct _WSANAMESPACE_INFOW { | ||
| 845 | GUID NSProviderId; | ||
| 846 | DWORD dwNameSpace; | ||
| 847 | WINBOOL fActive; | ||
| 848 | DWORD dwVersion; | ||
| 849 | LPWSTR lpszIdentifier; | ||
| 850 | } WSANAMESPACE_INFOW,*PWSANAMESPACE_INFOW,*LPWSANAMESPACE_INFOW; | ||
| 851 | |||
| 852 | __MINGW_TYPEDEF_AW(WSANAMESPACE_INFO) | ||
| 853 | __MINGW_TYPEDEF_AW(PWSANAMESPACE_INFO) | ||
| 854 | __MINGW_TYPEDEF_AW(LPWSANAMESPACE_INFO) | ||
| 855 | |||
| 856 | /* FIXME: WSAMSG originally lived in mswsock.h, | ||
| 857 | * newer SDKs moved it into a new ws2def.h. for | ||
| 858 | * now we keep it here. */ | ||
| 859 | typedef struct _WSAMSG { | ||
| 860 | LPSOCKADDR name; | ||
| 861 | INT namelen; | ||
| 862 | LPWSABUF lpBuffers; | ||
| 863 | DWORD dwBufferCount; | ||
| 864 | WSABUF Control; | ||
| 865 | DWORD dwFlags; | ||
| 866 | } WSAMSG,*PWSAMSG,*LPWSAMSG; | ||
| 867 | |||
| 868 | #if INCL_WINSOCK_API_TYPEDEFS | ||
| 869 | #define LPFN_WSADUPLICATESOCKET __MINGW_NAME_AW(LPFN_WSADUPLICATESOCKET) | ||
| 870 | #define LPFN_WSAENUMPROTOCOLS __MINGW_NAME_AW(LPFN_WSAENUMPROTOCOLS) | ||
| 871 | #define LPFN_WSASOCKET __MINGW_NAME_AW(LPFN_WSASOCKET) | ||
| 872 | #define LPFN_WSAADDRESSTOSTRING __MINGW_NAME_AW(LPFN_WSAADDRESSTOSTRING) | ||
| 873 | #define LPFN_WSASTRINGTOADDRESS __MINGW_NAME_AW(LPFN_WSASTRINGTOADDRESS) | ||
| 874 | #define LPFN_WSALOOKUPSERVICEBEGIN __MINGW_NAME_AW(LPFN_WSALOOKUPSERVICEBEGIN) | ||
| 875 | #define LPFN_WSALOOKUPSERVICENEXT __MINGW_NAME_AW(LPFN_WSALOOKUPSERVICENEXT) | ||
| 876 | #define LPFN_WSAINSTALLSERVICECLASS __MINGW_NAME_AW(LPFN_WSAINSTALLSERVICECLASS) | ||
| 877 | #define LPFN_WSAGETSERVICECLASSINFO __MINGW_NAME_AW(LPFN_WSAGETSERVICECLASSINFO) | ||
| 878 | #define LPFN_WSAENUMNAMESPACEPROVIDERS __MINGW_NAME_AW(LPFN_WSAENUMNAMESPACEPROVIDERS) | ||
| 879 | #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID __MINGW_NAME_AW(LPFN_WSAGETSERVICECLASSNAMEBYCLASSID) | ||
| 880 | #define LPFN_WSASETSERVICE __MINGW_NAME_AW(LPFN_WSASETSERVICE) | ||
| 881 | |||
| 882 | typedef SOCKET (WSAAPI *LPFN_ACCEPT)(SOCKET s,struct sockaddr *addr,int *addrlen); | ||
| 883 | typedef int (WSAAPI *LPFN_BIND)(SOCKET s,const struct sockaddr *name,int namelen); | ||
| 884 | typedef int (WSAAPI *LPFN_CLOSESOCKET)(SOCKET s); | ||
| 885 | typedef int (WSAAPI *LPFN_CONNECT)(SOCKET s,const struct sockaddr *name,int namelen); | ||
| 886 | typedef int (WSAAPI *LPFN_IOCTLSOCKET)(SOCKET s,long cmd,u_long *argp); | ||
| 887 | typedef int (WSAAPI *LPFN_GETPEERNAME)(SOCKET s,struct sockaddr *name,int *namelen); | ||
| 888 | typedef int (WSAAPI *LPFN_GETSOCKNAME)(SOCKET s,struct sockaddr *name,int *namelen); | ||
| 889 | typedef int (WSAAPI *LPFN_GETSOCKOPT)(SOCKET s,int level,int optname,char *optval,int *optlen); | ||
| 890 | typedef u_long (WSAAPI *LPFN_HTONL)(u_long hostlong); | ||
| 891 | typedef u_short (WSAAPI *LPFN_HTONS)(u_short hostshort); | ||
| 892 | typedef unsigned long (WSAAPI *LPFN_INET_ADDR)(const char *cp); | ||
| 893 | typedef char *(WSAAPI *LPFN_INET_NTOA)(struct in_addr in); | ||
| 894 | typedef int (WSAAPI *LPFN_LISTEN)(SOCKET s,int backlog); | ||
| 895 | typedef u_long (WSAAPI *LPFN_NTOHL)(u_long netlong); | ||
| 896 | typedef u_short (WSAAPI *LPFN_NTOHS)(u_short netshort); | ||
| 897 | typedef int (WSAAPI *LPFN_RECV)(SOCKET s,char *buf,int len,int flags); | ||
| 898 | typedef int (WSAAPI *LPFN_RECVFROM)(SOCKET s,char *buf,int len,int flags,struct sockaddr *from,int *fromlen); | ||
| 899 | typedef int (WSAAPI *LPFN_SELECT)(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const struct timeval *timeout); | ||
| 900 | typedef int (WSAAPI *LPFN_SEND)(SOCKET s,const char *buf,int len,int flags); | ||
| 901 | typedef int (WSAAPI *LPFN_SENDTO)(SOCKET s,const char *buf,int len,int flags,const struct sockaddr *to,int tolen); | ||
| 902 | typedef int (WSAAPI *LPFN_SETSOCKOPT)(SOCKET s,int level,int optname,const char *optval,int optlen); | ||
| 903 | typedef int (WSAAPI *LPFN_SHUTDOWN)(SOCKET s,int how); | ||
| 904 | typedef SOCKET (WSAAPI *LPFN_SOCKET)(int af,int type,int protocol); | ||
| 905 | typedef struct hostent *(WSAAPI *LPFN_GETHOSTBYADDR)(const char *addr,int len,int type); | ||
| 906 | typedef struct hostent *(WSAAPI *LPFN_GETHOSTBYNAME)(const char *name); | ||
| 907 | typedef int (WSAAPI *LPFN_GETHOSTNAME)(char *name,int namelen); | ||
| 908 | typedef struct servent *(WSAAPI *LPFN_GETSERVBYPORT)(int port,const char *proto); | ||
| 909 | typedef struct servent *(WSAAPI *LPFN_GETSERVBYNAME)(const char *name,const char *proto); | ||
| 910 | typedef struct protoent *(WSAAPI *LPFN_GETPROTOBYNUMBER)(int number); | ||
| 911 | typedef struct protoent *(WSAAPI *LPFN_GETPROTOBYNAME)(const char *name); | ||
| 912 | typedef int (WSAAPI *LPFN_WSASTARTUP)(WORD wVersionRequested,LPWSADATA lpWSAData); | ||
| 913 | typedef int (WSAAPI *LPFN_WSACLEANUP)(void); | ||
| 914 | typedef void (WSAAPI *LPFN_WSASETLASTERROR)(int iError); | ||
| 915 | typedef int (WSAAPI *LPFN_WSAGETLASTERROR)(void); | ||
| 916 | typedef WINBOOL (WSAAPI *LPFN_WSAISBLOCKING)(void); | ||
| 917 | typedef int (WSAAPI *LPFN_WSAUNHOOKBLOCKINGHOOK)(void); | ||
| 918 | typedef FARPROC (WSAAPI *LPFN_WSASETBLOCKINGHOOK)(FARPROC lpBlockFunc); | ||
| 919 | typedef int (WSAAPI *LPFN_WSACANCELBLOCKINGCALL)(void); | ||
| 920 | typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETSERVBYNAME)(HWND hWnd,u_int wMsg,const char *name,const char *proto,char *buf,int buflen); | ||
| 921 | typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETSERVBYPORT)(HWND hWnd,u_int wMsg,int port,const char *proto,char *buf,int buflen); | ||
| 922 | typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETPROTOBYNAME)(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen); | ||
| 923 | typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETPROTOBYNUMBER)(HWND hWnd,u_int wMsg,int number,char *buf,int buflen); | ||
| 924 | typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETHOSTBYNAME)(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen); | ||
| 925 | typedef HANDLE (WSAAPI *LPFN_WSAASYNCGETHOSTBYADDR)(HWND hWnd,u_int wMsg,const char *addr,int len,int type,char *buf,int buflen); | ||
| 926 | typedef int (WSAAPI *LPFN_WSACANCELASYNCREQUEST)(HANDLE hAsyncTaskHandle); | ||
| 927 | typedef int (WSAAPI *LPFN_WSAASYNCSELECT)(SOCKET s,HWND hWnd,u_int wMsg,long lEvent); | ||
| 928 | typedef SOCKET (WSAAPI *LPFN_WSAACCEPT)(SOCKET s,struct sockaddr *addr,LPINT addrlen,LPCONDITIONPROC lpfnCondition,DWORD_PTR dwCallbackData); | ||
| 929 | typedef WINBOOL (WSAAPI *LPFN_WSACLOSEEVENT)(WSAEVENT hEvent); | ||
| 930 | typedef int (WSAAPI *LPFN_WSACONNECT)(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS); | ||
| 931 | typedef WSAEVENT (WSAAPI *LPFN_WSACREATEEVENT)(void); | ||
| 932 | typedef int (WSAAPI *LPFN_WSADUPLICATESOCKETA)(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOA lpProtocolInfo); | ||
| 933 | typedef int (WSAAPI *LPFN_WSADUPLICATESOCKETW)(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOW lpProtocolInfo); | ||
| 934 | typedef int (WSAAPI *LPFN_WSAENUMNETWORKEVENTS)(SOCKET s,WSAEVENT hEventObject,LPWSANETWORKEVENTS lpNetworkEvents); | ||
| 935 | typedef int (WSAAPI *LPFN_WSAENUMPROTOCOLSA)(LPINT lpiProtocols,LPWSAPROTOCOL_INFOA lpProtocolBuffer,LPDWORD lpdwBufferLength); | ||
| 936 | typedef int (WSAAPI *LPFN_WSAENUMPROTOCOLSW)(LPINT lpiProtocols,LPWSAPROTOCOL_INFOW lpProtocolBuffer,LPDWORD lpdwBufferLength); | ||
| 937 | typedef int (WSAAPI *LPFN_WSAEVENTSELECT)(SOCKET s,WSAEVENT hEventObject,long lNetworkEvents); | ||
| 938 | typedef WINBOOL (WSAAPI *LPFN_WSAGETOVERLAPPEDRESULT)(SOCKET s,LPWSAOVERLAPPED lpOverlapped,LPDWORD lpcbTransfer,WINBOOL fWait,LPDWORD lpdwFlags); | ||
| 939 | typedef WINBOOL (WSAAPI *LPFN_WSAGETQOSBYNAME)(SOCKET s,LPWSABUF lpQOSName,LPQOS lpQOS); | ||
| 940 | typedef int (WSAAPI *LPFN_WSAHTONL)(SOCKET s,u_long hostlong,u_long *lpnetlong); | ||
| 941 | typedef int (WSAAPI *LPFN_WSAHTONS)(SOCKET s,u_short hostshort,u_short *lpnetshort); | ||
| 942 | typedef int (WSAAPI *LPFN_WSAIOCTL)(SOCKET s,DWORD dwIoControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 943 | typedef SOCKET (WSAAPI *LPFN_WSAJOINLEAF)(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS,DWORD dwFlags); | ||
| 944 | typedef int (WSAAPI *LPFN_WSANTOHL)(SOCKET s,u_long netlong,u_long *lphostlong); | ||
| 945 | typedef int (WSAAPI *LPFN_WSANTOHS)(SOCKET s,u_short netshort,u_short *lphostshort); | ||
| 946 | typedef int (WSAAPI *LPFN_WSARECV)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 947 | typedef int (WSAAPI *LPFN_WSARECVDISCONNECT)(SOCKET s,LPWSABUF lpInboundDisconnectData); | ||
| 948 | typedef int (WSAAPI *LPFN_WSARECVFROM)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,struct sockaddr *lpFrom,LPINT lpFromlen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 949 | typedef WINBOOL (WSAAPI *LPFN_WSARESETEVENT)(WSAEVENT hEvent); | ||
| 950 | typedef int (WSAAPI *LPFN_WSASEND)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 951 | typedef int (WSAAPI *LPFN_WSASENDDISCONNECT)(SOCKET s,LPWSABUF lpOutboundDisconnectData); | ||
| 952 | typedef int (WSAAPI *LPFN_WSASENDTO)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,const struct sockaddr *lpTo,int iTolen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 953 | typedef WINBOOL (WSAAPI *LPFN_WSASETEVENT)(WSAEVENT hEvent); | ||
| 954 | typedef SOCKET (WSAAPI *LPFN_WSASOCKETA)(int af,int type,int protocol,LPWSAPROTOCOL_INFOA lpProtocolInfo,GROUP g,DWORD dwFlags); | ||
| 955 | typedef SOCKET (WSAAPI *LPFN_WSASOCKETW)(int af,int type,int protocol,LPWSAPROTOCOL_INFOW lpProtocolInfo,GROUP g,DWORD dwFlags); | ||
| 956 | typedef DWORD (WSAAPI *LPFN_WSAWAITFORMULTIPLEEVENTS)(DWORD cEvents,const WSAEVENT *lphEvents,WINBOOL fWaitAll,DWORD dwTimeout,WINBOOL fAlertable); | ||
| 957 | typedef INT (WSAAPI *LPFN_WSAADDRESSTOSTRINGA)(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOA lpProtocolInfo,LPSTR lpszAddressString,LPDWORD lpdwAddressStringLength); | ||
| 958 | typedef INT (WSAAPI *LPFN_WSAADDRESSTOSTRINGW)(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPWSTR lpszAddressString,LPDWORD lpdwAddressStringLength); | ||
| 959 | typedef INT (WSAAPI *LPFN_WSASTRINGTOADDRESSA)(LPSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOA lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength); | ||
| 960 | typedef INT (WSAAPI *LPFN_WSASTRINGTOADDRESSW)(LPWSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength); | ||
| 961 | typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICEBEGINA)(LPWSAQUERYSETA lpqsRestrictions,DWORD dwControlFlags,LPHANDLE lphLookup); | ||
| 962 | typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICEBEGINW)(LPWSAQUERYSETW lpqsRestrictions,DWORD dwControlFlags,LPHANDLE lphLookup); | ||
| 963 | typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICENEXTA)(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETA lpqsResults); | ||
| 964 | typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICENEXTW)(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETW lpqsResults); | ||
| 965 | typedef INT (WSAAPI *LPFN_WSANSPIOCTL)(HANDLE hLookup,DWORD dwControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSACOMPLETION lpCompletion); | ||
| 966 | typedef INT (WSAAPI *LPFN_WSALOOKUPSERVICEEND)(HANDLE hLookup); | ||
| 967 | typedef INT (WSAAPI *LPFN_WSAINSTALLSERVICECLASSA)(LPWSASERVICECLASSINFOA lpServiceClassInfo); | ||
| 968 | typedef INT (WSAAPI *LPFN_WSAINSTALLSERVICECLASSW)(LPWSASERVICECLASSINFOW lpServiceClassInfo); | ||
| 969 | typedef INT (WSAAPI *LPFN_WSAREMOVESERVICECLASS)(LPGUID lpServiceClassId); | ||
| 970 | typedef INT (WSAAPI *LPFN_WSAGETSERVICECLASSINFOA)(LPGUID lpProviderId,LPGUID lpServiceClassId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOA lpServiceClassInfo); | ||
| 971 | typedef INT (WSAAPI *LPFN_WSAGETSERVICECLASSINFOW)(LPGUID lpProviderId,LPGUID lpServiceClassId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOW lpServiceClassInfo); | ||
| 972 | typedef INT (WSAAPI *LPFN_WSAENUMNAMESPACEPROVIDERSA)(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOA lpnspBuffer); | ||
| 973 | typedef INT (WSAAPI *LPFN_WSAENUMNAMESPACEPROVIDERSW)(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOW lpnspBuffer); | ||
| 974 | typedef INT (WSAAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA)(LPGUID lpServiceClassId,LPSTR lpszServiceClassName,LPDWORD lpdwBufferLength); | ||
| 975 | typedef INT (WSAAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW)(LPGUID lpServiceClassId,LPWSTR lpszServiceClassName,LPDWORD lpdwBufferLength); | ||
| 976 | typedef INT (WSAAPI *LPFN_WSASETSERVICEA)(LPWSAQUERYSETA lpqsRegInfo,WSAESETSERVICEOP essoperation,DWORD dwControlFlags); | ||
| 977 | typedef INT (WSAAPI *LPFN_WSASETSERVICEW)(LPWSAQUERYSETW lpqsRegInfo,WSAESETSERVICEOP essoperation,DWORD dwControlFlags); | ||
| 978 | typedef INT (WSAAPI *LPFN_WSAPROVIDERCONFIGCHANGE)(LPHANDLE lpNotificationHandle,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 979 | #endif | ||
| 980 | |||
| 981 | #define WSADuplicateSocket __MINGW_NAME_AW(WSADuplicateSocket) | ||
| 982 | #define WSAEnumProtocols __MINGW_NAME_AW(WSAEnumProtocols) | ||
| 983 | #define WSAAddressToString __MINGW_NAME_AW(WSAAddressToString) | ||
| 984 | #define WSASocket __MINGW_NAME_AW(WSASocket) | ||
| 985 | #define WSAStringToAddress __MINGW_NAME_AW(WSAStringToAddress) | ||
| 986 | #define WSALookupServiceBegin __MINGW_NAME_AW(WSALookupServiceBegin) | ||
| 987 | #define WSALookupServiceNext __MINGW_NAME_AW(WSALookupServiceNext) | ||
| 988 | #define WSAInstallServiceClass __MINGW_NAME_AW(WSAInstallServiceClass) | ||
| 989 | #define WSAGetServiceClassInfo __MINGW_NAME_AW(WSAGetServiceClassInfo) | ||
| 990 | #define WSAEnumNameSpaceProviders __MINGW_NAME_AW(WSAEnumNameSpaceProviders) | ||
| 991 | #define WSAGetServiceClassNameByClassId __MINGW_NAME_AW(WSAGetServiceClassNameByClassId) | ||
| 992 | #define WSASetService __MINGW_NAME_AW(WSASetService) | ||
| 993 | |||
| 994 | #ifndef __WINSOCK_WS1_SHARED | ||
| 995 | /* these 46 functions have the same prototypes as in winsock2 */ | ||
| 996 | WINSOCK_API_LINKAGE SOCKET WSAAPI accept(SOCKET s,struct sockaddr *addr,int *addrlen); | ||
| 997 | WINSOCK_API_LINKAGE int WSAAPI bind(SOCKET s,const struct sockaddr *name,int namelen); | ||
| 998 | WINSOCK_API_LINKAGE int WSAAPI closesocket(SOCKET s); | ||
| 999 | WINSOCK_API_LINKAGE int WSAAPI connect(SOCKET s,const struct sockaddr *name,int namelen); | ||
| 1000 | WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,long cmd,u_long *argp); | ||
| 1001 | WINSOCK_API_LINKAGE int WSAAPI getpeername(SOCKET s,struct sockaddr *name,int *namelen); | ||
| 1002 | WINSOCK_API_LINKAGE int WSAAPI getsockname(SOCKET s,struct sockaddr *name,int *namelen); | ||
| 1003 | WINSOCK_API_LINKAGE int WSAAPI getsockopt(SOCKET s,int level,int optname,char *optval,int *optlen); | ||
| 1004 | WINSOCK_API_LINKAGE u_long WSAAPI htonl(u_long hostlong); | ||
| 1005 | WINSOCK_API_LINKAGE u_short WSAAPI htons(u_short hostshort); | ||
| 1006 | WINSOCK_API_LINKAGE unsigned long WSAAPI inet_addr(const char *cp); | ||
| 1007 | WINSOCK_API_LINKAGE char *WSAAPI inet_ntoa(struct in_addr in); | ||
| 1008 | WINSOCK_API_LINKAGE int WSAAPI listen(SOCKET s,int backlog); | ||
| 1009 | WINSOCK_API_LINKAGE u_long WSAAPI ntohl(u_long netlong); | ||
| 1010 | WINSOCK_API_LINKAGE u_short WSAAPI ntohs(u_short netshort); | ||
| 1011 | WINSOCK_API_LINKAGE int WSAAPI recv(SOCKET s,char *buf,int len,int flags); | ||
| 1012 | WINSOCK_API_LINKAGE int WSAAPI recvfrom(SOCKET s,char *buf,int len,int flags,struct sockaddr *from,int *fromlen); | ||
| 1013 | WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const struct timeval *timeout); | ||
| 1014 | WINSOCK_API_LINKAGE int WSAAPI send(SOCKET s,const char *buf,int len,int flags); | ||
| 1015 | WINSOCK_API_LINKAGE int WSAAPI sendto(SOCKET s,const char *buf,int len,int flags,const struct sockaddr *to,int tolen); | ||
| 1016 | WINSOCK_API_LINKAGE int WSAAPI setsockopt(SOCKET s,int level,int optname,const char *optval,int optlen); | ||
| 1017 | WINSOCK_API_LINKAGE int WSAAPI shutdown(SOCKET s,int how); | ||
| 1018 | WINSOCK_API_LINKAGE SOCKET WSAAPI socket(int af,int type,int protocol); | ||
| 1019 | WINSOCK_API_LINKAGE struct hostent *WSAAPI gethostbyaddr(const char *addr,int len,int type); | ||
| 1020 | WINSOCK_API_LINKAGE struct hostent *WSAAPI gethostbyname(const char *name); | ||
| 1021 | WINSOCK_API_LINKAGE int WSAAPI gethostname(char *name,int namelen); | ||
| 1022 | WINSOCK_API_LINKAGE struct servent *WSAAPI getservbyport(int port,const char *proto); | ||
| 1023 | WINSOCK_API_LINKAGE struct servent *WSAAPI getservbyname(const char *name,const char *proto); | ||
| 1024 | WINSOCK_API_LINKAGE struct protoent *WSAAPI getprotobynumber(int number); | ||
| 1025 | WINSOCK_API_LINKAGE struct protoent *WSAAPI getprotobyname(const char *name); | ||
| 1026 | WINSOCK_API_LINKAGE int WSAAPI WSAStartup(WORD wVersionRequested,LPWSADATA lpWSAData); | ||
| 1027 | WINSOCK_API_LINKAGE int WSAAPI WSACleanup(void); | ||
| 1028 | WINSOCK_API_LINKAGE void WSAAPI WSASetLastError(int iError); | ||
| 1029 | WINSOCK_API_LINKAGE int WSAAPI WSAGetLastError(void); | ||
| 1030 | WINSOCK_API_LINKAGE WINBOOL WSAAPI WSAIsBlocking(void); | ||
| 1031 | WINSOCK_API_LINKAGE int WSAAPI WSAUnhookBlockingHook(void); | ||
| 1032 | WINSOCK_API_LINKAGE FARPROC WSAAPI WSASetBlockingHook(FARPROC lpBlockFunc); | ||
| 1033 | WINSOCK_API_LINKAGE int WSAAPI WSACancelBlockingCall(void); | ||
| 1034 | WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetServByName(HWND hWnd,u_int wMsg,const char *name,const char *proto,char *buf,int buflen); | ||
| 1035 | WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetServByPort(HWND hWnd,u_int wMsg,int port,const char *proto,char *buf,int buflen); | ||
| 1036 | WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetProtoByName(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen); | ||
| 1037 | WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetProtoByNumber(HWND hWnd,u_int wMsg,int number,char *buf,int buflen); | ||
| 1038 | WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetHostByName(HWND hWnd,u_int wMsg,const char *name,char *buf,int buflen); | ||
| 1039 | WINSOCK_API_LINKAGE HANDLE WSAAPI WSAAsyncGetHostByAddr(HWND hWnd,u_int wMsg,const char *addr,int len,int type,char *buf,int buflen); | ||
| 1040 | WINSOCK_API_LINKAGE int WSAAPI WSACancelAsyncRequest(HANDLE hAsyncTaskHandle); | ||
| 1041 | WINSOCK_API_LINKAGE int WSAAPI WSAAsyncSelect(SOCKET s,HWND hWnd,u_int wMsg,long lEvent); | ||
| 1042 | #endif /* __WINSOCK_WS1_SHARED */ | ||
| 1043 | WINSOCK_API_LINKAGE SOCKET WSAAPI WSAAccept(SOCKET s,struct sockaddr *addr,LPINT addrlen,LPCONDITIONPROC lpfnCondition,DWORD_PTR dwCallbackData); | ||
| 1044 | WINSOCK_API_LINKAGE WINBOOL WSAAPI WSACloseEvent(WSAEVENT hEvent); | ||
| 1045 | WINSOCK_API_LINKAGE int WSAAPI WSAConnect(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS); | ||
| 1046 | WINSOCK_API_LINKAGE WSAEVENT WSAAPI WSACreateEvent(void); | ||
| 1047 | WINSOCK_API_LINKAGE int WSAAPI WSADuplicateSocketA(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOA lpProtocolInfo); | ||
| 1048 | WINSOCK_API_LINKAGE int WSAAPI WSADuplicateSocketW(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOW lpProtocolInfo); | ||
| 1049 | WINSOCK_API_LINKAGE int WSAAPI WSAEnumNetworkEvents(SOCKET s,WSAEVENT hEventObject,LPWSANETWORKEVENTS lpNetworkEvents); | ||
| 1050 | WINSOCK_API_LINKAGE int WSAAPI WSAEnumProtocolsA(LPINT lpiProtocols,LPWSAPROTOCOL_INFOA lpProtocolBuffer,LPDWORD lpdwBufferLength); | ||
| 1051 | WINSOCK_API_LINKAGE int WSAAPI WSAEnumProtocolsW(LPINT lpiProtocols,LPWSAPROTOCOL_INFOW lpProtocolBuffer,LPDWORD lpdwBufferLength); | ||
| 1052 | WINSOCK_API_LINKAGE int WSAAPI WSAEventSelect(SOCKET s,WSAEVENT hEventObject,long lNetworkEvents); | ||
| 1053 | WINSOCK_API_LINKAGE WINBOOL WSAAPI WSAGetOverlappedResult(SOCKET s,LPWSAOVERLAPPED lpOverlapped,LPDWORD lpcbTransfer,WINBOOL fWait,LPDWORD lpdwFlags); | ||
| 1054 | WINSOCK_API_LINKAGE WINBOOL WSAAPI WSAGetQOSByName(SOCKET s,LPWSABUF lpQOSName,LPQOS lpQOS); | ||
| 1055 | WINSOCK_API_LINKAGE int WSAAPI WSAHtonl(SOCKET s,u_long hostlong,u_long *lpnetlong); | ||
| 1056 | WINSOCK_API_LINKAGE int WSAAPI WSAHtons(SOCKET s,u_short hostshort,u_short *lpnetshort); | ||
| 1057 | WINSOCK_API_LINKAGE int WSAAPI WSAIoctl(SOCKET s,DWORD dwIoControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 1058 | WINSOCK_API_LINKAGE SOCKET WSAAPI WSAJoinLeaf(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS,DWORD dwFlags); | ||
| 1059 | WINSOCK_API_LINKAGE int WSAAPI WSANtohl(SOCKET s,u_long netlong,u_long *lphostlong); | ||
| 1060 | WINSOCK_API_LINKAGE int WSAAPI WSANtohs(SOCKET s,u_short netshort,u_short *lphostshort); | ||
| 1061 | WINSOCK_API_LINKAGE int WSAAPI WSARecv(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 1062 | WINSOCK_API_LINKAGE int WSAAPI WSARecvDisconnect(SOCKET s,LPWSABUF lpInboundDisconnectData); | ||
| 1063 | WINSOCK_API_LINKAGE int WSAAPI WSARecvFrom(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,struct sockaddr *lpFrom,LPINT lpFromlen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 1064 | WINSOCK_API_LINKAGE WINBOOL WSAAPI WSAResetEvent(WSAEVENT hEvent); | ||
| 1065 | WINSOCK_API_LINKAGE int WSAAPI WSASend(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 1066 | WINSOCK_API_LINKAGE int WSAAPI WSASendDisconnect(SOCKET s,LPWSABUF lpOutboundDisconnectData); | ||
| 1067 | WINSOCK_API_LINKAGE int WSAAPI WSASendTo(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,const struct sockaddr *lpTo,int iTolen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 1068 | WINSOCK_API_LINKAGE WINBOOL WSAAPI WSASetEvent(WSAEVENT hEvent); | ||
| 1069 | WINSOCK_API_LINKAGE SOCKET WSAAPI WSASocketA(int af,int type,int protocol,LPWSAPROTOCOL_INFOA lpProtocolInfo,GROUP g,DWORD dwFlags); | ||
| 1070 | WINSOCK_API_LINKAGE SOCKET WSAAPI WSASocketW(int af,int type,int protocol,LPWSAPROTOCOL_INFOW lpProtocolInfo,GROUP g,DWORD dwFlags); | ||
| 1071 | WINSOCK_API_LINKAGE DWORD WSAAPI WSAWaitForMultipleEvents(DWORD cEvents,const WSAEVENT *lphEvents,WINBOOL fWaitAll,DWORD dwTimeout,WINBOOL fAlertable); | ||
| 1072 | WINSOCK_API_LINKAGE INT WSAAPI WSAAddressToStringA(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOA lpProtocolInfo,LPSTR lpszAddressString,LPDWORD lpdwAddressStringLength); | ||
| 1073 | WINSOCK_API_LINKAGE INT WSAAPI WSAAddressToStringW(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPWSTR lpszAddressString,LPDWORD lpdwAddressStringLength); | ||
| 1074 | WINSOCK_API_LINKAGE INT WSAAPI WSAStringToAddressA(LPSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOA lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength); | ||
| 1075 | WINSOCK_API_LINKAGE INT WSAAPI WSAStringToAddressW(LPWSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength); | ||
| 1076 | WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceBeginA(LPWSAQUERYSETA lpqsRestrictions,DWORD dwControlFlags,LPHANDLE lphLookup); | ||
| 1077 | WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceBeginW(LPWSAQUERYSETW lpqsRestrictions,DWORD dwControlFlags,LPHANDLE lphLookup); | ||
| 1078 | WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceNextA(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETA lpqsResults); | ||
| 1079 | WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceNextW(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETW lpqsResults); | ||
| 1080 | WINSOCK_API_LINKAGE INT WSAAPI WSANSPIoctl(HANDLE hLookup,DWORD dwControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSACOMPLETION lpCompletion); | ||
| 1081 | WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceEnd(HANDLE hLookup); | ||
| 1082 | WINSOCK_API_LINKAGE INT WSAAPI WSAInstallServiceClassA(LPWSASERVICECLASSINFOA lpServiceClassInfo); | ||
| 1083 | WINSOCK_API_LINKAGE INT WSAAPI WSAInstallServiceClassW(LPWSASERVICECLASSINFOW lpServiceClassInfo); | ||
| 1084 | WINSOCK_API_LINKAGE INT WSAAPI WSARemoveServiceClass(LPGUID lpServiceClassId); | ||
| 1085 | WINSOCK_API_LINKAGE INT WSAAPI WSAGetServiceClassInfoA(LPGUID lpProviderId,LPGUID lpServiceClassId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOA lpServiceClassInfo); | ||
| 1086 | WINSOCK_API_LINKAGE INT WSAAPI WSAGetServiceClassInfoW(LPGUID lpProviderId,LPGUID lpServiceClassId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOW lpServiceClassInfo); | ||
| 1087 | WINSOCK_API_LINKAGE INT WSAAPI WSAEnumNameSpaceProvidersA(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOA lpnspBuffer); | ||
| 1088 | WINSOCK_API_LINKAGE INT WSAAPI WSAEnumNameSpaceProvidersW(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOW lpnspBuffer); | ||
| 1089 | WINSOCK_API_LINKAGE INT WSAAPI WSAGetServiceClassNameByClassIdA(LPGUID lpServiceClassId,LPSTR lpszServiceClassName,LPDWORD lpdwBufferLength); | ||
| 1090 | WINSOCK_API_LINKAGE INT WSAAPI WSAGetServiceClassNameByClassIdW(LPGUID lpServiceClassId,LPWSTR lpszServiceClassName,LPDWORD lpdwBufferLength); | ||
| 1091 | WINSOCK_API_LINKAGE INT WSAAPI WSASetServiceA(LPWSAQUERYSETA lpqsRegInfo,WSAESETSERVICEOP essoperation,DWORD dwControlFlags); | ||
| 1092 | WINSOCK_API_LINKAGE INT WSAAPI WSASetServiceW(LPWSAQUERYSETW lpqsRegInfo,WSAESETSERVICEOP essoperation,DWORD dwControlFlags); | ||
| 1093 | WINSOCK_API_LINKAGE INT WSAAPI WSAProviderConfigChange(LPHANDLE lpNotificationHandle,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); | ||
| 1094 | |||
| 1095 | #define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error) | ||
| 1096 | #define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error) | ||
| 1097 | #define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam) | ||
| 1098 | #define WSAGETASYNCERROR(lParam) HIWORD(lParam) | ||
| 1099 | #define WSAGETSELECTEVENT(lParam) LOWORD(lParam) | ||
| 1100 | #define WSAGETSELECTERROR(lParam) HIWORD(lParam) | ||
| 1101 | |||
| 1102 | #if (_WIN32_WINNT >= 0x0600) | ||
| 1103 | typedef struct _WSANAMESPACE_INFOEXA { | ||
| 1104 | GUID NSProviderId; | ||
| 1105 | DWORD dwNameSpace; | ||
| 1106 | WINBOOL fActive; | ||
| 1107 | DWORD dwVersion; | ||
| 1108 | LPSTR lpszIdentifier; | ||
| 1109 | BLOB ProviderSpecific; | ||
| 1110 | } WSANAMESPACE_INFOEXA, *PWSANAMESPACE_INFOEXA, *LPWSANAMESPACE_INFOEXA; | ||
| 1111 | |||
| 1112 | typedef struct _WSANAMESPACE_INFOEXW { | ||
| 1113 | GUID NSProviderId; | ||
| 1114 | DWORD dwNameSpace; | ||
| 1115 | WINBOOL fActive; | ||
| 1116 | DWORD dwVersion; | ||
| 1117 | LPWSTR lpszIdentifier; | ||
| 1118 | BLOB ProviderSpecific; | ||
| 1119 | } WSANAMESPACE_INFOEXW, *PWSANAMESPACE_INFOEXW, *LPWSANAMESPACE_INFOEXW; | ||
| 1120 | |||
| 1121 | __MINGW_TYPEDEF_AW(WSANAMESPACE_INFOEX) | ||
| 1122 | __MINGW_TYPEDEF_AW(PWSANAMESPACE_INFOEX) | ||
| 1123 | __MINGW_TYPEDEF_AW(LPWSANAMESPACE_INFOEX) | ||
| 1124 | |||
| 1125 | typedef struct _WSAQUERYSET2A { | ||
| 1126 | DWORD dwSize; | ||
| 1127 | LPSTR lpszServiceInstanceName; | ||
| 1128 | LPWSAVERSION lpVersion; | ||
| 1129 | LPSTR lpszComment; | ||
| 1130 | DWORD dwNameSpace; | ||
| 1131 | LPGUID lpNSProviderId; | ||
| 1132 | LPSTR lpszContext; | ||
| 1133 | DWORD dwNumberOfProtocols; | ||
| 1134 | LPAFPROTOCOLS lpafpProtocols; | ||
| 1135 | LPSTR lpszQueryString; | ||
| 1136 | DWORD dwNumberOfCsAddrs; | ||
| 1137 | LPCSADDR_INFO lpcsaBuffer; | ||
| 1138 | DWORD dwOutputFlags; | ||
| 1139 | LPBLOB lpBlob; | ||
| 1140 | } WSAQUERYSET2A, *PWSAQUERYSET2A, *LPWSAQUERYSET2A; | ||
| 1141 | |||
| 1142 | typedef struct _WSAQUERYSET2W { | ||
| 1143 | DWORD dwSize; | ||
| 1144 | LPWSTR lpszServiceInstanceName; | ||
| 1145 | LPWSAVERSION lpVersion; | ||
| 1146 | LPWSTR lpszComment; | ||
| 1147 | DWORD dwNameSpace; | ||
| 1148 | LPGUID lpNSProviderId; | ||
| 1149 | LPTSTR lpszContext; | ||
| 1150 | DWORD dwNumberOfProtocols; | ||
| 1151 | LPAFPROTOCOLS lpafpProtocols; | ||
| 1152 | LPWSTR lpszQueryString; | ||
| 1153 | DWORD dwNumberOfCsAddrs; | ||
| 1154 | LPCSADDR_INFO lpcsaBuffer; | ||
| 1155 | DWORD dwOutputFlags; | ||
| 1156 | LPBLOB lpBlob; | ||
| 1157 | } WSAQUERYSET2W, *PWSAQUERYSET2W, *LPWSAQUERYSET2W; | ||
| 1158 | |||
| 1159 | #define POLLRDNORM 0x0100 | ||
| 1160 | #define POLLRDBAND 0x0200 | ||
| 1161 | #define POLLIN (POLLRDNORM | POLLRDBAND) | ||
| 1162 | #define POLLPRI 0x0400 | ||
| 1163 | |||
| 1164 | #define POLLWRNORM 0x0010 | ||
| 1165 | #define POLLOUT (POLLWRNORM) | ||
| 1166 | #define POLLWRBAND 0x0020 | ||
| 1167 | |||
| 1168 | #define POLLERR 0x0001 | ||
| 1169 | #define POLLHUP 0x0002 | ||
| 1170 | #define POLLNVAL 0x0004 | ||
| 1171 | |||
| 1172 | typedef struct pollfd { | ||
| 1173 | SOCKET fd; | ||
| 1174 | short events; | ||
| 1175 | short revents; | ||
| 1176 | } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; | ||
| 1177 | |||
| 1178 | WINSOCK_API_LINKAGE WINBOOL PASCAL WSAConnectByList( | ||
| 1179 | SOCKET s, | ||
| 1180 | PSOCKET_ADDRESS_LIST SocketAddressList, | ||
| 1181 | LPDWORD LocalAddressLength, | ||
| 1182 | LPSOCKADDR LocalAddress, | ||
| 1183 | LPDWORD RemoteAddressLength, | ||
| 1184 | LPSOCKADDR RemoteAddress, | ||
| 1185 | const struct timeval *timeout, | ||
| 1186 | LPWSAOVERLAPPED Reserved | ||
| 1187 | ); | ||
| 1188 | |||
| 1189 | WINSOCK_API_LINKAGE WINBOOL PASCAL WSAConnectByNameA( | ||
| 1190 | SOCKET s, | ||
| 1191 | LPSTR nodename, | ||
| 1192 | LPSTR servicename, | ||
| 1193 | LPDWORD LocalAddressLength, | ||
| 1194 | LPSOCKADDR LocalAddress, | ||
| 1195 | LPDWORD RemoteAddressLength, | ||
| 1196 | LPSOCKADDR RemoteAddress, | ||
| 1197 | const struct timeval *timeout, | ||
| 1198 | LPWSAOVERLAPPED Reserved | ||
| 1199 | ); | ||
| 1200 | |||
| 1201 | WINSOCK_API_LINKAGE WINBOOL PASCAL WSAConnectByNameW( | ||
| 1202 | SOCKET s, | ||
| 1203 | LPWSTR nodename, | ||
| 1204 | LPWSTR servicename, | ||
| 1205 | LPDWORD LocalAddressLength, | ||
| 1206 | LPSOCKADDR LocalAddress, | ||
| 1207 | LPDWORD RemoteAddressLength, | ||
| 1208 | LPSOCKADDR RemoteAddress, | ||
| 1209 | const struct timeval *timeout, | ||
| 1210 | LPWSAOVERLAPPED Reserved | ||
| 1211 | ); | ||
| 1212 | #define WSAConnectByName __MINGW_NAME_AW(WSAConnectByName) | ||
| 1213 | |||
| 1214 | INT WSAAPI WSAEnumNameSpaceProvidersExA( | ||
| 1215 | LPDWORD lpdwBufferLength, | ||
| 1216 | LPWSANAMESPACE_INFOEXA lpnspBuffer | ||
| 1217 | ); | ||
| 1218 | |||
| 1219 | INT WSAAPI WSAEnumNameSpaceProvidersExW( | ||
| 1220 | LPDWORD lpdwBufferLength, | ||
| 1221 | LPWSANAMESPACE_INFOEXW lpnspBuffer | ||
| 1222 | ); | ||
| 1223 | #define WSAEnumNameSpaceProvidersEx __MINGW_NAME_AW(WSAEnumNameSpaceProvidersEx) | ||
| 1224 | |||
| 1225 | int WSAAPI WSAPoll( | ||
| 1226 | WSAPOLLFD fdarray[], | ||
| 1227 | ULONG nfds, | ||
| 1228 | INT timeout | ||
| 1229 | ); | ||
| 1230 | |||
| 1231 | int WSAAPI WSASendMsg( | ||
| 1232 | SOCKET s, | ||
| 1233 | LPWSAMSG lpMsg, | ||
| 1234 | DWORD dwFlags, | ||
| 1235 | LPDWORD lpNumberOfBytesSent, | ||
| 1236 | LPWSAOVERLAPPED lpOverlapped, | ||
| 1237 | LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine | ||
| 1238 | ); | ||
| 1239 | #endif /*(_WIN32_WINNT >= 0x0600)*/ | ||
| 1240 | |||
| 1241 | #ifdef __cplusplus | ||
| 1242 | } | ||
| 1243 | #endif | ||
| 1244 | |||
| 1245 | #ifdef _NEED_POPPACK | ||
| 1246 | #include <poppack.h> | ||
| 1247 | #endif | ||
| 1248 | |||
| 1249 | #ifdef IPV6STRICT | ||
| 1250 | #include <wsipv6ok.h> | ||
| 1251 | #endif | ||
| 1252 | |||
| 1253 | #endif /* _WINSOCK2API_ */ | ||
| @@ -4870,7 +4870,7 @@ extern "C" { · 4869 unmodified lines | |||
| 4870 | #define CDS_RESET 0x40000000 | 4870 | #define CDS_RESET 0x40000000 |
| 4871 | #define CDS_NORESET 0x10000000 | 4871 | #define CDS_NORESET 0x10000000 |
| 4872 | 4872 | ||
| 4873 | #include <tvout.h> | 4873 | //gr #include <tvout.h> |
| 4874 | 4874 | ||
| 4875 | #define DISP_CHANGE_SUCCESSFUL 0 | 4875 | #define DISP_CHANGE_SUCCESSFUL 0 |
| 4876 | #define DISP_CHANGE_RESTART 1 | 4876 | #define DISP_CHANGE_RESTART 1 |
| @@ -1,39 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _WS2DEF_ | ||
| 8 | #define _WS2DEF_ | ||
| 9 | |||
| 10 | #include <_mingw.h> | ||
| 11 | |||
| 12 | /* FIXME FIXME FIXME FIXME FIXME: Much more data need moving here. | ||
| 13 | * This holds only SCOPE_LEVEL and SCOPE_ID so that compilations | ||
| 14 | * do not fail. | ||
| 15 | */ | ||
| 16 | |||
| 17 | typedef enum _SCOPE_LEVEL { | ||
| 18 | ScopeLevelInterface = 1, | ||
| 19 | ScopeLevelLink = 2, | ||
| 20 | ScopeLevelSubnet = 3, | ||
| 21 | ScopeLevelAdmin = 4, | ||
| 22 | ScopeLevelSite = 5, | ||
| 23 | ScopeLevelOrganization = 8, | ||
| 24 | ScopeLevelGlobal = 14, | ||
| 25 | ScopeLevelCount = 16 | ||
| 26 | } SCOPE_LEVEL; | ||
| 27 | |||
| 28 | typedef struct _SCOPE_ID { | ||
| 29 | __C89_NAMELESS union { | ||
| 30 | __C89_NAMELESS struct { | ||
| 31 | ULONG Zone : 28; | ||
| 32 | ULONG Level : 4; | ||
| 33 | }; | ||
| 34 | ULONG Value; | ||
| 35 | }; | ||
| 36 | } SCOPE_ID, *PSCOPE_ID; | ||
| 37 | |||
| 38 | #endif /* _WS2DEF_ */ | ||
| 39 | |||
| @@ -1,96 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | #ifndef _INC_WS2IPDEF | ||
| 7 | #define _INC_WS2IPDEF | ||
| 8 | |||
| 9 | #include <in6addr.h> | ||
| 10 | #include <ws2def.h> | ||
| 11 | |||
| 12 | #ifdef __cplusplus | ||
| 13 | extern "C" { | ||
| 14 | #endif | ||
| 15 | |||
| 16 | typedef struct ipv6_mreq { | ||
| 17 | struct in6_addr ipv6mr_multiaddr; | ||
| 18 | unsigned int ipv6mr_interface; | ||
| 19 | } IPV6_MREQ; | ||
| 20 | |||
| 21 | struct sockaddr_in6_old { | ||
| 22 | short sin6_family; | ||
| 23 | u_short sin6_port; | ||
| 24 | u_long sin6_flowinfo; | ||
| 25 | struct in6_addr sin6_addr; | ||
| 26 | }; | ||
| 27 | |||
| 28 | typedef union sockaddr_gen { | ||
| 29 | struct sockaddr Address; | ||
| 30 | struct sockaddr_in AddressIn; | ||
| 31 | struct sockaddr_in6_old AddressIn6; | ||
| 32 | } sockaddr_gen; | ||
| 33 | |||
| 34 | struct sockaddr_in6 { | ||
| 35 | short sin6_family; | ||
| 36 | u_short sin6_port; | ||
| 37 | u_long sin6_flowinfo; | ||
| 38 | struct in6_addr sin6_addr; | ||
| 39 | __C89_NAMELESS union { | ||
| 40 | u_long sin6_scope_id; | ||
| 41 | SCOPE_ID sin6_scope_struct; | ||
| 42 | }; | ||
| 43 | }; | ||
| 44 | |||
| 45 | typedef struct sockaddr_in6 SOCKADDR_IN6; | ||
| 46 | typedef struct sockaddr_in6 *PSOCKADDR_IN6; | ||
| 47 | typedef struct sockaddr_in6 *LPSOCKADDR_IN6; | ||
| 48 | typedef u_short ADDRESS_FAMILY; | ||
| 49 | |||
| 50 | typedef struct _INTERFACE_INFO { | ||
| 51 | u_long iiFlags; | ||
| 52 | sockaddr_gen iiAddress; | ||
| 53 | sockaddr_gen iiBroadcastAddress; | ||
| 54 | sockaddr_gen iiNetmask; | ||
| 55 | } INTERFACE_INFO,*LPINTERFACE_INFO; | ||
| 56 | |||
| 57 | typedef enum _MULTICAST_MODE_TYPE { | ||
| 58 | MCAST_INCLUDE = 0, | ||
| 59 | MCAST_EXCLUDE | ||
| 60 | } MULTICAST_MODE_TYPE; | ||
| 61 | |||
| 62 | typedef struct _sockaddr_in6_pair { | ||
| 63 | PSOCKADDR_IN6 SourceAddress; | ||
| 64 | PSOCKADDR_IN6 DestinationAddress; | ||
| 65 | } SOCKADDR_IN6_PAIR, *PSOCKADDR_IN6_PAIR; | ||
| 66 | |||
| 67 | typedef union _SOCKADDR_INET { | ||
| 68 | SOCKADDR_IN Ipv4; | ||
| 69 | SOCKADDR_IN6 Ipv6; | ||
| 70 | ADDRESS_FAMILY si_family; | ||
| 71 | } SOCKADDR_INET, *PSOCKADDR_INET; | ||
| 72 | |||
| 73 | typedef struct group_filter { | ||
| 74 | ULONG gf_interface; | ||
| 75 | SOCKADDR_STORAGE gf_group; | ||
| 76 | MULTICAST_MODE_TYPE gf_fmode; | ||
| 77 | ULONG gf_numsrc; | ||
| 78 | SOCKADDR_STORAGE gf_slist[1]; | ||
| 79 | } GROUP_FILTER, *PGROUP_FILTER; | ||
| 80 | |||
| 81 | typedef struct group_req { | ||
| 82 | ULONG gr_interface; | ||
| 83 | SOCKADDR_STORAGE gr_group; | ||
| 84 | } GROUP_REQ, *PGROUP_REQ; | ||
| 85 | |||
| 86 | typedef struct group_source_req { | ||
| 87 | ULONG gsr_interface; | ||
| 88 | SOCKADDR_STORAGE gsr_group; | ||
| 89 | SOCKADDR_STORAGE gsr_source; | ||
| 90 | } GROUP_SOURCE_REQ, *PGROUP_SOURCE_REQ; | ||
| 91 | |||
| 92 | #ifdef __cplusplus | ||
| 93 | } | ||
| 94 | #endif | ||
| 95 | |||
| 96 | #endif /*_INC_WS2IPDEF*/ | ||
| @@ -1,437 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | ||
| 3 | * This file is part of the w64 mingw-runtime package. | ||
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | ||
| 5 | */ | ||
| 6 | #ifndef _WS2TCPIP_H_ | ||
| 7 | #define _WS2TCPIP_H_ | ||
| 8 | |||
| 9 | #include <_mingw_unicode.h> | ||
| 10 | |||
| 11 | #include <winsock2.h> | ||
| 12 | #include <psdk_inc/_ip_mreq1.h> | ||
| 13 | |||
| 14 | struct ip_mreq_source { | ||
| 15 | struct in_addr imr_multiaddr; | ||
| 16 | struct in_addr imr_sourceaddr; | ||
| 17 | struct in_addr imr_interface; | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct ip_msfilter { | ||
| 21 | struct in_addr imsf_multiaddr; | ||
| 22 | struct in_addr imsf_interface; | ||
| 23 | u_long imsf_fmode; | ||
| 24 | u_long imsf_numsrc; | ||
| 25 | struct in_addr imsf_slist[1]; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #define IP_MSFILTER_SIZE(numsrc) (sizeof(struct ip_msfilter)-sizeof(struct in_addr) + (numsrc)*sizeof(struct in_addr)) | ||
| 29 | |||
| 30 | #define SIO_GET_INTERFACE_LIST _IOR('t',127,u_long) | ||
| 31 | |||
| 32 | #define SIO_GET_INTERFACE_LIST_EX _IOR('t',126,u_long) | ||
| 33 | #define SIO_SET_MULTICAST_FILTER _IOW('t',125,u_long) | ||
| 34 | #define SIO_GET_MULTICAST_FILTER _IOW('t',124 | IOC_IN,u_long) | ||
| 35 | |||
| 36 | #define IP_OPTIONS 1 | ||
| 37 | #define IP_HDRINCL 2 | ||
| 38 | #define IP_TOS 3 | ||
| 39 | #define IP_TTL 4 | ||
| 40 | #define IP_MULTICAST_IF 9 | ||
| 41 | #define IP_MULTICAST_TTL 10 | ||
| 42 | #define IP_MULTICAST_LOOP 11 | ||
| 43 | #define IP_ADD_MEMBERSHIP 12 | ||
| 44 | #define IP_DROP_MEMBERSHIP 13 | ||
| 45 | #define IP_DONTFRAGMENT 14 | ||
| 46 | #define IP_ADD_SOURCE_MEMBERSHIP 15 | ||
| 47 | #define IP_DROP_SOURCE_MEMBERSHIP 16 | ||
| 48 | #define IP_BLOCK_SOURCE 17 | ||
| 49 | #define IP_UNBLOCK_SOURCE 18 | ||
| 50 | #define IP_PKTINFO 19 | ||
| 51 | #define IP_RECEIVE_BROADCAST 22 | ||
| 52 | |||
| 53 | #define IPV6_HDRINCL 2 | ||
| 54 | #define IPV6_UNICAST_HOPS 4 | ||
| 55 | #define IPV6_MULTICAST_IF 9 | ||
| 56 | #define IPV6_MULTICAST_HOPS 10 | ||
| 57 | #define IPV6_MULTICAST_LOOP 11 | ||
| 58 | #define IPV6_ADD_MEMBERSHIP 12 | ||
| 59 | #define IPV6_DROP_MEMBERSHIP 13 | ||
| 60 | #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP | ||
| 61 | #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP | ||
| 62 | #define IPV6_PKTINFO 19 | ||
| 63 | #define IPV6_HOPLIMIT 21 | ||
| 64 | #define IPV6_PROTECTION_LEVEL 23 | ||
| 65 | |||
| 66 | #define PROTECTION_LEVEL_UNRESTRICTED 10 | ||
| 67 | #define PROTECTION_LEVEL_DEFAULT 20 | ||
| 68 | #define PROTECTION_LEVEL_RESTRICTED 30 | ||
| 69 | |||
| 70 | #define UDP_NOCHECKSUM 1 | ||
| 71 | #define UDP_CHECKSUM_COVERAGE 20 | ||
| 72 | |||
| 73 | #define TCP_EXPEDITED_1122 0x0002 | ||
| 74 | |||
| 75 | |||
| 76 | #include <ws2ipdef.h> | ||
| 77 | |||
| 78 | |||
| 79 | #define SS_PORT(ssp) (((struct sockaddr_in*)(ssp))->sin_port) | ||
| 80 | |||
| 81 | #define IN6ADDR_ANY_INIT { 0 } | ||
| 82 | #define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } | ||
| 83 | |||
| 84 | #ifdef __cplusplus | ||
| 85 | extern "C" { | ||
| 86 | #endif | ||
| 87 | |||
| 88 | extern const struct in6_addr in6addr_any; | ||
| 89 | extern const struct in6_addr in6addr_loopback; | ||
| 90 | |||
| 91 | #define WS2TCPIP_INLINE __CRT_INLINE | ||
| 92 | |||
| 93 | int IN6_ADDR_EQUAL(const struct in6_addr *,const struct in6_addr *); | ||
| 94 | int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *); | ||
| 95 | int IN6_IS_ADDR_LOOPBACK(const struct in6_addr *); | ||
| 96 | int IN6_IS_ADDR_MULTICAST(const struct in6_addr *); | ||
| 97 | int IN6_IS_ADDR_LINKLOCAL(const struct in6_addr *); | ||
| 98 | int IN6_IS_ADDR_SITELOCAL(const struct in6_addr *); | ||
| 99 | int IN6_IS_ADDR_V4MAPPED(const struct in6_addr *); | ||
| 100 | int IN6_IS_ADDR_V4COMPAT(const struct in6_addr *); | ||
| 101 | int IN6_IS_ADDR_MC_NODELOCAL(const struct in6_addr *); | ||
| 102 | int IN6_IS_ADDR_MC_LINKLOCAL(const struct in6_addr *); | ||
| 103 | int IN6_IS_ADDR_MC_SITELOCAL(const struct in6_addr *); | ||
| 104 | int IN6_IS_ADDR_MC_ORGLOCAL(const struct in6_addr *); | ||
| 105 | int IN6_IS_ADDR_MC_GLOBAL(const struct in6_addr *); | ||
| 106 | int IN6ADDR_ISANY(const struct sockaddr_in6 *); | ||
| 107 | int IN6ADDR_ISLOOPBACK(const struct sockaddr_in6 *); | ||
| 108 | void IN6_SET_ADDR_UNSPECIFIED(struct in6_addr *); | ||
| 109 | void IN6_SET_ADDR_LOOPBACK(struct in6_addr *); | ||
| 110 | void IN6ADDR_SETANY(struct sockaddr_in6 *); | ||
| 111 | void IN6ADDR_SETLOOPBACK(struct sockaddr_in6 *); | ||
| 112 | |||
| 113 | #ifndef __CRT__NO_INLINE | ||
| 114 | WS2TCPIP_INLINE int IN6_ADDR_EQUAL(const struct in6_addr *a,const struct in6_addr *b) { return (memcmp(a,b,sizeof(struct in6_addr))==0); } | ||
| 115 | WS2TCPIP_INLINE int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && (a->s6_words[6]==0) && (a->s6_words[7]==0)); } | ||
| 116 | WS2TCPIP_INLINE int IN6_IS_ADDR_LOOPBACK(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && (a->s6_words[6]==0) && (a->s6_words[7]==0x0100)); } | ||
| 117 | WS2TCPIP_INLINE int IN6_IS_ADDR_MULTICAST(const struct in6_addr *a) { return (a->s6_bytes[0]==0xff); } | ||
| 118 | WS2TCPIP_INLINE int IN6_IS_ADDR_LINKLOCAL(const struct in6_addr *a) { return ((a->s6_bytes[0]==0xfe) && ((a->s6_bytes[1] & 0xc0)==0x80)); } | ||
| 119 | WS2TCPIP_INLINE int IN6_IS_ADDR_SITELOCAL(const struct in6_addr *a) { return ((a->s6_bytes[0]==0xfe) && ((a->s6_bytes[1] & 0xc0)==0xc0)); } | ||
| 120 | WS2TCPIP_INLINE int IN6_IS_ADDR_V4MAPPED(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0xffff)); } | ||
| 121 | WS2TCPIP_INLINE int IN6_IS_ADDR_V4COMPAT(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && !((a->s6_words[6]==0) && (a->s6_addr[14]==0) && ((a->s6_addr[15]==0) || (a->s6_addr[15]==1)))); } | ||
| 122 | WS2TCPIP_INLINE int IN6_IS_ADDR_MC_NODELOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==1); } | ||
| 123 | WS2TCPIP_INLINE int IN6_IS_ADDR_MC_LINKLOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==2); } | ||
| 124 | WS2TCPIP_INLINE int IN6_IS_ADDR_MC_SITELOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==5); } | ||
| 125 | WS2TCPIP_INLINE int IN6_IS_ADDR_MC_ORGLOCAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==8); } | ||
| 126 | WS2TCPIP_INLINE int IN6_IS_ADDR_MC_GLOBAL(const struct in6_addr *a) { return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_bytes[1] & 0xf)==0xe); } | ||
| 127 | WS2TCPIP_INLINE int IN6ADDR_ISANY(const struct sockaddr_in6 *a) { return ((a->sin6_family==AF_INET6) && IN6_IS_ADDR_UNSPECIFIED(&a->sin6_addr)); } | ||
| 128 | WS2TCPIP_INLINE int IN6ADDR_ISLOOPBACK(const struct sockaddr_in6 *a) { return ((a->sin6_family==AF_INET6) && IN6_IS_ADDR_LOOPBACK(&a->sin6_addr)); } | ||
| 129 | WS2TCPIP_INLINE void IN6_SET_ADDR_UNSPECIFIED(struct in6_addr *a) { memset(a->s6_bytes,0,sizeof(struct in6_addr)); } | ||
| 130 | WS2TCPIP_INLINE void IN6_SET_ADDR_LOOPBACK(struct in6_addr *a) { | ||
| 131 | memset(a->s6_bytes,0,sizeof(struct in6_addr)); | ||
| 132 | a->s6_bytes[15] = 1; | ||
| 133 | } | ||
| 134 | WS2TCPIP_INLINE void IN6ADDR_SETANY(struct sockaddr_in6 *a) { | ||
| 135 | a->sin6_family = AF_INET6; | ||
| 136 | a->sin6_port = 0; | ||
| 137 | a->sin6_flowinfo = 0; | ||
| 138 | IN6_SET_ADDR_UNSPECIFIED(&a->sin6_addr); | ||
| 139 | a->sin6_scope_id = 0; | ||
| 140 | } | ||
| 141 | WS2TCPIP_INLINE void IN6ADDR_SETLOOPBACK(struct sockaddr_in6 *a) { | ||
| 142 | a->sin6_family = AF_INET6; | ||
| 143 | a->sin6_port = 0; | ||
| 144 | a->sin6_flowinfo = 0; | ||
| 145 | IN6_SET_ADDR_LOOPBACK(&a->sin6_addr); | ||
| 146 | a->sin6_scope_id = 0; | ||
| 147 | } | ||
| 148 | #endif /* !__CRT__NO_INLINE */ | ||
| 149 | |||
| 150 | #ifdef __cplusplus | ||
| 151 | } | ||
| 152 | #endif | ||
| 153 | |||
| 154 | typedef struct _INTERFACE_INFO_EX { | ||
| 155 | u_long iiFlags; | ||
| 156 | SOCKET_ADDRESS iiAddress; | ||
| 157 | SOCKET_ADDRESS iiBroadcastAddress; | ||
| 158 | SOCKET_ADDRESS iiNetmask; | ||
| 159 | } INTERFACE_INFO_EX,*LPINTERFACE_INFO_EX; | ||
| 160 | |||
| 161 | #define IFF_UP 0x00000001 | ||
| 162 | #define IFF_BROADCAST 0x00000002 | ||
| 163 | #define IFF_LOOPBACK 0x00000004 | ||
| 164 | #define IFF_POINTTOPOINT 0x00000008 | ||
| 165 | #define IFF_MULTICAST 0x00000010 | ||
| 166 | |||
| 167 | typedef struct in_pktinfo { | ||
| 168 | IN_ADDR ipi_addr; | ||
| 169 | UINT ipi_ifindex; | ||
| 170 | } IN_PKTINFO; | ||
| 171 | |||
| 172 | C_ASSERT(sizeof(IN_PKTINFO)==8); | ||
| 173 | |||
| 174 | typedef struct in6_pktinfo { | ||
| 175 | IN6_ADDR ipi6_addr; | ||
| 176 | UINT ipi6_ifindex; | ||
| 177 | } IN6_PKTINFO; | ||
| 178 | |||
| 179 | C_ASSERT(sizeof(IN6_PKTINFO)==20); | ||
| 180 | |||
| 181 | #define EAI_AGAIN WSATRY_AGAIN | ||
| 182 | #define EAI_BADFLAGS WSAEINVAL | ||
| 183 | #define EAI_FAIL WSANO_RECOVERY | ||
| 184 | #define EAI_FAMILY WSAEAFNOSUPPORT | ||
| 185 | #define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY | ||
| 186 | |||
| 187 | #define EAI_NONAME WSAHOST_NOT_FOUND | ||
| 188 | #define EAI_SERVICE WSATYPE_NOT_FOUND | ||
| 189 | #define EAI_SOCKTYPE WSAESOCKTNOSUPPORT | ||
| 190 | |||
| 191 | #define EAI_NODATA EAI_NONAME | ||
| 192 | |||
| 193 | typedef struct addrinfo { | ||
| 194 | int ai_flags; | ||
| 195 | int ai_family; | ||
| 196 | int ai_socktype; | ||
| 197 | int ai_protocol; | ||
| 198 | size_t ai_addrlen; | ||
| 199 | char *ai_canonname; | ||
| 200 | struct sockaddr *ai_addr; | ||
| 201 | struct addrinfo *ai_next; | ||
| 202 | } ADDRINFOA,*PADDRINFOA; | ||
| 203 | |||
| 204 | typedef struct addrinfoW { | ||
| 205 | int ai_flags; | ||
| 206 | int ai_family; | ||
| 207 | int ai_socktype; | ||
| 208 | int ai_protocol; | ||
| 209 | size_t ai_addrlen; | ||
| 210 | PWSTR ai_canonname; | ||
| 211 | struct sockaddr *ai_addr; | ||
| 212 | struct addrinfoW *ai_next; | ||
| 213 | } ADDRINFOW,*PADDRINFOW; | ||
| 214 | |||
| 215 | typedef __MINGW_NAME_AW(ADDRINFO) ADDRINFOT,*PADDRINFOT; | ||
| 216 | |||
| 217 | typedef ADDRINFOA ADDRINFO,*LPADDRINFO; | ||
| 218 | |||
| 219 | #define AI_PASSIVE 0x1 | ||
| 220 | #define AI_CANONNAME 0x2 | ||
| 221 | #define AI_NUMERICHOST 0x4 | ||
| 222 | #if (_WIN32_WINNT >= 0x0600) | ||
| 223 | #define AI_ADDRCONFIG 0x0400 | ||
| 224 | #define AI_NON_AUTHORITATIVE 0x04000 | ||
| 225 | #define AI_SECURE 0x08000 | ||
| 226 | #define AI_RETURN_PREFERRED_NAMES 0x010000 | ||
| 227 | #endif | ||
| 228 | |||
| 229 | #ifdef __cplusplus | ||
| 230 | extern "C" { | ||
| 231 | #endif | ||
| 232 | |||
| 233 | #define GetAddrInfo __MINGW_NAME_AW(GetAddrInfo) | ||
| 234 | |||
| 235 | WINSOCK_API_LINKAGE int WSAAPI getaddrinfo(const char *nodename,const char *servname,const struct addrinfo *hints,struct addrinfo **res); | ||
| 236 | WINSOCK_API_LINKAGE int WSAAPI GetAddrInfoW(PCWSTR pNodeName,PCWSTR pServiceName,const ADDRINFOW *pHints,PADDRINFOW *ppResult); | ||
| 237 | |||
| 238 | #define GetAddrInfoA getaddrinfo | ||
| 239 | |||
| 240 | #if INCL_WINSOCK_API_TYPEDEFS | ||
| 241 | typedef int (WSAAPI *LPFN_GETADDRINFO)(const char *nodename,const char *servname,const struct addrinfo *hints,struct addrinfo **res); | ||
| 242 | typedef int (WSAAPI *LPFN_GETADDRINFOW)(PCWSTR pNodeName,PCWSTR pServiceName,const ADDRINFOW *pHints,PADDRINFOW *ppResult); | ||
| 243 | |||
| 244 | #define LPFN_GETADDRINFOA LPFN_GETADDRINFO | ||
| 245 | |||
| 246 | #define LPFN_GETADDRINFOT __MINGW_NAME_AW(LPFN_GETADDRINFO) | ||
| 247 | #endif | ||
| 248 | |||
| 249 | #define FreeAddrInfo __MINGW_NAME_AW(FreeAddrInfo) | ||
| 250 | |||
| 251 | WINSOCK_API_LINKAGE void WSAAPI freeaddrinfo(LPADDRINFO pAddrInfo); | ||
| 252 | WINSOCK_API_LINKAGE void WSAAPI FreeAddrInfoW(PADDRINFOW pAddrInfo); | ||
| 253 | |||
| 254 | #define FreeAddrInfoA freeaddrinfo | ||
| 255 | |||
| 256 | #if INCL_WINSOCK_API_TYPEDEFS | ||
| 257 | typedef void (WSAAPI *LPFN_FREEADDRINFO)(struct addrinfo *ai); | ||
| 258 | typedef void (WSAAPI *LPFN_FREEADDRINFOW)(PADDRINFOW pAddrInfo); | ||
| 259 | |||
| 260 | #define LPFN_FREEADDRINFOA LPFN_FREEADDRINFO | ||
| 261 | |||
| 262 | #define LPFN_FREEADDRINFOT __MINGW_NAME_AW(LPFN_FREEADDRINFO) | ||
| 263 | #endif | ||
| 264 | |||
| 265 | typedef int socklen_t; | ||
| 266 | |||
| 267 | #define GetNameInfo __MINGW_NAME_AW(GetNameInfo) | ||
| 268 | |||
| 269 | WINSOCK_API_LINKAGE int WSAAPI getnameinfo(const struct sockaddr *sa,socklen_t salen,char *host,DWORD hostlen,char *serv,DWORD servlen,int flags); | ||
| 270 | WINSOCK_API_LINKAGE INT WSAAPI GetNameInfoW(const SOCKADDR *pSockaddr,socklen_t SockaddrLength,PWCHAR pNodeBuffer,DWORD NodeBufferSize,PWCHAR pServiceBuffer,DWORD ServiceBufferSize,INT Flags); | ||
| 271 | |||
| 272 | #define GetNameInfoA getnameinfo | ||
| 273 | |||
| 274 | #if INCL_WINSOCK_API_TYPEDEFS | ||
| 275 | typedef int (WSAAPI *LPFN_GETNAMEINFO)(const struct sockaddr *sa,socklen_t salen,char *host,DWORD hostlen,char *serv,DWORD servlen,int flags); | ||
| 276 | typedef INT (WSAAPI *LPFN_GETNAMEINFOW)(const SOCKADDR *pSockaddr,socklen_t SockaddrLength,PWCHAR pNodeBuffer,DWORD NodeBufferSize,PWCHAR pServiceBuffer,DWORD ServiceBufferSize,INT Flags); | ||
| 277 | |||
| 278 | #define LPFN_GETNAMEINFOA LPFN_GETNAMEINFO | ||
| 279 | |||
| 280 | #define LPFN_GETNAMEINFOT __MINGW_NAME_AW(LPFN_GETNAMEINFO) | ||
| 281 | #endif | ||
| 282 | |||
| 283 | #define gai_strerror __MINGW_NAME_AW(gai_strerror) | ||
| 284 | |||
| 285 | #define GAI_STRERROR_BUFFER_SIZE 1024 | ||
| 286 | |||
| 287 | char *gai_strerrorA (int); | ||
| 288 | WCHAR *gai_strerrorW(int); | ||
| 289 | |||
| 290 | #define NI_MAXHOST 1025 | ||
| 291 | #define NI_MAXSERV 32 | ||
| 292 | |||
| 293 | #define INET_ADDRSTRLEN 22 | ||
| 294 | #define INET6_ADDRSTRLEN 65 | ||
| 295 | |||
| 296 | #define NI_NOFQDN 0x01 | ||
| 297 | #define NI_NUMERICHOST 0x02 | ||
| 298 | #define NI_NAMEREQD 0x04 | ||
| 299 | #define NI_NUMERICSERV 0x08 | ||
| 300 | #define NI_DGRAM 0x10 | ||
| 301 | |||
| 302 | #include <mstcpip.h> | ||
| 303 | |||
| 304 | #if (_WIN32_WINNT >= 0x0600) | ||
| 305 | #define addrinfoEx __MINGW_NAME_AW(addrinfoEx) | ||
| 306 | #define PADDRINFOEX __MINGW_NAME_AW(PADDRINFOEX) | ||
| 307 | #define GetAddrInfoEx __MINGW_NAME_AW(GetAddrInfoEx) | ||
| 308 | #define SetAddrInfoEx __MINGW_NAME_AW(SetAddrInfoEx) | ||
| 309 | #define FreeAddrInfoEx __MINGW_NAME_AW(FreeAddrInfoEx) | ||
| 310 | |||
| 311 | typedef struct addrinfoExA { | ||
| 312 | int ai_flags; | ||
| 313 | int ai_family; | ||
| 314 | int ai_socktype; | ||
| 315 | int ai_protocol; | ||
| 316 | size_t ai_addrlen; | ||
| 317 | LPCSTR ai_canonname; | ||
| 318 | struct sockaddr *ai_addr; | ||
| 319 | void *ai_blob; | ||
| 320 | size_t ai_bloblen; | ||
| 321 | LPGUID ai_provider; | ||
| 322 | struct addrinfoexA *ai_next; | ||
| 323 | } ADDRINFOEXA, *PADDRINFOEXA; | ||
| 324 | |||
| 325 | typedef struct addrinfoExW { | ||
| 326 | int ai_flags; | ||
| 327 | int ai_family; | ||
| 328 | int ai_socktype; | ||
| 329 | int ai_protocol; | ||
| 330 | size_t ai_addrlen; | ||
| 331 | LPCWSTR ai_canonname; | ||
| 332 | struct sockaddr *ai_addr; | ||
| 333 | void *ai_blob; | ||
| 334 | size_t ai_bloblen; | ||
| 335 | LPGUID ai_provider; | ||
| 336 | struct addrinfoexW *ai_next; | ||
| 337 | } ADDRINFOEXW, *PADDRINFOEXW; | ||
| 338 | |||
| 339 | typedef PVOID LPLOOKUPSERVICE_COMPLETION_ROUTINE; /*reserved*/ | ||
| 340 | |||
| 341 | WINSOCK_API_LINKAGE int WSAAPI GetAddrInfoExA(PCSTR pName, PCSTR pServiceName, DWORD dwNameSpace, | ||
| 342 | LPGUID lpNspId,const ADDRINFOEXA *pHints,PADDRINFOEXA *ppResult, | ||
| 343 | struct timeval *timeout,LPOVERLAPPED lpOverlapped, | ||
| 344 | LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine, | ||
| 345 | LPHANDLE lpNameHandle); | ||
| 346 | WINSOCK_API_LINKAGE int WSAAPI GetAddrInfoExW(PCWSTR pName,PCWSTR pServiceName,DWORD dwNameSpace, | ||
| 347 | LPGUID lpNspId,const ADDRINFOEXW *pHints,PADDRINFOEXW *ppResult, | ||
| 348 | struct timeval *timeout,LPOVERLAPPED lpOverlapped, | ||
| 349 | LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine, | ||
| 350 | LPHANDLE lpNameHandle); | ||
| 351 | |||
| 352 | WINSOCK_API_LINKAGE int WSAAPI SetAddrInfoExA(PCSTR pName, PCSTR pServiceName, SOCKET_ADDRESS *pAddresses, | ||
| 353 | DWORD dwAddressCount,LPBLOB lpBlob,DWORD dwFlags,DWORD dwNameSpace, | ||
| 354 | LPGUID lpNspId,struct timeval *timeout,LPOVERLAPPED lpOverlapped, | ||
| 355 | LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine, | ||
| 356 | LPHANDLE lpNameHandle); | ||
| 357 | WINSOCK_API_LINKAGE int WSAAPI SetAddrInfoExW(PCWSTR pName,PCWSTR pServiceName,SOCKET_ADDRESS *pAddresses, | ||
| 358 | DWORD dwAddressCount,LPBLOB lpBlob,DWORD dwFlags,DWORD dwNameSpace, | ||
| 359 | LPGUID lpNspId,struct timeval *timeout,LPOVERLAPPED lpOverlapped, | ||
| 360 | LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine, | ||
| 361 | LPHANDLE lpNameHandle); | ||
| 362 | |||
| 363 | WINSOCK_API_LINKAGE void WSAAPI FreeAddrInfoExA(PADDRINFOEXA pAddrInfo); | ||
| 364 | WINSOCK_API_LINKAGE void WSAAPI FreeAddrInfoExW(PADDRINFOEXW pAddrInfo); | ||
| 365 | |||
| 366 | #if INCL_WINSOCK_API_TYPEDEFS | ||
| 367 | #define LPFN_GETADDRINFOEX __MINGW_NAME_AW(LPFN_GETADDRINFOEX) | ||
| 368 | typedef int (WSAAPI *LPFN_GETADDRINFOEXA)(PCSTR pName, PCSTR pServiceName, DWORD dwNameSpace, | ||
| 369 | LPGUID lpNspId,const ADDRINFOEXA *pHints,PADDRINFOEXA *ppResult, | ||
| 370 | struct timeval *timeout,LPOVERLAPPED lpOverlapped, | ||
| 371 | LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine, | ||
| 372 | LPHANDLE lpNameHandle); | ||
| 373 | typedef int (WSAAPI *LPFN_GETADDRINFOEXW)(PCWSTR pName,PCWSTR pServiceName,DWORD dwNameSpace, | ||
| 374 | LPGUID lpNspId,const ADDRINFOEXW *pHints,PADDRINFOEXW *ppResult, | ||
| 375 | struct timeval *timeout,LPOVERLAPPED lpOverlapped, | ||
| 376 | LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine, | ||
| 377 | LPHANDLE lpNameHandle); | ||
| 378 | |||
| 379 | #define LPFN_SETADDRINFOEX __MINGW_NAME_AW(LPFN_SETADDRINFOEX) | ||
| 380 | typedef int (WSAAPI *LPFN_SETADDRINFOEXA)(PCSTR pName, PCSTR pServiceName, SOCKET_ADDRESS *pAddresses, | ||
| 381 | DWORD dwAddressCount,LPBLOB lpBlob,DWORD dwFlags,DWORD dwNameSpace, | ||
| 382 | LPGUID lpNspId,struct timeval *timeout,LPOVERLAPPED lpOverlapped, | ||
| 383 | LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine, | ||
| 384 | LPHANDLE lpNameHandle); | ||
| 385 | typedef int (WSAAPI *LPFN_SETADDRINFOEXW)(PCWSTR pName,PCWSTR pServiceName,SOCKET_ADDRESS *pAddresses, | ||
| 386 | DWORD dwAddressCount,LPBLOB lpBlob,DWORD dwFlags,DWORD dwNameSpace, | ||
| 387 | LPGUID lpNspId,struct timeval *timeout,LPOVERLAPPED lpOverlapped, | ||
| 388 | LPLOOKUPSERVICE_COMPLETION_ROUTINE lpCompletionRoutine, | ||
| 389 | LPHANDLE lpNameHandle); | ||
| 390 | |||
| 391 | #define LPFN_FREEADDRINFOEX __MINGW_NAME_AW(LPFN_FREEADDRINFOEX) | ||
| 392 | typedef void (WSAAPI *LPFN_FREEADDRINFOEXA)(PADDRINFOEXA pAddrInfo); | ||
| 393 | typedef void (WSAAPI *LPFN_FREEADDRINFOEXW)(PADDRINFOEXW pAddrInfo); | ||
| 394 | #endif /* INCL_WINSOCK_API_TYPEDEFS */ | ||
| 395 | |||
| 396 | |||
| 397 | WINSOCK_API_LINKAGE int WSAAPI WSAImpersonateSocketPeer( | ||
| 398 | SOCKET Socket, | ||
| 399 | const struct sockaddr *PeerAddress, | ||
| 400 | ULONG peerAddressLen | ||
| 401 | ); | ||
| 402 | |||
| 403 | WINSOCK_API_LINKAGE int WSAAPI WSAQuerySocketSecurity( | ||
| 404 | SOCKET Socket, | ||
| 405 | const SOCKET_SECURITY_QUERY_TEMPLATE *SecurityQueryTemplate, | ||
| 406 | ULONG SecurityQueryTemplateLen, | ||
| 407 | SOCKET_SECURITY_QUERY_INFO *SecurityQueryInfo, | ||
| 408 | ULONG *SecurityQueryInfoLen, | ||
| 409 | LPWSAOVERLAPPED Overlapped, | ||
| 410 | LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine | ||
| 411 | ); | ||
| 412 | |||
| 413 | WINSOCK_API_LINKAGE int WSAAPI WSARevertImpersonation(void); | ||
| 414 | |||
| 415 | WINSOCK_API_LINKAGE int WSAAPI WSASetSocketPeerTargetName( | ||
| 416 | SOCKET Socket, | ||
| 417 | const SOCKET_PEER_TARGET_NAME *PeerTargetName, | ||
| 418 | ULONG PeerTargetNameLen, | ||
| 419 | LPWSAOVERLAPPED Overlapped, | ||
| 420 | LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine | ||
| 421 | ); | ||
| 422 | |||
| 423 | WINSOCK_API_LINKAGE int WSAAPI WSASetSocketSecurity( | ||
| 424 | SOCKET Socket, | ||
| 425 | const SOCKET_SECURITY_SETTINGS *SecuritySettings, | ||
| 426 | ULONG SecuritySettingsLen, | ||
| 427 | LPWSAOVERLAPPED Overlapped, | ||
| 428 | LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine | ||
| 429 | ); | ||
| 430 | |||
| 431 | #endif /*(_WIN32_WINNT >= 0x0600)*/ | ||
| 432 | |||
| 433 | #ifdef __cplusplus | ||
| 434 | } | ||
| 435 | #endif | ||
| 436 | |||
| 437 | #endif /* _WS2TCPIP_H_ */ | ||
| @@ -1,1290 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file winsock2.h | ||
| 3 | * Copyright 2012, 2013 MinGW.org project | ||
| 4 | * | ||
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 6 | * copy of this software and associated documentation files (the "Software"), | ||
| 7 | * to deal in the Software without restriction, including without limitation | ||
| 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 9 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 10 | * Software is furnished to do so, subject to the following conditions: | ||
| 11 | * | ||
| 12 | * The above copyright notice and this permission notice (including the next | ||
| 13 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 14 | * Software. | ||
| 15 | * | ||
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 22 | * DEALINGS IN THE SOFTWARE. | ||
| 23 | */ | ||
| 24 | /* | ||
| 25 | * Definitions for winsock 2 | ||
| 26 | * | ||
| 27 | * Portions Copyright (c) 1980, 1983, 1988, 1993 | ||
| 28 | * The Regents of the University of California. All rights reserved. | ||
| 29 | * | ||
| 30 | * Portions Copyright (c) 1993 by Digital Equipment Corporation. | ||
| 31 | */ | ||
| 32 | #if !(defined _WINSOCK2_H || defined _WINSOCK_H) | ||
| 33 | #define _WINSOCK2_H | ||
| 34 | #define _WINSOCK_H /* to prevent later inclusion of winsock.h */ | ||
| 35 | #pragma GCC system_header | ||
| 36 | #include <_mingw.h> | ||
| 37 | |||
| 38 | #define _GNU_H_WINDOWS32_SOCKETS | ||
| 39 | |||
| 40 | #include <windows.h> | ||
| 41 | |||
| 42 | #ifndef WINSOCK_API_LINKAGE | ||
| 43 | #ifdef __W32API_USE_DLLIMPORT__ | ||
| 44 | #define WINSOCK_API_LINKAGE DECLSPEC_IMPORT | ||
| 45 | #else | ||
| 46 | #define WINSOCK_API_LINKAGE | ||
| 47 | #endif | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #ifdef __cplusplus | ||
| 51 | extern "C" { | ||
| 52 | #endif | ||
| 53 | |||
| 54 | /* Names common to Winsock1.1 and Winsock2 */ | ||
| 55 | #if !defined ( _BSDTYPES_DEFINED ) | ||
| 56 | /* also defined in gmon.h and in cygwin's sys/types */ | ||
| 57 | typedef unsigned char u_char; | ||
| 58 | typedef unsigned short u_short; | ||
| 59 | typedef unsigned int u_int; | ||
| 60 | typedef unsigned long u_long; | ||
| 61 | #define _BSDTYPES_DEFINED | ||
| 62 | #endif /* ! def _BSDTYPES_DEFINED */ | ||
| 63 | |||
| 64 | typedef u_int SOCKET; | ||
| 65 | |||
| 66 | #ifndef FD_SETSIZE | ||
| 67 | #define FD_SETSIZE 64 | ||
| 68 | #endif | ||
| 69 | |||
| 70 | /* shutdown() how types */ | ||
| 71 | #define SD_RECEIVE 0x00 | ||
| 72 | #define SD_SEND 0x01 | ||
| 73 | #define SD_BOTH 0x02 | ||
| 74 | |||
| 75 | #ifndef _SYS_TYPES_FD_SET | ||
| 76 | /* fd_set may be defined by the newlib <sys/types.h> | ||
| 77 | * if __USE_W32_SOCKETS not defined. | ||
| 78 | */ | ||
| 79 | |||
| 80 | #ifdef fd_set | ||
| 81 | #undef fd_set | ||
| 82 | #endif | ||
| 83 | |||
| 84 | typedef struct fd_set { | ||
| 85 | u_int fd_count; | ||
| 86 | SOCKET fd_array[FD_SETSIZE]; | ||
| 87 | } fd_set; | ||
| 88 | int PASCAL __WSAFDIsSet(SOCKET,fd_set*); | ||
| 89 | |||
| 90 | #ifndef FD_CLR | ||
| 91 | #define FD_CLR(fd,set) do { u_int __i;\ | ||
| 92 | for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\ | ||
| 93 | if (((fd_set *)(set))->fd_array[__i] == (fd)) {\ | ||
| 94 | while (__i < ((fd_set *)(set))->fd_count-1) {\ | ||
| 95 | ((fd_set*)(set))->fd_array[__i] = ((fd_set*)(set))->fd_array[__i+1];\ | ||
| 96 | __i++;\ | ||
| 97 | }\ | ||
| 98 | ((fd_set*)(set))->fd_count--;\ | ||
| 99 | break;\ | ||
| 100 | }\ | ||
| 101 | }\ | ||
| 102 | } while (0) | ||
| 103 | #endif | ||
| 104 | |||
| 105 | #ifndef FD_SET | ||
| 106 | /* this differs from the define in winsock.h and in cygwin sys/types.h */ | ||
| 107 | #define FD_SET(fd, set) do { u_int __i;\ | ||
| 108 | for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\ | ||
| 109 | if (((fd_set *)(set))->fd_array[__i] == (fd)) {\ | ||
| 110 | break;\ | ||
| 111 | }\ | ||
| 112 | }\ | ||
| 113 | if (__i == ((fd_set *)(set))->fd_count) {\ | ||
| 114 | if (((fd_set *)(set))->fd_count < FD_SETSIZE) {\ | ||
| 115 | ((fd_set *)(set))->fd_array[__i] = (fd);\ | ||
| 116 | ((fd_set *)(set))->fd_count++;\ | ||
| 117 | }\ | ||
| 118 | }\ | ||
| 119 | } while(0) | ||
| 120 | #endif | ||
| 121 | |||
| 122 | #ifndef FD_ZERO | ||
| 123 | #define FD_ZERO(set) (((fd_set *)(set))->fd_count=0) | ||
| 124 | #endif | ||
| 125 | |||
| 126 | #ifndef FD_ISSET | ||
| 127 | #define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set *)(set)) | ||
| 128 | #endif | ||
| 129 | |||
| 130 | #elif !defined (USE_SYS_TYPES_FD_SET) | ||
| 131 | |||
| 132 | #warning "fd_set and associated macros have been defined in sys/types. \ | ||
| 133 | This may cause runtime problems with W32 sockets" | ||
| 134 | #endif /* ndef _SYS_TYPES_FD_SET */ | ||
| 135 | |||
| 136 | #if !(defined (__INSIDE_CYGWIN__) || (__INSIDE_MSYS__)) | ||
| 137 | |||
| 138 | #ifndef _TIMEVAL_DEFINED /* also in sys/time.h */ | ||
| 139 | #define _TIMEVAL_DEFINED | ||
| 140 | struct timeval { | ||
| 141 | long tv_sec; | ||
| 142 | long tv_usec; | ||
| 143 | }; | ||
| 144 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) | ||
| 145 | #define timercmp(tvp, uvp, cmp) \ | ||
| 146 | (((tvp)->tv_sec != (uvp)->tv_sec) ? \ | ||
| 147 | ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ | ||
| 148 | ((tvp)->tv_usec cmp (uvp)->tv_usec)) | ||
| 149 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 | ||
| 150 | #endif /* _TIMEVAL_DEFINED */ | ||
| 151 | |||
| 152 | struct hostent { | ||
| 153 | char *h_name; | ||
| 154 | char **h_aliases; | ||
| 155 | short h_addrtype; | ||
| 156 | short h_length; | ||
| 157 | char **h_addr_list; | ||
| 158 | #define h_addr h_addr_list[0] | ||
| 159 | }; | ||
| 160 | struct linger { | ||
| 161 | u_short l_onoff; | ||
| 162 | u_short l_linger; | ||
| 163 | }; | ||
| 164 | #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | ||
| 165 | |||
| 166 | #define IOCPARM_MASK 0x7f | ||
| 167 | #define IOC_VOID 0x20000000 | ||
| 168 | #define IOC_OUT 0x40000000 | ||
| 169 | #define IOC_IN 0x80000000 | ||
| 170 | #define IOC_INOUT (IOC_IN|IOC_OUT) | ||
| 171 | |||
| 172 | #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__)) | ||
| 173 | #define _IO(x,y) (IOC_VOID|((x)<<8)|(y)) | ||
| 174 | #define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) | ||
| 175 | #define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) | ||
| 176 | #define FIONBIO _IOW('f', 126, u_long) | ||
| 177 | #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | ||
| 178 | |||
| 179 | #define FIONREAD _IOR('f', 127, u_long) | ||
| 180 | #define FIOASYNC _IOW('f', 125, u_long) | ||
| 181 | #define SIOCSHIWAT _IOW('s', 0, u_long) | ||
| 182 | #define SIOCGHIWAT _IOR('s', 1, u_long) | ||
| 183 | #define SIOCSLOWAT _IOW('s', 2, u_long) | ||
| 184 | #define SIOCGLOWAT _IOR('s', 3, u_long) | ||
| 185 | #define SIOCATMARK _IOR('s', 7, u_long) | ||
| 186 | |||
| 187 | #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__)) | ||
| 188 | struct netent { | ||
| 189 | char * n_name; | ||
| 190 | char **n_aliases; | ||
| 191 | short n_addrtype; | ||
| 192 | u_long n_net; | ||
| 193 | }; | ||
| 194 | struct servent { | ||
| 195 | char *s_name; | ||
| 196 | char **s_aliases; | ||
| 197 | short s_port; | ||
| 198 | char *s_proto; | ||
| 199 | }; | ||
| 200 | struct protoent { | ||
| 201 | char *p_name; | ||
| 202 | char **p_aliases; | ||
| 203 | short p_proto; | ||
| 204 | }; | ||
| 205 | #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | ||
| 206 | |||
| 207 | #define IPPROTO_IP 0 | ||
| 208 | #define IPPROTO_ICMP 1 | ||
| 209 | #define IPPROTO_IGMP 2 | ||
| 210 | #define IPPROTO_GGP 3 | ||
| 211 | #define IPPROTO_TCP 6 | ||
| 212 | #define IPPROTO_PUP 12 | ||
| 213 | #define IPPROTO_UDP 17 | ||
| 214 | #define IPPROTO_IDP 22 | ||
| 215 | #define IPPROTO_ND 77 | ||
| 216 | #define IPPROTO_RAW 255 | ||
| 217 | #define IPPROTO_MAX 256 | ||
| 218 | /* IPv6 options */ | ||
| 219 | #define IPPROTO_HOPOPTS 0 /* IPv6 Hop-by-Hop options */ | ||
| 220 | #define IPPROTO_IPV6 41 /* IPv6 header */ | ||
| 221 | #define IPPROTO_ROUTING 43 /* IPv6 Routing header */ | ||
| 222 | #define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */ | ||
| 223 | #define IPPROTO_ESP 50 /* encapsulating security payload */ | ||
| 224 | #define IPPROTO_AH 51 /* authentication header */ | ||
| 225 | #define IPPROTO_ICMPV6 58 /* ICMPv6 */ | ||
| 226 | #define IPPROTO_NONE 59 /* IPv6 no next header */ | ||
| 227 | #define IPPROTO_DSTOPTS 60 /* IPv6 Destination options */ | ||
| 228 | #define IPPORT_ECHO 7 | ||
| 229 | #define IPPORT_DISCARD 9 | ||
| 230 | #define IPPORT_SYSTAT 11 | ||
| 231 | #define IPPORT_DAYTIME 13 | ||
| 232 | #define IPPORT_NETSTAT 15 | ||
| 233 | #define IPPORT_FTP 21 | ||
| 234 | #define IPPORT_TELNET 23 | ||
| 235 | #define IPPORT_SMTP 25 | ||
| 236 | #define IPPORT_TIMESERVER 37 | ||
| 237 | #define IPPORT_NAMESERVER 42 | ||
| 238 | #define IPPORT_WHOIS 43 | ||
| 239 | #define IPPORT_MTP 57 | ||
| 240 | #define IPPORT_TFTP 69 | ||
| 241 | #define IPPORT_RJE 77 | ||
| 242 | #define IPPORT_FINGER 79 | ||
| 243 | #define IPPORT_TTYLINK 87 | ||
| 244 | #define IPPORT_SUPDUP 95 | ||
| 245 | #define IPPORT_EXECSERVER 512 | ||
| 246 | #define IPPORT_LOGINSERVER 513 | ||
| 247 | #define IPPORT_CMDSERVER 514 | ||
| 248 | #define IPPORT_EFSSERVER 520 | ||
| 249 | #define IPPORT_BIFFUDP 512 | ||
| 250 | #define IPPORT_WHOSERVER 513 | ||
| 251 | #define IPPORT_ROUTESERVER 520 | ||
| 252 | #define IPPORT_RESERVED 1024 | ||
| 253 | #define IMPLINK_IP 155 | ||
| 254 | #define IMPLINK_LOWEXPER 156 | ||
| 255 | #define IMPLINK_HIGHEXPER 158 | ||
| 256 | struct in_addr { | ||
| 257 | union { | ||
| 258 | struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; | ||
| 259 | struct { u_short s_w1,s_w2; } S_un_w; | ||
| 260 | u_long S_addr; | ||
| 261 | } S_un; | ||
| 262 | #define s_addr S_un.S_addr | ||
| 263 | #define s_host S_un.S_un_b.s_b2 | ||
| 264 | #define s_net S_un.S_un_b.s_b1 | ||
| 265 | #define s_imp S_un.S_un_w.s_w2 | ||
| 266 | #define s_impno S_un.S_un_b.s_b4 | ||
| 267 | #define s_lh S_un.S_un_b.s_b3 | ||
| 268 | }; | ||
| 269 | #define IN_CLASSA(i) (((long)(i)&0x80000000) == 0) | ||
| 270 | #define IN_CLASSA_NET 0xff000000 | ||
| 271 | #define IN_CLASSA_NSHIFT 24 | ||
| 272 | #define IN_CLASSA_HOST 0x00ffffff | ||
| 273 | #define IN_CLASSA_MAX 128 | ||
| 274 | #define IN_CLASSB(i) (((long)(i)&0xc0000000)==0x80000000) | ||
| 275 | #define IN_CLASSB_NET 0xffff0000 | ||
| 276 | #define IN_CLASSB_NSHIFT 16 | ||
| 277 | #define IN_CLASSB_HOST 0x0000ffff | ||
| 278 | #define IN_CLASSB_MAX 65536 | ||
| 279 | #define IN_CLASSC(i) (((long)(i)&0xe0000000)==0xc0000000) | ||
| 280 | #define IN_CLASSC_NET 0xffffff00 | ||
| 281 | #define IN_CLASSC_NSHIFT 8 | ||
| 282 | #define IN_CLASSC_HOST 0xff | ||
| 283 | #define INADDR_ANY (u_long)0 | ||
| 284 | #define INADDR_LOOPBACK 0x7f000001 | ||
| 285 | #define INADDR_BROADCAST (u_long)0xffffffff | ||
| 286 | #define INADDR_NONE 0xffffffff | ||
| 287 | struct sockaddr_in { | ||
| 288 | short sin_family; | ||
| 289 | u_short sin_port; | ||
| 290 | struct in_addr sin_addr; | ||
| 291 | char sin_zero[8]; | ||
| 292 | }; | ||
| 293 | #define WSADESCRIPTION_LEN 256 | ||
| 294 | #define WSASYS_STATUS_LEN 128 | ||
| 295 | typedef struct WSAData { | ||
| 296 | WORD wVersion; | ||
| 297 | WORD wHighVersion; | ||
| 298 | char szDescription[WSADESCRIPTION_LEN+1]; | ||
| 299 | char szSystemStatus[WSASYS_STATUS_LEN+1]; | ||
| 300 | unsigned short iMaxSockets; | ||
| 301 | unsigned short iMaxUdpDg; | ||
| 302 | char * lpVendorInfo; | ||
| 303 | } WSADATA; | ||
| 304 | typedef WSADATA *LPWSADATA; | ||
| 305 | |||
| 306 | #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__)) | ||
| 307 | #define IP_OPTIONS 1 | ||
| 308 | #define SO_DEBUG 1 | ||
| 309 | #define SO_ACCEPTCONN 2 | ||
| 310 | #define SO_REUSEADDR 4 | ||
| 311 | #define SO_KEEPALIVE 8 | ||
| 312 | #define SO_DONTROUTE 16 | ||
| 313 | #define SO_BROADCAST 32 | ||
| 314 | #define SO_USELOOPBACK 64 | ||
| 315 | #define SO_LINGER 128 | ||
| 316 | #define SO_OOBINLINE 256 | ||
| 317 | #define SO_DONTLINGER (u_int)(~SO_LINGER) | ||
| 318 | #define SO_EXCLUSIVEADDRUSE ((u_int)(~SO_REUSEADDR)) | ||
| 319 | #define SO_SNDBUF 0x1001 | ||
| 320 | #define SO_RCVBUF 0x1002 | ||
| 321 | #define SO_SNDLOWAT 0x1003 | ||
| 322 | #define SO_RCVLOWAT 0x1004 | ||
| 323 | #define SO_SNDTIMEO 0x1005 | ||
| 324 | #define SO_RCVTIMEO 0x1006 | ||
| 325 | #define SO_ERROR 0x1007 | ||
| 326 | #define SO_TYPE 0x1008 | ||
| 327 | #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | ||
| 328 | |||
| 329 | #define INVALID_SOCKET (SOCKET)(~0) | ||
| 330 | #define SOCKET_ERROR (-1) | ||
| 331 | #define SOCK_STREAM 1 | ||
| 332 | #define SOCK_DGRAM 2 | ||
| 333 | #define SOCK_RAW 3 | ||
| 334 | #define SOCK_RDM 4 | ||
| 335 | #define SOCK_SEQPACKET 5 | ||
| 336 | #define TCP_NODELAY 0x0001 | ||
| 337 | #define AF_UNSPEC 0 | ||
| 338 | #define AF_UNIX 1 | ||
| 339 | #define AF_INET 2 | ||
| 340 | #define AF_IMPLINK 3 | ||
| 341 | #define AF_PUP 4 | ||
| 342 | #define AF_CHAOS 5 | ||
| 343 | #define AF_IPX 6 | ||
| 344 | #define AF_NS 6 | ||
| 345 | #define AF_ISO 7 | ||
| 346 | #define AF_OSI AF_ISO | ||
| 347 | #define AF_ECMA 8 | ||
| 348 | #define AF_DATAKIT 9 | ||
| 349 | #define AF_CCITT 10 | ||
| 350 | #define AF_SNA 11 | ||
| 351 | #define AF_DECnet 12 | ||
| 352 | #define AF_DLI 13 | ||
| 353 | #define AF_LAT 14 | ||
| 354 | #define AF_HYLINK 15 | ||
| 355 | #define AF_APPLETALK 16 | ||
| 356 | #define AF_NETBIOS 17 | ||
| 357 | #define AF_VOICEVIEW 18 | ||
| 358 | #define AF_FIREFOX 19 | ||
| 359 | #define AF_UNKNOWN1 20 | ||
| 360 | #define AF_BAN 21 | ||
| 361 | #define AF_ATM 22 | ||
| 362 | #define AF_INET6 23 | ||
| 363 | #define AF_CLUSTER 24 | ||
| 364 | #define AF_12844 25 | ||
| 365 | #define AF_IRDA 26 | ||
| 366 | #define AF_NETDES 28 | ||
| 367 | |||
| 368 | #ifndef __INSIDE_MSYS__ | ||
| 369 | #define AF_MAX 29 | ||
| 370 | struct sockaddr { | ||
| 371 | u_short sa_family; | ||
| 372 | char sa_data[14]; | ||
| 373 | }; | ||
| 374 | |||
| 375 | /* Portable IPv6/IPv4 version of sockaddr. Based on RFC 2553. | ||
| 376 | Pad to force 8 byte alignment and maximum size of 128 bytes. */ | ||
| 377 | |||
| 378 | /* | ||
| 379 | * Desired design of maximum size and alignment | ||
| 380 | */ | ||
| 381 | #define _SS_MAXSIZE 128 | ||
| 382 | #define _SS_ALIGNSIZE (sizeof (__int64)) | ||
| 383 | /* | ||
| 384 | * Definitions used for sockaddr_storage structure paddings design. | ||
| 385 | */ | ||
| 386 | #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short)) | ||
| 387 | #define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) \ | ||
| 388 | + _SS_PAD1SIZE \ | ||
| 389 | + _SS_ALIGNSIZE)) | ||
| 390 | struct sockaddr_storage { | ||
| 391 | short ss_family; | ||
| 392 | char __ss_pad1[_SS_PAD1SIZE]; /* pad to 8 */ | ||
| 393 | __int64 __ss_align; /* force alignment */ | ||
| 394 | char __ss_pad2[_SS_PAD2SIZE]; /* pad to 128 */ | ||
| 395 | }; | ||
| 396 | #endif /* !__INSIDE_MSYS__ */ | ||
| 397 | |||
| 398 | struct sockproto { | ||
| 399 | u_short sp_family; | ||
| 400 | u_short sp_protocol; | ||
| 401 | }; | ||
| 402 | #define PF_UNSPEC AF_UNSPEC | ||
| 403 | #define PF_UNIX AF_UNIX | ||
| 404 | #define PF_INET AF_INET | ||
| 405 | #define PF_IMPLINK AF_IMPLINK | ||
| 406 | #define PF_PUP AF_PUP | ||
| 407 | #define PF_CHAOS AF_CHAOS | ||
| 408 | #define PF_NS AF_NS | ||
| 409 | #define PF_IPX AF_IPX | ||
| 410 | #define PF_ISO AF_ISO | ||
| 411 | #define PF_OSI AF_OSI | ||
| 412 | #define PF_ECMA AF_ECMA | ||
| 413 | #define PF_DATAKIT AF_DATAKIT | ||
| 414 | #define PF_CCITT AF_CCITT | ||
| 415 | #define PF_SNA AF_SNA | ||
| 416 | #define PF_DECnet AF_DECnet | ||
| 417 | #define PF_DLI AF_DLI | ||
| 418 | #define PF_LAT AF_LAT | ||
| 419 | #define PF_HYLINK AF_HYLINK | ||
| 420 | #define PF_APPLETALK AF_APPLETALK | ||
| 421 | #define PF_VOICEVIEW AF_VOICEVIEW | ||
| 422 | #define PF_FIREFOX AF_FIREFOX | ||
| 423 | #define PF_UNKNOWN1 AF_UNKNOWN1 | ||
| 424 | #define PF_BAN AF_BAN | ||
| 425 | #define PF_ATM AF_ATM | ||
| 426 | #define PF_INET6 AF_INET6 | ||
| 427 | #define PF_MAX AF_MAX | ||
| 428 | #define SOL_SOCKET 0xffff | ||
| 429 | |||
| 430 | #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__)) | ||
| 431 | #define SOMAXCONN 0x7fffffff /* (5) in WinSock1.1 */ | ||
| 432 | #define MSG_OOB 1 | ||
| 433 | #define MSG_PEEK 2 | ||
| 434 | #define MSG_DONTROUTE 4 | ||
| 435 | #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | ||
| 436 | |||
| 437 | #define MSG_MAXIOVLEN 16 | ||
| 438 | #define MSG_PARTIAL 0x8000 | ||
| 439 | #define MAXGETHOSTSTRUCT 1024 | ||
| 440 | |||
| 441 | #define FD_READ_BIT 0 | ||
| 442 | #define FD_READ (1 << FD_READ_BIT) | ||
| 443 | #define FD_WRITE_BIT 1 | ||
| 444 | #define FD_WRITE (1 << FD_WRITE_BIT) | ||
| 445 | #define FD_OOB_BIT 2 | ||
| 446 | #define FD_OOB (1 << FD_OOB_BIT) | ||
| 447 | #define FD_ACCEPT_BIT 3 | ||
| 448 | #define FD_ACCEPT (1 << FD_ACCEPT_BIT) | ||
| 449 | #define FD_CONNECT_BIT 4 | ||
| 450 | #define FD_CONNECT (1 << FD_CONNECT_BIT) | ||
| 451 | #define FD_CLOSE_BIT 5 | ||
| 452 | #define FD_CLOSE (1 << FD_CLOSE_BIT) | ||
| 453 | /* winsock1.1 defines stop at FD_CLOSE (32) */ | ||
| 454 | #define FD_QOS_BIT 6 | ||
| 455 | #define FD_QOS (1 << FD_QOS_BIT) | ||
| 456 | #define FD_GROUP_QOS_BIT 7 | ||
| 457 | #define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT) | ||
| 458 | #define FD_ROUTING_INTERFACE_CHANGE_BIT 8 | ||
| 459 | #define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT) | ||
| 460 | #define FD_ADDRESS_LIST_CHANGE_BIT 9 | ||
| 461 | #define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT) | ||
| 462 | #define FD_MAX_EVENTS 10 | ||
| 463 | #define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1) | ||
| 464 | |||
| 465 | #ifndef WSABASEERR | ||
| 466 | #define WSABASEERR 10000 | ||
| 467 | #define WSAEINTR (WSABASEERR+4) | ||
| 468 | #define WSAEBADF (WSABASEERR+9) | ||
| 469 | #define WSAEACCES (WSABASEERR+13) | ||
| 470 | #define WSAEFAULT (WSABASEERR+14) | ||
| 471 | #define WSAEINVAL (WSABASEERR+22) | ||
| 472 | #define WSAEMFILE (WSABASEERR+24) | ||
| 473 | #define WSAEWOULDBLOCK (WSABASEERR+35) | ||
| 474 | #define WSAEINPROGRESS (WSABASEERR+36) /* deprecated on WinSock2 */ | ||
| 475 | #define WSAEALREADY (WSABASEERR+37) | ||
| 476 | #define WSAENOTSOCK (WSABASEERR+38) | ||
| 477 | #define WSAEDESTADDRREQ (WSABASEERR+39) | ||
| 478 | #define WSAEMSGSIZE (WSABASEERR+40) | ||
| 479 | #define WSAEPROTOTYPE (WSABASEERR+41) | ||
| 480 | #define WSAENOPROTOOPT (WSABASEERR+42) | ||
| 481 | #define WSAEPROTONOSUPPORT (WSABASEERR+43) | ||
| 482 | #define WSAESOCKTNOSUPPORT (WSABASEERR+44) | ||
| 483 | #define WSAEOPNOTSUPP (WSABASEERR+45) | ||
| 484 | #define WSAEPFNOSUPPORT (WSABASEERR+46) | ||
| 485 | #define WSAEAFNOSUPPORT (WSABASEERR+47) | ||
| 486 | #define WSAEADDRINUSE (WSABASEERR+48) | ||
| 487 | #define WSAEADDRNOTAVAIL (WSABASEERR+49) | ||
| 488 | #define WSAENETDOWN (WSABASEERR+50) | ||
| 489 | #define WSAENETUNREACH (WSABASEERR+51) | ||
| 490 | #define WSAENETRESET (WSABASEERR+52) | ||
| 491 | #define WSAECONNABORTED (WSABASEERR+53) | ||
| 492 | #define WSAECONNRESET (WSABASEERR+54) | ||
| 493 | #define WSAENOBUFS (WSABASEERR+55) | ||
| 494 | #define WSAEISCONN (WSABASEERR+56) | ||
| 495 | #define WSAENOTCONN (WSABASEERR+57) | ||
| 496 | #define WSAESHUTDOWN (WSABASEERR+58) | ||
| 497 | #define WSAETOOMANYREFS (WSABASEERR+59) | ||
| 498 | #define WSAETIMEDOUT (WSABASEERR+60) | ||
| 499 | #define WSAECONNREFUSED (WSABASEERR+61) | ||
| 500 | #define WSAELOOP (WSABASEERR+62) | ||
| 501 | #define WSAENAMETOOLONG (WSABASEERR+63) | ||
| 502 | #define WSAEHOSTDOWN (WSABASEERR+64) | ||
| 503 | #define WSAEHOSTUNREACH (WSABASEERR+65) | ||
| 504 | #define WSAENOTEMPTY (WSABASEERR+66) | ||
| 505 | #define WSAEPROCLIM (WSABASEERR+67) | ||
| 506 | #define WSAEUSERS (WSABASEERR+68) | ||
| 507 | #define WSAEDQUOT (WSABASEERR+69) | ||
| 508 | #define WSAESTALE (WSABASEERR+70) | ||
| 509 | #define WSAEREMOTE (WSABASEERR+71) | ||
| 510 | #define WSAEDISCON (WSABASEERR+101) | ||
| 511 | #define WSASYSNOTREADY (WSABASEERR+91) | ||
| 512 | #define WSAVERNOTSUPPORTED (WSABASEERR+92) | ||
| 513 | #define WSANOTINITIALISED (WSABASEERR+93) | ||
| 514 | #define WSAHOST_NOT_FOUND (WSABASEERR+1001) | ||
| 515 | #define WSATRY_AGAIN (WSABASEERR+1002) | ||
| 516 | #define WSANO_RECOVERY (WSABASEERR+1003) | ||
| 517 | #define WSANO_DATA (WSABASEERR+1004) | ||
| 518 | |||
| 519 | /* WinSock2 specific error codes */ | ||
| 520 | #define WSAENOMORE (WSABASEERR+102) | ||
| 521 | #define WSAECANCELLED (WSABASEERR+103) | ||
| 522 | #define WSAEINVALIDPROCTABLE (WSABASEERR+104) | ||
| 523 | #define WSAEINVALIDPROVIDER (WSABASEERR+105) | ||
| 524 | #define WSAEPROVIDERFAILEDINIT (WSABASEERR+106) | ||
| 525 | #define WSASYSCALLFAILURE (WSABASEERR+107) | ||
| 526 | #define WSASERVICE_NOT_FOUND (WSABASEERR+108) | ||
| 527 | #define WSATYPE_NOT_FOUND (WSABASEERR+109) | ||
| 528 | #define WSA_E_NO_MORE (WSABASEERR+110) | ||
| 529 | #define WSA_E_CANCELLED (WSABASEERR+111) | ||
| 530 | #define WSAEREFUSED (WSABASEERR+112) | ||
| 531 | |||
| 532 | /* WS QualityofService errors */ | ||
| 533 | #define WSA_QOS_RECEIVERS (WSABASEERR + 1005) | ||
| 534 | #define WSA_QOS_SENDERS (WSABASEERR + 1006) | ||
| 535 | #define WSA_QOS_NO_SENDERS (WSABASEERR + 1007) | ||
| 536 | #define WSA_QOS_NO_RECEIVERS (WSABASEERR + 1008) | ||
| 537 | #define WSA_QOS_REQUEST_CONFIRMED (WSABASEERR + 1009) | ||
| 538 | #define WSA_QOS_ADMISSION_FAILURE (WSABASEERR + 1010) | ||
| 539 | #define WSA_QOS_POLICY_FAILURE (WSABASEERR + 1011) | ||
| 540 | #define WSA_QOS_BAD_STYLE (WSABASEERR + 1012) | ||
| 541 | #define WSA_QOS_BAD_OBJECT (WSABASEERR + 1013) | ||
| 542 | #define WSA_QOS_TRAFFIC_CTRL_ERROR (WSABASEERR + 1014) | ||
| 543 | #define WSA_QOS_GENERIC_ERROR (WSABASEERR + 1015) | ||
| 544 | #define WSA_QOS_ESERVICETYPE (WSABASEERR + 1016) | ||
| 545 | #define WSA_QOS_EFLOWSPEC (WSABASEERR + 1017) | ||
| 546 | #define WSA_QOS_EPROVSPECBUF (WSABASEERR + 1018) | ||
| 547 | #define WSA_QOS_EFILTERSTYLE (WSABASEERR + 1019) | ||
| 548 | #define WSA_QOS_EFILTERTYPE (WSABASEERR + 1020) | ||
| 549 | #define WSA_QOS_EFILTERCOUNT (WSABASEERR + 1021) | ||
| 550 | #define WSA_QOS_EOBJLENGTH (WSABASEERR + 1022) | ||
| 551 | #define WSA_QOS_EFLOWCOUNT (WSABASEERR + 1023) | ||
| 552 | #define WSA_QOS_EUNKOWNPSOBJ (WSABASEERR + 1024) | ||
| 553 | #define WSA_QOS_EPOLICYOBJ (WSABASEERR + 1025) | ||
| 554 | #define WSA_QOS_EFLOWDESC (WSABASEERR + 1026) | ||
| 555 | #define WSA_QOS_EPSFLOWSPEC (WSABASEERR + 1027) | ||
| 556 | #define WSA_QOS_EPSFILTERSPEC (WSABASEERR + 1028) | ||
| 557 | #define WSA_QOS_ESDMODEOBJ (WSABASEERR + 1029) | ||
| 558 | #define WSA_QOS_ESHAPERATEOBJ (WSABASEERR + 1030) | ||
| 559 | #define WSA_QOS_RESERVED_PETYPE (WSABASEERR + 1031) | ||
| 560 | |||
| 561 | #endif /* !WSABASEERR */ | ||
| 562 | |||
| 563 | #define WSANO_ADDRESS WSANO_DATA | ||
| 564 | |||
| 565 | #if !(defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__)) | ||
| 566 | #define h_errno WSAGetLastError() | ||
| 567 | #define HOST_NOT_FOUND WSAHOST_NOT_FOUND | ||
| 568 | #define TRY_AGAIN WSATRY_AGAIN | ||
| 569 | #define NO_RECOVERY WSANO_RECOVERY | ||
| 570 | #define NO_DATA WSANO_DATA | ||
| 571 | #define NO_ADDRESS WSANO_ADDRESS | ||
| 572 | #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | ||
| 573 | |||
| 574 | WINSOCK_API_LINKAGE SOCKET PASCAL accept(SOCKET,struct sockaddr*,int*); | ||
| 575 | WINSOCK_API_LINKAGE int PASCAL bind(SOCKET,const struct sockaddr*,int); | ||
| 576 | WINSOCK_API_LINKAGE int PASCAL closesocket(SOCKET); | ||
| 577 | WINSOCK_API_LINKAGE int PASCAL connect(SOCKET,const struct sockaddr*,int); | ||
| 578 | WINSOCK_API_LINKAGE int PASCAL ioctlsocket(SOCKET,long,u_long *); | ||
| 579 | WINSOCK_API_LINKAGE int PASCAL getpeername(SOCKET,struct sockaddr*,int*); | ||
| 580 | WINSOCK_API_LINKAGE int PASCAL getsockname(SOCKET,struct sockaddr*,int*); | ||
| 581 | WINSOCK_API_LINKAGE int PASCAL getsockopt(SOCKET,int,int,char*,int*); | ||
| 582 | WINSOCK_API_LINKAGE unsigned long PASCAL inet_addr(const char*); | ||
| 583 | WINSOCK_API_LINKAGE DECLARE_STDCALL_P(char *) inet_ntoa(struct in_addr); | ||
| 584 | WINSOCK_API_LINKAGE int PASCAL listen(SOCKET,int); | ||
| 585 | WINSOCK_API_LINKAGE int PASCAL recv(SOCKET,char*,int,int); | ||
| 586 | WINSOCK_API_LINKAGE int PASCAL recvfrom(SOCKET,char*,int,int,struct sockaddr*,int*); | ||
| 587 | WINSOCK_API_LINKAGE int PASCAL send(SOCKET,const char*,int,int); | ||
| 588 | WINSOCK_API_LINKAGE int PASCAL sendto(SOCKET,const char*,int,int,const struct sockaddr*,int); | ||
| 589 | WINSOCK_API_LINKAGE int PASCAL setsockopt(SOCKET,int,int,const char*,int); | ||
| 590 | WINSOCK_API_LINKAGE int PASCAL shutdown(SOCKET,int); | ||
| 591 | WINSOCK_API_LINKAGE SOCKET PASCAL socket(int,int,int); | ||
| 592 | WINSOCK_API_LINKAGE DECLARE_STDCALL_P(struct hostent *) gethostbyaddr(const char*,int,int); | ||
| 593 | WINSOCK_API_LINKAGE DECLARE_STDCALL_P(struct hostent *) gethostbyname(const char*); | ||
| 594 | WINSOCK_API_LINKAGE DECLARE_STDCALL_P(struct servent *) getservbyport(int,const char*); | ||
| 595 | WINSOCK_API_LINKAGE DECLARE_STDCALL_P(struct servent *) getservbyname(const char*,const char*); | ||
| 596 | WINSOCK_API_LINKAGE DECLARE_STDCALL_P(struct protoent *) getprotobynumber(int); | ||
| 597 | WINSOCK_API_LINKAGE DECLARE_STDCALL_P(struct protoent *) getprotobyname(const char*); | ||
| 598 | typedef SOCKET (PASCAL * LPFN_ACCEPT)(SOCKET, struct sockaddr*,int *); | ||
| 599 | typedef int (PASCAL * LPFN_BIND)(SOCKET, const struct sockaddr*,int); | ||
| 600 | typedef int (PASCAL * LPFN_CLOSESOCKET)(SOCKET); | ||
| 601 | typedef int (PASCAL * LPFN_CONNECT)(SOCKET, const struct sockaddr*,int); | ||
| 602 | typedef int (PASCAL * LPFN_IOCTLSOCKET)(SOCKET, long, u_long*); | ||
| 603 | typedef int (PASCAL * LPFN_GETPEERNAME)(SOCKET, struct sockaddr*, int*); | ||
| 604 | typedef int(PASCAL * LPFN_GETSOCKNAME)(SOCKET, struct sockaddr*, int*); | ||
| 605 | typedef int(PASCAL * LPFN_GETSOCKOPT)(SOCKET, int, int, char*, int*); | ||
| 606 | typedef u_long(PASCAL * LPFN_HTONL)(u_long); | ||
| 607 | typedef u_short(PASCAL * LPFN_HTONS)(u_short); | ||
| 608 | typedef unsigned long(PASCAL * LPFN_INET_ADDR)(const char*); | ||
| 609 | typedef char*(PASCAL * LPFN_INET_NTOA)(struct in_addr); | ||
| 610 | typedef int(PASCAL * LPFN_LISTEN)(SOCKET, int); | ||
| 611 | typedef u_long(PASCAL * LPFN_NTOHL)(u_long); | ||
| 612 | typedef u_short(PASCAL * LPFN_NTOHS)(u_short); | ||
| 613 | typedef int(PASCAL * LPFN_RECV)(SOCKET, char*, int, int); | ||
| 614 | typedef int(PASCAL * LPFN_RECVFROM)(SOCKET, char*, int, int, struct sockaddr*, int*); | ||
| 615 | typedef int(PASCAL * LPFN_SELECT)(int, fd_set*, fd_set*, fd_set*, const struct timeval*); | ||
| 616 | typedef int(PASCAL * LPFN_SEND)(SOCKET, const char*, int, int); | ||
| 617 | typedef int(PASCAL * LPFN_SENDTO)(SOCKET, const char*, int, int, const struct sockaddr*, int); | ||
| 618 | typedef int(PASCAL * LPFN_SETSOCKOPT)(SOCKET, int, int, const char*, int); | ||
| 619 | typedef int(PASCAL * LPFN_SHUTDOWN)(SOCKET, int); | ||
| 620 | typedef SOCKET(PASCAL * LPFN_SOCKET)(int, int, int); | ||
| 621 | typedef struct hostent*(PASCAL * LPFN_GETHOSTBYADDR)( const char*, int, int); | ||
| 622 | typedef struct hostent*(PASCAL * LPFN_GETHOSTBYNAME)( const char*); | ||
| 623 | typedef int(PASCAL * LPFN_GETHOSTNAME)(char*, int); | ||
| 624 | typedef struct servent*(PASCAL * LPFN_GETSERVBYPORT)(int, const char*); | ||
| 625 | typedef struct servent*(PASCAL * LPFN_GETSERVBYNAME)(const char*, const char*); | ||
| 626 | typedef struct protoent*(PASCAL * LPFN_GETPROTOBYNUMBER)(int); | ||
| 627 | typedef struct protoent*(PASCAL * LPFN_GETPROTOBYNAME)(const char*); | ||
| 628 | |||
| 629 | WINSOCK_API_LINKAGE int PASCAL WSAStartup(WORD,LPWSADATA); | ||
| 630 | WINSOCK_API_LINKAGE int PASCAL WSACleanup(void); | ||
| 631 | WINSOCK_API_LINKAGE void PASCAL WSASetLastError(int); | ||
| 632 | WINSOCK_API_LINKAGE int PASCAL WSAGetLastError(void); | ||
| 633 | WINSOCK_API_LINKAGE typedef int(PASCAL * LPFN_WSASTARTUP)(WORD, LPWSADATA); | ||
| 634 | typedef int(PASCAL * LPFN_WSACLEANUP)(void); | ||
| 635 | typedef void(PASCAL * LPFN_WSASETLASTERROR)(int); | ||
| 636 | typedef int(PASCAL * LPFN_WSAGETLASTERROR)(void); | ||
| 637 | /* | ||
| 638 | * Pseudo-blocking functions are deprecated in WinSock2 | ||
| 639 | * spec. Use threads instead. | ||
| 640 | */ | ||
| 641 | WINSOCK_API_LINKAGE BOOL PASCAL WSAIsBlocking(void); | ||
| 642 | WINSOCK_API_LINKAGE int PASCAL WSAUnhookBlockingHook(void); | ||
| 643 | WINSOCK_API_LINKAGE FARPROC PASCAL WSASetBlockingHook(FARPROC); | ||
| 644 | WINSOCK_API_LINKAGE int PASCAL WSACancelBlockingCall(void); | ||
| 645 | typedef BOOL(PASCAL * LPFN_WSAISBLOCKING)(void); | ||
| 646 | typedef int(PASCAL * LPFN_WSAUNHOOKBLOCKINGHOOK)(void); | ||
| 647 | typedef FARPROC (PASCAL * LPFN_WSASETBLOCKINGHOOK)(FARPROC); | ||
| 648 | typedef int(PASCAL * LPFN_WSACANCELBLOCKINGCALL)(void); | ||
| 649 | |||
| 650 | WINSOCK_API_LINKAGE HANDLE PASCAL WSAAsyncGetServByName(HWND,u_int,const char*,const char*,char*,int); | ||
| 651 | WINSOCK_API_LINKAGE HANDLE PASCAL WSAAsyncGetServByPort(HWND,u_int,int,const char*,char*,int); | ||
| 652 | WINSOCK_API_LINKAGE HANDLE PASCAL WSAAsyncGetProtoByName(HWND,u_int,const char*,char*,int); | ||
| 653 | WINSOCK_API_LINKAGE HANDLE PASCAL WSAAsyncGetProtoByNumber(HWND,u_int,int,char*,int); | ||
| 654 | WINSOCK_API_LINKAGE HANDLE PASCAL WSAAsyncGetHostByName(HWND,u_int,const char*,char*,int); | ||
| 655 | WINSOCK_API_LINKAGE HANDLE PASCAL WSAAsyncGetHostByAddr(HWND,u_int,const char*,int,int,char*,int); | ||
| 656 | WINSOCK_API_LINKAGE int PASCAL WSACancelAsyncRequest(HANDLE); | ||
| 657 | WINSOCK_API_LINKAGE int PASCAL WSAAsyncSelect(SOCKET,HWND,u_int,long); | ||
| 658 | typedef HANDLE(PASCAL * LPFN_WSAASYNCGETSERVBYNAME)(HWND, u_int, const char *, const char *, char *, int); | ||
| 659 | typedef HANDLE(PASCAL * LPFN_WSAASYNCGETSERVBYPORT)(HWND, u_int, int, const char *, char *, int); | ||
| 660 | typedef HANDLE(PASCAL * LPFN_WSAASYNCGETPROTOBYNAME)(HWND, u_int, const char*, char*, int); | ||
| 661 | typedef HANDLE(PASCAL * LPFN_WSAASYNCGETPROTOBYNUMBER)(HWND, u_int, int, char*, int); | ||
| 662 | typedef HANDLE(PASCAL * LPFN_WSAASYNCGETHOSTBYADDR)(HWND, u_int, const char*, int, int, char*, int); | ||
| 663 | typedef int(PASCAL * LPFN_WSACANCELASYNCREQUEST)(HANDLE); | ||
| 664 | typedef int(PASCAL * LPFN_WSAASYNCSELECT)(SOCKET, HWND, u_int, long); | ||
| 665 | |||
| 666 | #if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__)) | ||
| 667 | WINSOCK_API_LINKAGE u_long PASCAL htonl(u_long); | ||
| 668 | WINSOCK_API_LINKAGE u_long PASCAL ntohl(u_long); | ||
| 669 | WINSOCK_API_LINKAGE u_short PASCAL htons(u_short); | ||
| 670 | WINSOCK_API_LINKAGE u_short PASCAL ntohs(u_short); | ||
| 671 | WINSOCK_API_LINKAGE int PASCAL select(int nfds,fd_set*,fd_set*,fd_set*,const struct timeval*); | ||
| 672 | #endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | ||
| 673 | |||
| 674 | int PASCAL gethostname(char*,int); | ||
| 675 | |||
| 676 | #define WSAMAKEASYNCREPLY(b,e) MAKELONG(b,e) | ||
| 677 | #define WSAMAKESELECTREPLY(e,error) MAKELONG(e,error) | ||
| 678 | #define WSAGETASYNCBUFLEN(l) LOWORD(l) | ||
| 679 | #define WSAGETASYNCERROR(l) HIWORD(l) | ||
| 680 | #define WSAGETSELECTEVENT(l) LOWORD(l) | ||
| 681 | #define WSAGETSELECTERROR(l) HIWORD(l) | ||
| 682 | |||
| 683 | typedef struct sockaddr SOCKADDR; | ||
| 684 | typedef struct sockaddr *PSOCKADDR; | ||
| 685 | typedef struct sockaddr *LPSOCKADDR; | ||
| 686 | typedef struct sockaddr_storage SOCKADDR_STORAGE, *PSOCKADDR_STORAGE; | ||
| 687 | typedef struct sockaddr_in SOCKADDR_IN; | ||
| 688 | typedef struct sockaddr_in *PSOCKADDR_IN; | ||
| 689 | typedef struct sockaddr_in *LPSOCKADDR_IN; | ||
| 690 | typedef struct linger LINGER; | ||
| 691 | typedef struct linger *PLINGER; | ||
| 692 | typedef struct linger *LPLINGER; | ||
| 693 | typedef struct in_addr IN_ADDR; | ||
| 694 | typedef struct in_addr *PIN_ADDR; | ||
| 695 | typedef struct in_addr *LPIN_ADDR; | ||
| 696 | typedef struct fd_set FD_SET; | ||
| 697 | typedef struct fd_set *PFD_SET; | ||
| 698 | typedef struct fd_set *LPFD_SET; | ||
| 699 | typedef struct hostent HOSTENT; | ||
| 700 | typedef struct hostent *PHOSTENT; | ||
| 701 | typedef struct hostent *LPHOSTENT; | ||
| 702 | typedef struct servent SERVENT; | ||
| 703 | typedef struct servent *PSERVENT; | ||
| 704 | typedef struct servent *LPSERVENT; | ||
| 705 | typedef struct protoent PROTOENT; | ||
| 706 | typedef struct protoent *PPROTOENT; | ||
| 707 | typedef struct protoent *LPPROTOENT; | ||
| 708 | typedef struct timeval TIMEVAL; | ||
| 709 | typedef struct timeval *PTIMEVAL; | ||
| 710 | typedef struct timeval *LPTIMEVAL; | ||
| 711 | |||
| 712 | /* winsock2 additions */ | ||
| 713 | #define ADDR_ANY INADDR_ANY | ||
| 714 | |||
| 715 | #define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) | ||
| 716 | #define IN_CLASSD_NET 0xf0000000 | ||
| 717 | #define IN_CLASSD_NSHIFT 28 | ||
| 718 | #define IN_CLASSD_HOST 0x0fffffff | ||
| 719 | #define IN_MULTICAST(i) IN_CLASSD(i) | ||
| 720 | |||
| 721 | #define FROM_PROTOCOL_INFO (-1) | ||
| 722 | |||
| 723 | #define SO_DONTLINGER (u_int)(~SO_LINGER) | ||
| 724 | #define SO_GROUP_ID 0x2001 | ||
| 725 | #define SO_GROUP_PRIORITY 0x2002 | ||
| 726 | #define SO_MAX_MSG_SIZE 0x2003 | ||
| 727 | #define SO_PROTOCOL_INFOA 0x2004 | ||
| 728 | #define SO_PROTOCOL_INFOW 0x2005 | ||
| 729 | |||
| 730 | #define SO_PROTOCOL_INFO __AW(SO_PROTOCOL_INFO) | ||
| 731 | |||
| 732 | #define PVD_CONFIG 0x3001 | ||
| 733 | |||
| 734 | #define MSG_INTERRUPT 0x10 | ||
| 735 | #define MSG_MAXIOVLEN 16 | ||
| 736 | |||
| 737 | #define WSAAPI WINAPI | ||
| 738 | #define WSAEVENT HANDLE | ||
| 739 | #define LPWSAEVENT LPHANDLE | ||
| 740 | #define WSAOVERLAPPED OVERLAPPED | ||
| 741 | typedef struct _OVERLAPPED *LPWSAOVERLAPPED; | ||
| 742 | |||
| 743 | #define WSA_IO_PENDING (ERROR_IO_PENDING) | ||
| 744 | #define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE) | ||
| 745 | #define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE) | ||
| 746 | #define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER) | ||
| 747 | #define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY) | ||
| 748 | #define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED) | ||
| 749 | |||
| 750 | #define WSA_INVALID_EVENT ((WSAEVENT)NULL) | ||
| 751 | #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS) | ||
| 752 | #define WSA_WAIT_FAILED ((DWORD)-1L) | ||
| 753 | #define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0) | ||
| 754 | #define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION) | ||
| 755 | #define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT) | ||
| 756 | #define WSA_INFINITE (INFINITE) | ||
| 757 | |||
| 758 | typedef struct _WSABUF { | ||
| 759 | unsigned long len; | ||
| 760 | char *buf; | ||
| 761 | } WSABUF, *LPWSABUF; | ||
| 762 | |||
| 763 | typedef enum | ||
| 764 | { | ||
| 765 | BestEffortService, | ||
| 766 | ControlledLoadService, | ||
| 767 | PredictiveService, | ||
| 768 | GuaranteedDelayService, | ||
| 769 | GuaranteedService | ||
| 770 | } GUARANTEE; | ||
| 771 | |||
| 772 | /* TODO: FLOWSPEC and related definitions belong in qos.h */ | ||
| 773 | |||
| 774 | /* | ||
| 775 | Windows Sockets 2 Application Programming Interface, | ||
| 776 | revision 2.2.2 (1997) uses the type uint32 for SERVICETYPE | ||
| 777 | and the elements of _flowspec, but the type uint32 is not defined | ||
| 778 | or used anywhere else in the w32api. For now, just use | ||
| 779 | unsigned int, which is 32 bits on _WIN32 and _WIN64. | ||
| 780 | */ | ||
| 781 | |||
| 782 | typedef unsigned int SERVICETYPE; | ||
| 783 | typedef struct _flowspec | ||
| 784 | { | ||
| 785 | unsigned int TokenRate; | ||
| 786 | unsigned int TokenBucketSize; | ||
| 787 | unsigned int PeakBandwidth; | ||
| 788 | unsigned int Latency; | ||
| 789 | unsigned int DelayVariation; | ||
| 790 | SERVICETYPE ServiceType; | ||
| 791 | unsigned int MaxSduSize; | ||
| 792 | unsigned int MinimumPolicedSize; | ||
| 793 | } FLOWSPEC, *PFLOWSPEC, *LPFLOWSPEC; | ||
| 794 | |||
| 795 | typedef struct _QualityOfService | ||
| 796 | { | ||
| 797 | FLOWSPEC SendingFlowspec; | ||
| 798 | FLOWSPEC ReceivingFlowspec; | ||
| 799 | WSABUF ProviderSpecific; | ||
| 800 | } QOS, *LPQOS; | ||
| 801 | |||
| 802 | #define CF_ACCEPT 0x0000 | ||
| 803 | #define CF_REJECT 0x0001 | ||
| 804 | #define CF_DEFER 0x0002 | ||
| 805 | #define SD_RECEIVE 0x00 | ||
| 806 | #define SD_SEND 0x01 | ||
| 807 | #define SD_BOTH 0x02 | ||
| 808 | typedef unsigned int GROUP; | ||
| 809 | |||
| 810 | #define SG_UNCONSTRAINED_GROUP 0x01 | ||
| 811 | #define SG_CONSTRAINED_GROUP 0x02 | ||
| 812 | typedef struct _WSANETWORKEVENTS { | ||
| 813 | long lNetworkEvents; | ||
| 814 | int iErrorCode[FD_MAX_EVENTS]; | ||
| 815 | } WSANETWORKEVENTS, *LPWSANETWORKEVENTS; | ||
| 816 | |||
| 817 | #define MAX_PROTOCOL_CHAIN 7 | ||
| 818 | |||
| 819 | #define BASE_PROTOCOL 1 | ||
| 820 | #define LAYERED_PROTOCOL 0 | ||
| 821 | |||
| 822 | typedef enum _WSAESETSERVICEOP | ||
| 823 | { | ||
| 824 | RNRSERVICE_REGISTER=0, | ||
| 825 | RNRSERVICE_DEREGISTER, | ||
| 826 | RNRSERVICE_DELETE | ||
| 827 | } WSAESETSERVICEOP, *PWSAESETSERVICEOP, *LPWSAESETSERVICEOP; | ||
| 828 | |||
| 829 | typedef struct _AFPROTOCOLS { | ||
| 830 | INT iAddressFamily; | ||
| 831 | INT iProtocol; | ||
| 832 | } AFPROTOCOLS, *PAFPROTOCOLS, *LPAFPROTOCOLS; | ||
| 833 | |||
| 834 | typedef enum _WSAEcomparator | ||
| 835 | { | ||
| 836 | COMP_EQUAL = 0, | ||
| 837 | COMP_NOTLESS | ||
| 838 | } WSAECOMPARATOR, *PWSAECOMPARATOR, *LPWSAECOMPARATOR; | ||
| 839 | |||
| 840 | typedef struct _WSAVersion | ||
| 841 | { | ||
| 842 | DWORD dwVersion; | ||
| 843 | WSAECOMPARATOR ecHow; | ||
| 844 | } WSAVERSION, *PWSAVERSION, *LPWSAVERSION; | ||
| 845 | |||
| 846 | #ifndef __CSADDR_T_DEFINED /* also in nspapi.h */ | ||
| 847 | #define __CSADDR_T_DEFINED | ||
| 848 | typedef struct _SOCKET_ADDRESS { | ||
| 849 | LPSOCKADDR lpSockaddr; | ||
| 850 | INT iSockaddrLength; | ||
| 851 | } SOCKET_ADDRESS,*PSOCKET_ADDRESS,*LPSOCKET_ADDRESS; | ||
| 852 | typedef struct _CSADDR_INFO { | ||
| 853 | SOCKET_ADDRESS LocalAddr; | ||
| 854 | SOCKET_ADDRESS RemoteAddr; | ||
| 855 | INT iSocketType; | ||
| 856 | INT iProtocol; | ||
| 857 | } CSADDR_INFO,*PCSADDR_INFO,*LPCSADDR_INFO; | ||
| 858 | #endif | ||
| 859 | |||
| 860 | typedef struct _SOCKET_ADDRESS_LIST { | ||
| 861 | INT iAddressCount; | ||
| 862 | SOCKET_ADDRESS Address[1]; | ||
| 863 | } SOCKET_ADDRESS_LIST, * LPSOCKET_ADDRESS_LIST; | ||
| 864 | |||
| 865 | #ifndef __BLOB_T_DEFINED /* also in wtypes.h and nspapi.h */ | ||
| 866 | #define __BLOB_T_DEFINED | ||
| 867 | typedef struct _BLOB { | ||
| 868 | ULONG cbSize; | ||
| 869 | BYTE *pBlobData; | ||
| 870 | } BLOB,*PBLOB,*LPBLOB; | ||
| 871 | #endif | ||
| 872 | |||
| 873 | typedef struct _WSAQuerySetA | ||
| 874 | { | ||
| 875 | DWORD dwSize; | ||
| 876 | LPSTR lpszServiceInstanceName; | ||
| 877 | LPGUID lpServiceClassId; | ||
| 878 | LPWSAVERSION lpVersion; | ||
| 879 | LPSTR lpszComment; | ||
| 880 | DWORD dwNameSpace; | ||
| 881 | LPGUID lpNSProviderId; | ||
| 882 | LPSTR lpszContext; | ||
| 883 | DWORD dwNumberOfProtocols; | ||
| 884 | LPAFPROTOCOLS lpafpProtocols; | ||
| 885 | LPSTR lpszQueryString; | ||
| 886 | DWORD dwNumberOfCsAddrs; | ||
| 887 | LPCSADDR_INFO lpcsaBuffer; | ||
| 888 | DWORD dwOutputFlags; | ||
| 889 | LPBLOB lpBlob; | ||
| 890 | } WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA; | ||
| 891 | |||
| 892 | typedef struct _WSAQuerySetW | ||
| 893 | { | ||
| 894 | DWORD dwSize; | ||
| 895 | LPWSTR lpszServiceInstanceName; | ||
| 896 | LPGUID lpServiceClassId; | ||
| 897 | LPWSAVERSION lpVersion; | ||
| 898 | LPWSTR lpszComment; | ||
| 899 | DWORD dwNameSpace; | ||
| 900 | LPGUID lpNSProviderId; | ||
| 901 | LPWSTR lpszContext; | ||
| 902 | DWORD dwNumberOfProtocols; | ||
| 903 | LPAFPROTOCOLS lpafpProtocols; | ||
| 904 | LPWSTR lpszQueryString; | ||
| 905 | DWORD dwNumberOfCsAddrs; | ||
| 906 | LPCSADDR_INFO lpcsaBuffer; | ||
| 907 | DWORD dwOutputFlags; | ||
| 908 | LPBLOB lpBlob; | ||
| 909 | } WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW; | ||
| 910 | |||
| 911 | //!! | ||
| 912 | #define __AW__(AW, AW_) AW ## AW_ | ||
| 913 | #define __AW(AW) __AW__(AW, W) | ||
| 914 | #define __STR(AW) __AW__(L, AW) | ||
| 915 | |||
| 916 | typedef __AW(WSAQUERYSET) WSAQUERYSET; | ||
| 917 | typedef __AW(PWSAQUERYSET) PWSAQUERYSET; | ||
| 918 | typedef __AW(LPWSAQUERYSET) LPWSAQUERYSET; | ||
| 919 | |||
| 920 | #define LUP_DEEP 0x0001 | ||
| 921 | #define LUP_CONTAINERS 0x0002 | ||
| 922 | #define LUP_NOCONTAINERS 0x0004 | ||
| 923 | #define LUP_NEAREST 0x0008 | ||
| 924 | #define LUP_RETURN_NAME 0x0010 | ||
| 925 | #define LUP_RETURN_TYPE 0x0020 | ||
| 926 | #define LUP_RETURN_VERSION 0x0040 | ||
| 927 | #define LUP_RETURN_COMMENT 0x0080 | ||
| 928 | #define LUP_RETURN_ADDR 0x0100 | ||
| 929 | #define LUP_RETURN_BLOB 0x0200 | ||
| 930 | #define LUP_RETURN_ALIASES 0x0400 | ||
| 931 | #define LUP_RETURN_QUERY_STRING 0x0800 | ||
| 932 | #define LUP_RETURN_ALL 0x0FF0 | ||
| 933 | #define LUP_RES_SERVICE 0x8000 | ||
| 934 | #define LUP_FLUSHCACHE 0x1000 | ||
| 935 | #define LUP_FLUSHPREVIOUS 0x2000 | ||
| 936 | |||
| 937 | typedef struct _WSANSClassInfoA | ||
| 938 | { | ||
| 939 | LPSTR lpszName; | ||
| 940 | DWORD dwNameSpace; | ||
| 941 | DWORD dwValueType; | ||
| 942 | DWORD dwValueSize; | ||
| 943 | LPVOID lpValue; | ||
| 944 | } WSANSCLASSINFOA, *PWSANSCLASSINFOA, *LPWSANSCLASSINFOA; | ||
| 945 | |||
| 946 | typedef struct _WSANSClassInfoW | ||
| 947 | { | ||
| 948 | LPWSTR lpszName; | ||
| 949 | DWORD dwNameSpace; | ||
| 950 | DWORD dwValueType; | ||
| 951 | DWORD dwValueSize; | ||
| 952 | LPVOID lpValue; | ||
| 953 | } WSANSCLASSINFOW, *PWSANSCLASSINFOW, *LPWSANSCLASSINFOW; | ||
| 954 | |||
| 955 | typedef __AW(WSANSCLASSINFO) WSANSCLASSINFO; | ||
| 956 | typedef __AW(PWSANSCLASSINFO) PWSANSCLASSINFO; | ||
| 957 | typedef __AW(LPWSANSCLASSINFO) LPWSANSCLASSINFO; | ||
| 958 | |||
| 959 | typedef struct _WSAServiceClassInfoA | ||
| 960 | { | ||
| 961 | LPGUID lpServiceClassId; | ||
| 962 | LPSTR lpszServiceClassName; | ||
| 963 | DWORD dwCount; | ||
| 964 | LPWSANSCLASSINFOA lpClassInfos; | ||
| 965 | } WSASERVICECLASSINFOA, *PWSASERVICECLASSINFOA, *LPWSASERVICECLASSINFOA; | ||
| 966 | |||
| 967 | typedef struct _WSAServiceClassInfoW | ||
| 968 | { | ||
| 969 | LPGUID lpServiceClassId; | ||
| 970 | LPWSTR lpszServiceClassName; | ||
| 971 | DWORD dwCount; | ||
| 972 | LPWSANSCLASSINFOW lpClassInfos; | ||
| 973 | } WSASERVICECLASSINFOW, *PWSASERVICECLASSINFOW, *LPWSASERVICECLASSINFOW; | ||
| 974 | |||
| 975 | typedef __AW(WSASERVICECLASSINFO) WSASERVICECLASSINFO; | ||
| 976 | typedef __AW(PWSASERVICECLASSINFO) PWSASERVICECLASSINFO; | ||
| 977 | typedef __AW(LPWSASERVICECLASSINFO) LPWSASERVICECLASSINFO; | ||
| 978 | |||
| 979 | typedef struct _WSANAMESPACE_INFOA { | ||
| 980 | GUID NSProviderId; | ||
| 981 | DWORD dwNameSpace; | ||
| 982 | BOOL fActive; | ||
| 983 | DWORD dwVersion; | ||
| 984 | LPSTR lpszIdentifier; | ||
| 985 | } WSANAMESPACE_INFOA, *PWSANAMESPACE_INFOA, *LPWSANAMESPACE_INFOA; | ||
| 986 | |||
| 987 | typedef struct _WSANAMESPACE_INFOW { | ||
| 988 | GUID NSProviderId; | ||
| 989 | DWORD dwNameSpace; | ||
| 990 | BOOL fActive; | ||
| 991 | DWORD dwVersion; | ||
| 992 | LPWSTR lpszIdentifier; | ||
| 993 | } WSANAMESPACE_INFOW, *PWSANAMESPACE_INFOW, *LPWSANAMESPACE_INFOW; | ||
| 994 | |||
| 995 | typedef __AW(WSANAMESPACE_INFO) WSANAMESPACE_INFO; | ||
| 996 | typedef __AW(PWSANAMESPACE_INFO) PWSANAMESPACE_INFO; | ||
| 997 | typedef __AW(LPWSANAMESPACE_INFO) LPWSANAMESPACE_INFO; | ||
| 998 | |||
| 999 | typedef struct _WSAPROTOCOLCHAIN { | ||
| 1000 | int ChainLen; | ||
| 1001 | DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; | ||
| 1002 | } WSAPROTOCOLCHAIN, *LPWSAPROTOCOLCHAIN; | ||
| 1003 | |||
| 1004 | #define WSAPROTOCOL_LEN 255 | ||
| 1005 | |||
| 1006 | typedef struct _WSAPROTOCOL_INFOA { | ||
| 1007 | DWORD dwServiceFlags1; | ||
| 1008 | DWORD dwServiceFlags2; | ||
| 1009 | DWORD dwServiceFlags3; | ||
| 1010 | DWORD dwServiceFlags4; | ||
| 1011 | DWORD dwProviderFlags; | ||
| 1012 | GUID ProviderId; | ||
| 1013 | DWORD dwCatalogEntryId; | ||
| 1014 | WSAPROTOCOLCHAIN ProtocolChain; | ||
| 1015 | int iVersion; | ||
| 1016 | int iAddressFamily; | ||
| 1017 | int iMaxSockAddr; | ||
| 1018 | int iMinSockAddr; | ||
| 1019 | int iSocketType; | ||
| 1020 | int iProtocol; | ||
| 1021 | int iProtocolMaxOffset; | ||
| 1022 | int iNetworkByteOrder; | ||
| 1023 | int iSecurityScheme; | ||
| 1024 | DWORD dwMessageSize; | ||
| 1025 | DWORD dwProviderReserved; | ||
| 1026 | CHAR szProtocol[WSAPROTOCOL_LEN+1]; | ||
| 1027 | } WSAPROTOCOL_INFOA, *LPWSAPROTOCOL_INFOA; | ||
| 1028 | |||
| 1029 | typedef struct _WSAPROTOCOL_INFOW { | ||
| 1030 | DWORD dwServiceFlags1; | ||
| 1031 | DWORD dwServiceFlags2; | ||
| 1032 | DWORD dwServiceFlags3; | ||
| 1033 | DWORD dwServiceFlags4; | ||
| 1034 | DWORD dwProviderFlags; | ||
| 1035 | GUID ProviderId; | ||
| 1036 | DWORD dwCatalogEntryId; | ||
| 1037 | WSAPROTOCOLCHAIN ProtocolChain; | ||
| 1038 | int iVersion; | ||
| 1039 | int iAddressFamily; | ||
| 1040 | int iMaxSockAddr; | ||
| 1041 | int iMinSockAddr; | ||
| 1042 | int iSocketType; | ||
| 1043 | int iProtocol; | ||
| 1044 | int iProtocolMaxOffset; | ||
| 1045 | int iNetworkByteOrder; | ||
| 1046 | int iSecurityScheme; | ||
| 1047 | DWORD dwMessageSize; | ||
| 1048 | DWORD dwProviderReserved; | ||
| 1049 | WCHAR szProtocol[WSAPROTOCOL_LEN+1]; | ||
| 1050 | } WSAPROTOCOL_INFOW, * LPWSAPROTOCOL_INFOW; | ||
| 1051 | |||
| 1052 | typedef int (CALLBACK *LPCONDITIONPROC)(LPWSABUF, LPWSABUF, LPQOS, LPQOS, LPWSABUF, LPWSABUF, GROUP *, DWORD); | ||
| 1053 | typedef void (WINAPI *LPWSAOVERLAPPED_COMPLETION_ROUTINE)(DWORD, DWORD, LPWSAOVERLAPPED, DWORD); | ||
| 1054 | |||
| 1055 | typedef __AW(WSAPROTOCOL_INFO) WSAPROTOCOL_INFO; | ||
| 1056 | typedef __AW(LPWSAPROTOCOL_INFO) LPWSAPROTOCOL_INFO; | ||
| 1057 | |||
| 1058 | /* Needed for XP & .NET Server function WSANSPIoctl. */ | ||
| 1059 | typedef enum _WSACOMPLETIONTYPE { | ||
| 1060 | NSP_NOTIFY_IMMEDIATELY = 0, | ||
| 1061 | NSP_NOTIFY_HWND, | ||
| 1062 | NSP_NOTIFY_EVENT, | ||
| 1063 | NSP_NOTIFY_PORT, | ||
| 1064 | NSP_NOTIFY_APC | ||
| 1065 | } WSACOMPLETIONTYPE, * PWSACOMPLETIONTYPE, * LPWSACOMPLETIONTYPE; | ||
| 1066 | typedef struct _WSACOMPLETION { | ||
| 1067 | WSACOMPLETIONTYPE Type; | ||
| 1068 | union { | ||
| 1069 | struct { | ||
| 1070 | HWND hWnd; | ||
| 1071 | UINT uMsg; | ||
| 1072 | WPARAM context; | ||
| 1073 | } WindowMessage; | ||
| 1074 | struct { | ||
| 1075 | LPWSAOVERLAPPED lpOverlapped; | ||
| 1076 | } Event; | ||
| 1077 | struct { | ||
| 1078 | LPWSAOVERLAPPED lpOverlapped; | ||
| 1079 | LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc; | ||
| 1080 | } Apc; | ||
| 1081 | struct { | ||
| 1082 | LPWSAOVERLAPPED lpOverlapped; | ||
| 1083 | HANDLE hPort; | ||
| 1084 | ULONG_PTR Key; | ||
| 1085 | } Port; | ||
| 1086 | } Parameters; | ||
| 1087 | } WSACOMPLETION, *PWSACOMPLETION, *LPWSACOMPLETION; | ||
| 1088 | |||
| 1089 | #define PFL_MULTIPLE_PROTO_ENTRIES 0x00000001 | ||
| 1090 | #define PFL_RECOMMENDED_PROTO_ENTRY 0x00000002 | ||
| 1091 | #define PFL_HIDDEN 0x00000004 | ||
| 1092 | #define PFL_MATCHES_PROTOCOL_ZERO 0x00000008 | ||
| 1093 | #define XP1_CONNECTIONLESS 0x00000001 | ||
| 1094 | #define XP1_GUARANTEED_DELIVERY 0x00000002 | ||
| 1095 | #define XP1_GUARANTEED_ORDER 0x00000004 | ||
| 1096 | #define XP1_MESSAGE_ORIENTED 0x00000008 | ||
| 1097 | #define XP1_PSEUDO_STREAM 0x00000010 | ||
| 1098 | #define XP1_GRACEFUL_CLOSE 0x00000020 | ||
| 1099 | #define XP1_EXPEDITED_DATA 0x00000040 | ||
| 1100 | #define XP1_CONNECT_DATA 0x00000080 | ||
| 1101 | #define XP1_DISCONNECT_DATA 0x00000100 | ||
| 1102 | #define XP1_SUPPORT_BROADCAST 0x00000200 | ||
| 1103 | #define XP1_SUPPORT_MULTIPOINT 0x00000400 | ||
| 1104 | #define XP1_MULTIPOINT_CONTROL_PLANE 0x00000800 | ||
| 1105 | #define XP1_MULTIPOINT_DATA_PLANE 0x00001000 | ||
| 1106 | #define XP1_QOS_SUPPORTED 0x00002000 | ||
| 1107 | #define XP1_INTERRUPT 0x00004000 | ||
| 1108 | #define XP1_UNI_SEND 0x00008000 | ||
| 1109 | #define XP1_UNI_RECV 0x00010000 | ||
| 1110 | #define XP1_IFS_HANDLES 0x00020000 | ||
| 1111 | #define XP1_PARTIAL_MESSAGE 0x00040000 | ||
| 1112 | |||
| 1113 | #define BIGENDIAN 0x0000 | ||
| 1114 | #define LITTLEENDIAN 0x0001 | ||
| 1115 | |||
| 1116 | #define SECURITY_PROTOCOL_NONE 0x0000 | ||
| 1117 | #define JL_SENDER_ONLY 0x01 | ||
| 1118 | #define JL_RECEIVER_ONLY 0x02 | ||
| 1119 | #define JL_BOTH 0x04 | ||
| 1120 | #define WSA_FLAG_OVERLAPPED 0x01 | ||
| 1121 | #define WSA_FLAG_MULTIPOINT_C_ROOT 0x02 | ||
| 1122 | #define WSA_FLAG_MULTIPOINT_C_LEAF 0x04 | ||
| 1123 | #define WSA_FLAG_MULTIPOINT_D_ROOT 0x08 | ||
| 1124 | #define WSA_FLAG_MULTIPOINT_D_LEAF 0x10 | ||
| 1125 | #define IOC_UNIX 0x00000000 | ||
| 1126 | #define IOC_WS2 0x08000000 | ||
| 1127 | #define IOC_PROTOCOL 0x10000000 | ||
| 1128 | #define IOC_VENDOR 0x18000000 | ||
| 1129 | |||
| 1130 | #define _WSAIO(x,y) (IOC_VOID|(x)|(y)) | ||
| 1131 | #define _WSAIOR(x,y) (IOC_OUT|(x)|(y)) | ||
| 1132 | #define _WSAIOW(x,y) (IOC_IN|(x)|(y)) | ||
| 1133 | #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y)) | ||
| 1134 | |||
| 1135 | #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1) | ||
| 1136 | #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2) | ||
| 1137 | #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3) | ||
| 1138 | #define SIO_FLUSH _WSAIO(IOC_WS2,4) | ||
| 1139 | #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5) | ||
| 1140 | #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6) | ||
| 1141 | #define SIO_GET_QOS _WSAIORW(IOC_WS2,7) | ||
| 1142 | #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8) | ||
| 1143 | #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9) | ||
| 1144 | #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10) | ||
| 1145 | #define SIO_SET_QOS _WSAIOW(IOC_WS2,11) | ||
| 1146 | #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12) | ||
| 1147 | #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13) | ||
| 1148 | #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20) | ||
| 1149 | #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21) | ||
| 1150 | #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22) | ||
| 1151 | #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23) | ||
| 1152 | #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24) | ||
| 1153 | #define SIO_NSP_NOTIFY_CHANGE _WSAIOW(IOC_WS2,25) | ||
| 1154 | #define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) | ||
| 1155 | |||
| 1156 | #define TH_NETDEV 0x00000001 | ||
| 1157 | #define TH_TAPI 0x00000002 | ||
| 1158 | |||
| 1159 | WINSOCK_API_LINKAGE SOCKET WINAPI WSAAccept(SOCKET, struct sockaddr *, LPINT, LPCONDITIONPROC, DWORD); | ||
| 1160 | WINSOCK_API_LINKAGE INT WINAPI WSAAddressToStringA(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOA, LPSTR, LPDWORD); | ||
| 1161 | WINSOCK_API_LINKAGE INT WINAPI WSAAddressToStringW(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOW, LPWSTR, LPDWORD); | ||
| 1162 | WINSOCK_API_LINKAGE BOOL WINAPI WSACloseEvent(WSAEVENT); | ||
| 1163 | WINSOCK_API_LINKAGE int WINAPI WSAConnect(SOCKET, const struct sockaddr *, int, LPWSABUF, LPWSABUF, LPQOS, LPQOS); | ||
| 1164 | WINSOCK_API_LINKAGE WSAEVENT WINAPI WSACreateEvent(void); | ||
| 1165 | WINSOCK_API_LINKAGE int WINAPI WSADuplicateSocketA(SOCKET, DWORD, LPWSAPROTOCOL_INFOA); | ||
| 1166 | WINSOCK_API_LINKAGE int WINAPI WSADuplicateSocketW(SOCKET, DWORD, LPWSAPROTOCOL_INFOW); | ||
| 1167 | WINSOCK_API_LINKAGE INT WINAPI WSAEnumNameSpaceProvidersA(LPDWORD, LPWSANAMESPACE_INFOA); | ||
| 1168 | WINSOCK_API_LINKAGE INT WINAPI WSAEnumNameSpaceProvidersW(LPDWORD, LPWSANAMESPACE_INFOW); | ||
| 1169 | WINSOCK_API_LINKAGE int WINAPI WSAEnumNetworkEvents(SOCKET, WSAEVENT, LPWSANETWORKEVENTS); | ||
| 1170 | WINSOCK_API_LINKAGE int WINAPI WSAEnumProtocolsA(LPINT, LPWSAPROTOCOL_INFOA, LPDWORD); | ||
| 1171 | WINSOCK_API_LINKAGE int WINAPI WSAEnumProtocolsW(LPINT, LPWSAPROTOCOL_INFOW, LPDWORD); | ||
| 1172 | WINSOCK_API_LINKAGE int WINAPI WSAEventSelect(SOCKET, WSAEVENT, long); | ||
| 1173 | WINSOCK_API_LINKAGE BOOL WINAPI WSAGetOverlappedResult(SOCKET, LPWSAOVERLAPPED, LPDWORD, BOOL, LPDWORD); | ||
| 1174 | WINSOCK_API_LINKAGE BOOL WINAPI WSAGetQOSByName(SOCKET, LPWSABUF, LPQOS); | ||
| 1175 | WINSOCK_API_LINKAGE INT WINAPI WSAGetServiceClassInfoA(LPGUID, LPGUID, LPDWORD, LPWSASERVICECLASSINFOA); | ||
| 1176 | WINSOCK_API_LINKAGE INT WINAPI WSAGetServiceClassInfoW(LPGUID, LPGUID, LPDWORD, LPWSASERVICECLASSINFOW); | ||
| 1177 | WINSOCK_API_LINKAGE INT WINAPI WSAGetServiceClassNameByClassIdA(LPGUID, LPSTR, LPDWORD); | ||
| 1178 | WINSOCK_API_LINKAGE INT WINAPI WSAGetServiceClassNameByClassIdW(LPGUID, LPWSTR, LPDWORD); | ||
| 1179 | WINSOCK_API_LINKAGE int WINAPI WSAHtonl(SOCKET, unsigned long, unsigned long *); | ||
| 1180 | WINSOCK_API_LINKAGE int WINAPI WSAHtons(SOCKET, unsigned short, unsigned short *); | ||
| 1181 | WINSOCK_API_LINKAGE INT WINAPI WSAInstallServiceClassA(LPWSASERVICECLASSINFOA); | ||
| 1182 | WINSOCK_API_LINKAGE INT WINAPI WSAInstallServiceClassW(LPWSASERVICECLASSINFOW); | ||
| 1183 | WINSOCK_API_LINKAGE int WINAPI WSAIoctl(SOCKET, DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1184 | WINSOCK_API_LINKAGE SOCKET WINAPI WSAJoinLeaf(SOCKET, const struct sockaddr *, int, LPWSABUF, LPWSABUF, LPQOS, LPQOS, DWORD); | ||
| 1185 | WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceBeginA(LPWSAQUERYSETA, DWORD, LPHANDLE); | ||
| 1186 | WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceBeginW(LPWSAQUERYSETW lpqsRestrictions, DWORD, LPHANDLE); | ||
| 1187 | WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceNextA(HANDLE, DWORD, LPDWORD, LPWSAQUERYSETA); | ||
| 1188 | WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceNextW(HANDLE, DWORD, LPDWORD, LPWSAQUERYSETW); | ||
| 1189 | WINSOCK_API_LINKAGE INT WINAPI WSALookupServiceEnd(HANDLE); | ||
| 1190 | WINSOCK_API_LINKAGE int WINAPI WSANSPIoctl(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION); /* XP or .NET Server */ | ||
| 1191 | WINSOCK_API_LINKAGE int WINAPI WSANtohl(SOCKET, unsigned long, unsigned long *); | ||
| 1192 | WINSOCK_API_LINKAGE int WINAPI WSANtohs(SOCKET, unsigned short, unsigned short *); | ||
| 1193 | WINSOCK_API_LINKAGE int WINAPI WSARecv(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1194 | WINSOCK_API_LINKAGE int WINAPI WSARecvDisconnect(SOCKET, LPWSABUF); | ||
| 1195 | WINSOCK_API_LINKAGE int WINAPI WSARecvFrom(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, struct sockaddr *, LPINT, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1196 | WINSOCK_API_LINKAGE INT WINAPI WSARemoveServiceClass(LPGUID); | ||
| 1197 | WINSOCK_API_LINKAGE BOOL WINAPI WSAResetEvent(WSAEVENT); | ||
| 1198 | WINSOCK_API_LINKAGE int WINAPI WSASend(SOCKET, LPWSABUF, DWORD, LPDWORD, DWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1199 | WINSOCK_API_LINKAGE int WINAPI WSASendDisconnect(SOCKET, LPWSABUF); | ||
| 1200 | WINSOCK_API_LINKAGE int WINAPI WSASendTo(SOCKET, LPWSABUF, DWORD, LPDWORD, DWORD, const struct sockaddr *, int, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1201 | WINSOCK_API_LINKAGE BOOL WINAPI WSASetEvent(WSAEVENT); | ||
| 1202 | WINSOCK_API_LINKAGE INT WSAAPI WSASetServiceA(LPWSAQUERYSETA, WSAESETSERVICEOP, DWORD); | ||
| 1203 | WINSOCK_API_LINKAGE INT WINAPI WSASetServiceW(LPWSAQUERYSETW, WSAESETSERVICEOP, DWORD); | ||
| 1204 | WINSOCK_API_LINKAGE SOCKET WINAPI WSASocketA(int, int, int, LPWSAPROTOCOL_INFOA, GROUP, DWORD); | ||
| 1205 | WINSOCK_API_LINKAGE SOCKET WINAPI WSASocketW(int, int, int, LPWSAPROTOCOL_INFOW, GROUP, DWORD); | ||
| 1206 | WINSOCK_API_LINKAGE INT WINAPI WSAStringToAddressA(LPSTR, INT, LPWSAPROTOCOL_INFOA, LPSOCKADDR, LPINT); | ||
| 1207 | WINSOCK_API_LINKAGE INT WINAPI WSAStringToAddressW(LPWSTR, INT, LPWSAPROTOCOL_INFOW, LPSOCKADDR, LPINT); | ||
| 1208 | WINSOCK_API_LINKAGE DWORD WINAPI WSAWaitForMultipleEvents(DWORD, const WSAEVENT *, BOOL, DWORD, BOOL); | ||
| 1209 | |||
| 1210 | typedef SOCKET (WINAPI *LPFN_WSAACCEPT)(SOCKET, struct sockaddr *, LPINT, LPCONDITIONPROC, DWORD); | ||
| 1211 | typedef INT (WINAPI *LPFN_WSAADDRESSTOSTRINGA)(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOA, LPSTR, LPDWORD); | ||
| 1212 | typedef INT (WINAPI *LPFN_WSAADDRESSTOSTRINGW)(LPSOCKADDR, DWORD, LPWSAPROTOCOL_INFOW, LPWSTR, LPDWORD); | ||
| 1213 | typedef BOOL (WINAPI *LPFN_WSACLOSEEVENT)(WSAEVENT); | ||
| 1214 | typedef int (WINAPI *LPFN_WSACONNECT)(SOCKET, const struct sockaddr *, int, LPWSABUF, LPWSABUF, LPQOS, LPQOS); | ||
| 1215 | typedef WSAEVENT (WINAPI *LPFN_WSACREATEEVENT)(void); | ||
| 1216 | typedef int (WINAPI *LPFN_WSADUPLICATESOCKETA)(SOCKET, DWORD, LPWSAPROTOCOL_INFOA); | ||
| 1217 | typedef int (WINAPI *LPFN_WSADUPLICATESOCKETW)(SOCKET, DWORD, LPWSAPROTOCOL_INFOW); | ||
| 1218 | typedef INT (WINAPI *LPFN_WSAENUMNAMESPACEPROVIDERSA)(LPDWORD, LPWSANAMESPACE_INFOA); | ||
| 1219 | typedef INT (WINAPI *LPFN_WSAENUMNAMESPACEPROVIDERSW)(LPDWORD, LPWSANAMESPACE_INFOW); | ||
| 1220 | typedef int (WINAPI *LPFN_WSAENUMNETWORKEVENTS)(SOCKET, WSAEVENT, LPWSANETWORKEVENTS); | ||
| 1221 | typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSA)(LPINT, LPWSAPROTOCOL_INFOA, LPDWORD); | ||
| 1222 | typedef int (WINAPI *LPFN_WSAENUMPROTOCOLSW)(LPINT, LPWSAPROTOCOL_INFOW, LPDWORD); | ||
| 1223 | typedef int (WINAPI *LPFN_WSAEVENTSELECT)(SOCKET, WSAEVENT, long); | ||
| 1224 | typedef BOOL (WINAPI *LPFN_WSAGETOVERLAPPEDRESULT)(SOCKET, LPWSAOVERLAPPED, LPDWORD, BOOL, LPDWORD); | ||
| 1225 | typedef BOOL (WINAPI *LPFN_WSAGETQOSBYNAME)(SOCKET, LPWSABUF, LPQOS); | ||
| 1226 | typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSINFOA)(LPGUID, LPGUID, LPDWORD, LPWSASERVICECLASSINFOA); | ||
| 1227 | typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSINFOW)(LPGUID, LPGUID, LPDWORD, LPWSASERVICECLASSINFOW); | ||
| 1228 | typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA)(LPGUID, LPSTR, LPDWORD); | ||
| 1229 | typedef INT (WINAPI *LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW)(LPGUID, LPWSTR, LPDWORD); | ||
| 1230 | typedef int (WINAPI *LPFN_WSAHTONL)(SOCKET, unsigned long, unsigned long *); | ||
| 1231 | typedef int (WINAPI *LPFN_WSAHTONS)(SOCKET, unsigned short, unsigned short *); | ||
| 1232 | typedef INT (WINAPI *LPFN_WSAINSTALLSERVICECLASSA)(LPWSASERVICECLASSINFOA); | ||
| 1233 | typedef INT (WINAPI *LPFN_WSAINSTALLSERVICECLASSW)(LPWSASERVICECLASSINFOW); | ||
| 1234 | typedef int (WINAPI *LPFN_WSAIOCTL)(SOCKET, DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1235 | typedef SOCKET (WINAPI *LPFN_WSAJOINLEAF)(SOCKET, const struct sockaddr *, int, LPWSABUF, LPWSABUF, LPQOS, LPQOS, DWORD); | ||
| 1236 | typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEBEGINA)(LPWSAQUERYSETA, DWORD, LPHANDLE); | ||
| 1237 | typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEBEGINW)(LPWSAQUERYSETW, DWORD, LPHANDLE); | ||
| 1238 | typedef INT (WINAPI *LPFN_WSALOOKUPSERVICENEXTA)(HANDLE, DWORD, LPDWORD, LPWSAQUERYSETA); | ||
| 1239 | typedef INT (WINAPI *LPFN_WSALOOKUPSERVICENEXTW)(HANDLE, DWORD, LPDWORD, LPWSAQUERYSETW); | ||
| 1240 | typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEEND)(HANDLE); | ||
| 1241 | typedef int (WINAPI *LPFN_WSANSPIoctl)(HANDLE, DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION); | ||
| 1242 | typedef int (WINAPI *LPFN_WSANTOHL)(SOCKET, unsigned long, unsigned long *); | ||
| 1243 | typedef int (WINAPI *LPFN_WSANTOHS)(SOCKET, unsigned short, unsigned short *); | ||
| 1244 | typedef int (WINAPI *LPFN_WSARECV)(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1245 | typedef int (WINAPI *LPFN_WSARECVDISCONNECT)(SOCKET, LPWSABUF); | ||
| 1246 | typedef int (WINAPI *LPFN_WSARECVFROM)(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, struct sockaddr *, LPINT, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1247 | typedef INT (WINAPI *LPFN_WSAREMOVESERVICECLASS)(LPGUID); | ||
| 1248 | typedef BOOL (WINAPI *LPFN_WSARESETEVENT)(WSAEVENT); | ||
| 1249 | typedef int (WINAPI *LPFN_WSASEND)(SOCKET, LPWSABUF, DWORD, LPDWORD, DWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1250 | typedef int (WINAPI *LPFN_WSASENDDISCONNECT)(SOCKET, LPWSABUF); | ||
| 1251 | typedef int (WINAPI *LPFN_WSASENDTO)(SOCKET, LPWSABUF, DWORD, LPDWORD, DWORD, const struct sockaddr *, int, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE); | ||
| 1252 | typedef BOOL (WINAPI *LPFN_WSASETEVENT)(WSAEVENT); | ||
| 1253 | typedef INT (WINAPI *LPFN_WSASETSERVICEA)(LPWSAQUERYSETA, WSAESETSERVICEOP, DWORD); | ||
| 1254 | typedef INT (WINAPI *LPFN_WSASETSERVICEW)(LPWSAQUERYSETW, WSAESETSERVICEOP, DWORD); | ||
| 1255 | typedef SOCKET (WINAPI *LPFN_WSASOCKETA)(int, int, int, LPWSAPROTOCOL_INFOA, GROUP, DWORD); | ||
| 1256 | typedef SOCKET (WINAPI *LPFN_WSASOCKETW)(int, int, int, LPWSAPROTOCOL_INFOW, GROUP, DWORD); | ||
| 1257 | typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSA)(LPSTR, INT, LPWSAPROTOCOL_INFOA, LPSOCKADDR, LPINT); | ||
| 1258 | typedef INT (WINAPI *LPFN_WSASTRINGTOADDRESSW)(LPWSTR, INT, LPWSAPROTOCOL_INFOW, LPSOCKADDR, LPINT); | ||
| 1259 | typedef DWORD (WINAPI *LPFN_WSAWAITFORMULTIPLEEVENTS)(DWORD, const WSAEVENT *, BOOL, DWORD, BOOL); | ||
| 1260 | |||
| 1261 | #define LPFN_WSAADDRESSTOSTRING __AW(LPFN_WSAADDRESSTOSTRING) | ||
| 1262 | #define LPFN_WSADUPLICATESOCKET __AW(LPFN_WSADUPLICATESOCKET) | ||
| 1263 | #define LPFN_WSAENUMNAMESPACEPROVIDERS __AW(LPFN_WSAENUMNAMESPACEPROVIDERS) | ||
| 1264 | #define LPFN_WSAENUMPROTOCOLS __AW(LPFN_WSAENUMPROTOCOLS) | ||
| 1265 | #define LPFN_WSAGETSERVICECLASSINFO __AW(LPFN_WSAGETSERVICECLASSINFO) | ||
| 1266 | #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID __AW(LPFN_WSAGETSERVICECLASSNAMEBYCLASSID) | ||
| 1267 | #define LPFN_WSAINSTALLSERVICECLASS __AW(LPFN_WSAINSTALLSERVICECLASS) | ||
| 1268 | #define LPFN_WSALOOKUPSERVICEBEGIN __AW(LPFN_WSALOOKUPSERVICEBEGIN) | ||
| 1269 | #define LPFN_WSALOOKUPSERVICENEXT __AW(LPFN_WSALOOKUPSERVICENEXT) | ||
| 1270 | #define LPFN_WSASETSERVICE __AW(LPFN_WSASETSERVICE) | ||
| 1271 | #define LPFN_WSASOCKET __AW(LPFN_WSASOCKET) | ||
| 1272 | #define LPFN_WSASTRINGTOADDRESS __AW(LPFN_WSASTRINGTOADDRESS) | ||
| 1273 | #define WSAAddressToString __AW(WSAAddressToString) | ||
| 1274 | #define WSADuplicateSocket __AW(WSADuplicateSocket) | ||
| 1275 | #define WSAEnumNameSpaceProviders __AW(WSAEnumNameSpaceProviders) | ||
| 1276 | #define WSAEnumProtocols __AW(WSAEnumProtocols) | ||
| 1277 | #define WSAGetServiceClassInfo __AW(WSAGetServiceClassInfo) | ||
| 1278 | #define WSAGetServiceClassNameByClassId __AW(WSAGetServiceClassNameByClassId) | ||
| 1279 | #define WSASetService __AW(WSASetService) | ||
| 1280 | #define WSASocket __AW(WSASocket) | ||
| 1281 | #define WSAStringToAddress __AW(WSAStringToAddress) | ||
| 1282 | #define WSALookupServiceBegin __AW(WSALookupServiceBegin) | ||
| 1283 | #define WSALookupServiceNext __AW(WSALookupServiceNext) | ||
| 1284 | #define WSAInstallServiceClass __AW(WSAInstallServiceClass) | ||
| 1285 | |||
| 1286 | #ifdef __cplusplus | ||
| 1287 | } | ||
| 1288 | #endif | ||
| 1289 | |||
| 1290 | #endif | ||
| @@ -1,9 +1,6 @@ | |||
| 1 | // ============================================= | 1 | // ============================================= |
| 2 | // crt1.c | 2 | // crt1.c |
| 3 | 3 | ||
| 4 | // For ExitProcess | ||
| 5 | // windows.h header file should be included before any other library include | ||
| 6 | #include <windows.h> | ||
| 7 | #include <stdio.h> | 4 | #include <stdio.h> |
| 8 | #include <stdlib.h> | 5 | #include <stdlib.h> |
| 9 | 6 | ||
| @@ -16,47 +13,23 @@ · 6 unmodified lines | |||
| 16 | #define _PC_53 0x00010000 // 53 bits | 13 | #define _PC_53 0x00010000 // 53 bits |
| 17 | #define _PC_64 0x00000000 // 64 bits | 14 | #define _PC_64 0x00000000 // 64 bits |
| 18 | 15 | ||
| 19 | #ifndef __TRY__ | ||
| 20 | #ifdef _WIN64 | ||
| 21 | #define __TRY__ | ||
| 22 | #else | ||
| 23 | #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec); | ||
| 24 | #endif | ||
| 25 | #endif | ||
| 26 | |||
| 27 | typedef struct | 16 | typedef struct |
| 28 | { | 17 | { |
| 29 | int newmode; | 18 | int newmode; |
| 30 | } _startupinfo; | 19 | } _startupinfo; |
| 31 | 20 | ||
| 32 | // Prototype of __getmainargs: | ||
| 33 | // in msvcrt v6.x : returns void (windows 98, 2000) | ||
| 34 | // in msvcrt v7.x : returns int (windows xp and above) | ||
| 35 | // Using the last for check the result. A negative value means no success. | ||
| 36 | // These are the test results of call to __getmainargs with the heap fully: | ||
| 37 | // win 98, 2000 : | ||
| 38 | // program termination with error code 255 after call _amsg_exit(8) | ||
| 39 | // prints: "runtime error R6008\r\n- not enough space for arguments\r\n" | ||
| 40 | // win xp : | ||
| 41 | // returns -1 | ||
| 42 | // win 7, 8 : | ||
| 43 | // program termination with error code -1 after call ExitProcess(-1) | ||
| 44 | // | ||
| 45 | // Checking the return of this function also works on windows 98 and 2000 | ||
| 46 | // because internally it sets to eax the value of the third parameter. | ||
| 47 | // In this case is &env and at that point it is not a negative value. | ||
| 48 | |||
| 49 | int __cdecl __getmainargs(int *pargc, char ***pargv, char ***penv, int globb, _startupinfo*); | 21 | int __cdecl __getmainargs(int *pargc, char ***pargv, char ***penv, int globb, _startupinfo*); |
| 50 | void __cdecl __set_app_type(int apptype); | 22 | void __cdecl __set_app_type(int apptype); |
| 51 | unsigned int __cdecl _controlfp(unsigned int new_value, unsigned int mask); | 23 | unsigned int __cdecl _controlfp(unsigned int new_value, unsigned int mask); |
| 52 | |||
| 53 | void _start(void); | ||
| 54 | int main(int argc, char * argv[], char * env[]); | 24 | int main(int argc, char * argv[], char * env[]); |
| 55 | 25 | ||
| 26 | /* Allow command-line globbing with "int _dowildcard = 1;" in the user source */ | ||
| 27 | int _dowildcard; | ||
| 28 | |||
| 56 | void _start(void) | 29 | void _start(void) |
| 57 | { | 30 | { |
| 58 | __TRY__ | 31 | __TRY__ |
| 59 | int argc; | 32 | int argc, ret; |
| 60 | char **argv; | 33 | char **argv; |
| 61 | char **env; | 34 | char **env; |
| 62 | _startupinfo start_info; | 35 | _startupinfo start_info; |
| @@ -67,20 +40,14 @@ void _start(void) · 4 unmodified lines | |||
| 67 | // Set default FP precision to 53 bits (8-byte double) | 40 | // Set default FP precision to 53 bits (8-byte double) |
| 68 | // _MCW_PC (Precision control) is not supported on | 41 | // _MCW_PC (Precision control) is not supported on |
| 69 | // the ARM and x64 architectures | 42 | // the ARM and x64 architectures |
| 70 | #if defined(_X86_) && !defined(__x86_64) | 43 | #ifdef __i386 |
| 71 | _controlfp(_PC_53, _MCW_PC); | 44 | _controlfp(_PC_53, _MCW_PC); |
| 72 | #endif | 45 | #endif |
| 73 | 46 | ||
| 74 | start_info.newmode = 0; | 47 | start_info.newmode = 0; |
| 75 | if ( __getmainargs( &argc, &argv, &env, 0, &start_info ) < 0 ) | 48 | __getmainargs( &argc, &argv, &env, _dowildcard, &start_info); |
| 76 | { | 49 | ret = main(argc, argv, env); |
| 77 | ExitProcess(-1); | 50 | exit(ret); |
| 78 | } | ||
| 79 | else | ||
| 80 | { | ||
| 81 | exit( main(argc, argv, env) ); | ||
| 82 | } | ||
| 83 | |||
| 84 | } | 51 | } |
| 85 | 52 | ||
| 86 | // ============================================= | 53 | // ============================================= |
| @@ -9,14 +9,6 @@ · 8 unmodified lines | |||
| 9 | void __set_app_type(int); | 9 | void __set_app_type(int); |
| 10 | void _controlfp(unsigned a, unsigned b); | 10 | void _controlfp(unsigned a, unsigned b); |
| 11 | 11 | ||
| 12 | #ifndef __TRY__ | ||
| 13 | #ifdef _WIN64 | ||
| 14 | #define __TRY__ | ||
| 15 | #else | ||
| 16 | #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec); | ||
| 17 | #endif | ||
| 18 | #endif | ||
| 19 | |||
| 20 | int _winstart(void) | 12 | int _winstart(void) |
| 21 | { | 13 | { |
| 22 | __TRY__ | 14 | __TRY__ |