12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857 |
- /* Winsock2.h -- definitions to be used with the WinSock 2 DLL and
- * WinSock 2 applications.
- *
- * This header file corresponds to version 2.2.x of the WinSock API
- * specification.
- *
- * This file includes parts which are Copyright (c) 1982-1986 Regents
- * of the University of California. All rights reserved. The
- * Berkeley Software License Agreement specifies the terms and
- * conditions for redistribution.
- */
- #ifndef _WINSOCK2API_
- #define _WINSOCK2API_
- #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
- /*
- * Ensure structures are packed consistently.
- * Not necessary for WIN32, it is already packed >=4 and there are
- * no structures in this header that have alignment requirement
- * higher than 4.
- * For WIN64 we do not have compatibility requirement because it is
- * not possible to mix 32/16 bit code with 64 bit code in the same
- * process.
- */
- #if !defined(WIN32) && !defined(_WIN64)
- #include <pshpack4.h>
- #endif
- /*
- * Default: include function prototypes, don't include function typedefs.
- */
- #ifndef INCL_WINSOCK_API_PROTOTYPES
- #define INCL_WINSOCK_API_PROTOTYPES 1
- #endif
- #ifndef INCL_WINSOCK_API_TYPEDEFS
- #define INCL_WINSOCK_API_TYPEDEFS 0
- #endif
- /*
- * Pull in WINDOWS.H if necessary
- */
- #ifndef _INC_WINDOWS
- #include <windows.h>
- #endif /* _INC_WINDOWS */
- /*
- * Define the current Winsock version. To build an earlier Winsock version
- * application redefine this value prior to including Winsock2.h.
- */
- #if !defined(MAKEWORD)
- #define MAKEWORD(low,high) \
- ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
- #endif
- #ifndef WINSOCK_VERSION
- #define WINSOCK_VERSION MAKEWORD(2,2)
- #endif
- /*
- * Establish DLL function linkage if supported by the current build
- * environment and not previously defined.
- */
- #ifndef WINSOCK_API_LINKAGE
- #ifdef DECLSPEC_IMPORT
- #define WINSOCK_API_LINKAGE DECLSPEC_IMPORT
- #else
- #define WINSOCK_API_LINKAGE
- #endif
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- /*
- * Basic system type definitions, taken from the BSD file sys/types.h.
- */
- typedef unsigned char u_char;
- typedef unsigned short u_short;
- typedef unsigned int u_int;
- typedef unsigned long u_long;
- typedef unsigned __int64 u_int64;
- /*
- * The new type to be used in all
- * instances which refer to sockets.
- */
- typedef UINT_PTR SOCKET;
- /*
- * Select uses arrays of SOCKETs. These macros manipulate such
- * arrays. FD_SETSIZE may be defined by the user before including
- * this file, but the default here should be >= 64.
- *
- * CAVEAT IMPLEMENTOR and USER: THESE MACROS AND TYPES MUST BE
- * INCLUDED IN WINSOCK2.H EXACTLY AS SHOWN HERE.
- */
- #ifndef FD_SETSIZE
- #define FD_SETSIZE 64
- #endif /* FD_SETSIZE */
- typedef struct fd_set {
- u_int fd_count; /* how many are SET? */
- SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */
- } fd_set;
- extern int PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR *);
- #define FD_CLR(fd, set) do { \
- u_int __i; \
- for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \
- if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \
- while (__i < ((fd_set FAR *)(set))->fd_count-1) { \
- ((fd_set FAR *)(set))->fd_array[__i] = \
- ((fd_set FAR *)(set))->fd_array[__i+1]; \
- __i++; \
- } \
- ((fd_set FAR *)(set))->fd_count--; \
- break; \
- } \
- } \
- } while(0)
- #define FD_SET(fd, set) do { \
- u_int __i; \
- for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \
- if (((fd_set FAR *)(set))->fd_array[__i] == (fd)) { \
- break; \
- } \
- } \
- if (__i == ((fd_set FAR *)(set))->fd_count) { \
- if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \
- ((fd_set FAR *)(set))->fd_array[__i] = (fd); \
- ((fd_set FAR *)(set))->fd_count++; \
- } \
- } \
- } while(0)
- #define FD_ZERO(set) (((fd_set FAR *)(set))->fd_count=0)
- #define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set FAR *)(set))
- /*
- * Structure used in select() call, taken from the BSD file sys/time.h.
- */
- struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
- };
- /*
- * Operations on timevals.
- *
- * NB: timercmp does not work for >= or <=.
- */
- #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
- #define timercmp(tvp, uvp, cmp) \
- ((tvp)->tv_sec cmp (uvp)->tv_sec || \
- (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
- #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
- /*
- * Commands for ioctlsocket(), taken from the BSD file fcntl.h.
- *
- *
- * Ioctl's have the command encoded in the lower word,
- * and the size of any in or out parameters in the upper
- * word. The high 2 bits of the upper word are used
- * to encode the in/out status of the parameter; for now
- * we restrict parameters to at most 128 bytes.
- */
- #define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */
- #define IOC_VOID 0x20000000 /* no parameters */
- #define IOC_OUT 0x40000000 /* copy out parameters */
- #define IOC_IN 0x80000000 /* copy in parameters */
- #define IOC_INOUT (IOC_IN|IOC_OUT)
- /* 0x20000000 distinguishes new &
- old ioctl's */
- #define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
- #define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
- #define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
- #define FIONREAD _IOR('f', 127, u_long) /* get # bytes to read */
- #define FIONBIO _IOW('f', 126, u_long) /* set/clear non-blocking i/o */
- #define FIOASYNC _IOW('f', 125, u_long) /* set/clear async i/o */
- /* Socket I/O Controls */
- #define SIOCSHIWAT _IOW('s', 0, u_long) /* set high watermark */
- #define SIOCGHIWAT _IOR('s', 1, u_long) /* get high watermark */
- #define SIOCSLOWAT _IOW('s', 2, u_long) /* set low watermark */
- #define SIOCGLOWAT _IOR('s', 3, u_long) /* get low watermark */
- #define SIOCATMARK _IOR('s', 7, u_long) /* at oob mark? */
- /*
- * Structures returned by network data base library, taken from the
- * BSD file netdb.h. All addresses are supplied in host order, and
- * returned in network order (suitable for use in system calls).
- */
- struct hostent {
- char FAR * h_name; /* official name of host */
- char FAR * FAR * h_aliases; /* alias list */
- short h_addrtype; /* host address type */
- short h_length; /* length of address */
- char FAR * FAR * h_addr_list; /* list of addresses */
- #define h_addr h_addr_list[0] /* address, for backward compat */
- };
- /*
- * It is assumed here that a network number
- * fits in 32 bits.
- */
- struct netent {
- char FAR * n_name; /* official name of net */
- char FAR * FAR * n_aliases; /* alias list */
- short n_addrtype; /* net address type */
- u_long n_net; /* network # */
- };
- struct servent {
- char FAR * s_name; /* official service name */
- char FAR * FAR * s_aliases; /* alias list */
- #ifdef _WIN64
- char FAR * s_proto; /* protocol to use */
- short s_port; /* port # */
- #else
- short s_port; /* port # */
- char FAR * s_proto; /* protocol to use */
- #endif
- };
- struct protoent {
- char FAR * p_name; /* official protocol name */
- char FAR * FAR * p_aliases; /* alias list */
- short p_proto; /* protocol # */
- };
- /*
- * Constants and structures defined by the internet system,
- * Per RFC 790, September 1981, taken from the BSD file netinet/in.h.
- * IPv6 additions per RFC 2292.
- */
- /*
- * Protocols
- */
- #define IPPROTO_IP 0 /* dummy for IP */
- #define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
- #define IPPROTO_ICMP 1 /* control message protocol */
- #define IPPROTO_IGMP 2 /* internet group management protocol */
- #define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
- #define IPPROTO_IPV4 4 /* IPv4 */
- #define IPPROTO_TCP 6 /* tcp */
- #define IPPROTO_PUP 12 /* pup */
- #define IPPROTO_UDP 17 /* user datagram protocol */
- #define IPPROTO_IDP 22 /* xns idp */
- #define IPPROTO_IPV6 41 /* IPv6 */
- #define IPPROTO_ROUTING 43 /* IPv6 routing header */
- #define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
- #define IPPROTO_ESP 50 /* IPsec ESP header */
- #define IPPROTO_AH 51 /* IPsec AH */
- #define IPPROTO_ICMPV6 58 /* ICMPv6 */
- #define IPPROTO_NONE 59 /* IPv6 no next header */
- #define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
- #define IPPROTO_ND 77 /* UNOFFICIAL net disk proto */
- #define IPPROTO_ICLFXBM 78
- #define IPPROTO_RAW 255 /* raw IP packet */
- #define IPPROTO_MAX 256
- /*
- * Port/socket numbers: network standard functions
- */
- #define IPPORT_ECHO 7
- #define IPPORT_DISCARD 9
- #define IPPORT_SYSTAT 11
- #define IPPORT_DAYTIME 13
- #define IPPORT_NETSTAT 15
- #define IPPORT_FTP 21
- #define IPPORT_TELNET 23
- #define IPPORT_SMTP 25
- #define IPPORT_TIMESERVER 37
- #define IPPORT_NAMESERVER 42
- #define IPPORT_WHOIS 43
- #define IPPORT_MTP 57
- /*
- * Port/socket numbers: host specific functions
- */
- #define IPPORT_TFTP 69
- #define IPPORT_RJE 77
- #define IPPORT_FINGER 79
- #define IPPORT_TTYLINK 87
- #define IPPORT_SUPDUP 95
- /*
- * UNIX TCP sockets
- */
- #define IPPORT_EXECSERVER 512
- #define IPPORT_LOGINSERVER 513
- #define IPPORT_CMDSERVER 514
- #define IPPORT_EFSSERVER 520
- /*
- * UNIX UDP sockets
- */
- #define IPPORT_BIFFUDP 512
- #define IPPORT_WHOSERVER 513
- #define IPPORT_ROUTESERVER 520
- /* 520+1 also used */
- /*
- * Ports < IPPORT_RESERVED are reserved for
- * privileged processes (e.g. root).
- */
- #define IPPORT_RESERVED 1024
- /*
- * Link numbers
- */
- #define IMPLINK_IP 155
- #define IMPLINK_LOWEXPER 156
- #define IMPLINK_HIGHEXPER 158
- #ifndef s_addr
- /*
- * Internet address (old style... should be updated)
- */
- struct in_addr {
- union {
- struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
- struct { u_short s_w1,s_w2; } S_un_w;
- u_long S_addr;
- } S_un;
- #define s_addr S_un.S_addr
- /* can be used for most tcp & ip code */
- #define s_host S_un.S_un_b.s_b2
- /* host on imp */
- #define s_net S_un.S_un_b.s_b1
- /* network */
- #define s_imp S_un.S_un_w.s_w2
- /* imp */
- #define s_impno S_un.S_un_b.s_b4
- /* imp # */
- #define s_lh S_un.S_un_b.s_b3
- /* logical host */
- };
- #endif
- /*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
- */
- #define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0)
- #define IN_CLASSA_NET 0xff000000
- #define IN_CLASSA_NSHIFT 24
- #define IN_CLASSA_HOST 0x00ffffff
- #define IN_CLASSA_MAX 128
- #define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000)
- #define IN_CLASSB_NET 0xffff0000
- #define IN_CLASSB_NSHIFT 16
- #define IN_CLASSB_HOST 0x0000ffff
- #define IN_CLASSB_MAX 65536
- #define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000)
- #define IN_CLASSC_NET 0xffffff00
- #define IN_CLASSC_NSHIFT 8
- #define IN_CLASSC_HOST 0x000000ff
- #define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
- #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
- #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
- #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
- #define IN_MULTICAST(i) IN_CLASSD(i)
- #define INADDR_ANY (u_long)0x00000000
- #define INADDR_LOOPBACK 0x7f000001
- #define INADDR_BROADCAST (u_long)0xffffffff
- #define INADDR_NONE 0xffffffff
- #define ADDR_ANY INADDR_ANY
- /*
- * Socket address, internet style.
- */
- struct sockaddr_in {
- short sin_family;
- u_short sin_port;
- struct in_addr sin_addr;
- char sin_zero[8];
- };
- #define WSADESCRIPTION_LEN 256
- #define WSASYS_STATUS_LEN 128
- typedef struct WSAData {
- WORD wVersion;
- WORD wHighVersion;
- #ifdef _WIN64
- unsigned short iMaxSockets;
- unsigned short iMaxUdpDg;
- char FAR * lpVendorInfo;
- char szDescription[WSADESCRIPTION_LEN+1];
- char szSystemStatus[WSASYS_STATUS_LEN+1];
- #else
- char szDescription[WSADESCRIPTION_LEN+1];
- char szSystemStatus[WSASYS_STATUS_LEN+1];
- unsigned short iMaxSockets;
- unsigned short iMaxUdpDg;
- char FAR * lpVendorInfo;
- #endif
- } WSADATA, FAR * LPWSADATA;
- /*
- * Definitions related to sockets: types, address families, options,
- * taken from the BSD file sys/socket.h.
- */
- /*
- * This is used instead of -1, since the
- * SOCKET type is unsigned.
- */
- #define INVALID_SOCKET (SOCKET)(~0)
- #define SOCKET_ERROR (-1)
- /*
- * The following may be used in place of the address family, socket type, or
- * protocol in a call to WSASocket to indicate that the corresponding value
- * should be taken from the supplied WSAPROTOCOL_INFO structure instead of the
- * parameter itself.
- */
- #define FROM_PROTOCOL_INFO (-1)
- /*
- * Types
- */
- #define SOCK_STREAM 1 /* stream socket */
- #define SOCK_DGRAM 2 /* datagram socket */
- #define SOCK_RAW 3 /* raw-protocol interface */
- #define SOCK_RDM 4 /* reliably-delivered message */
- #define SOCK_SEQPACKET 5 /* sequenced packet stream */
- /*
- * Option flags per-socket.
- */
- #define SO_DEBUG 0x0001 /* turn on debugging info recording */
- #define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
- #define SO_REUSEADDR 0x0004 /* allow local address reuse */
- #define SO_KEEPALIVE 0x0008 /* keep connections alive */
- #define SO_DONTROUTE 0x0010 /* just use interface addresses */
- #define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
- #define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
- #define SO_LINGER 0x0080 /* linger on close if data present */
- #define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
- #define SO_DONTLINGER (int)(~SO_LINGER)
- #define SO_EXCLUSIVEADDRUSE ((int)(~SO_REUSEADDR)) /* disallow local address reuse */
- /*
- * Additional options.
- */
- #define SO_SNDBUF 0x1001 /* send buffer size */
- #define SO_RCVBUF 0x1002 /* receive buffer size */
- #define SO_SNDLOWAT 0x1003 /* send low-water mark */
- #define SO_RCVLOWAT 0x1004 /* receive low-water mark */
- #define SO_SNDTIMEO 0x1005 /* send timeout */
- #define SO_RCVTIMEO 0x1006 /* receive timeout */
- #define SO_ERROR 0x1007 /* get error status and clear */
- #define SO_TYPE 0x1008 /* get socket type */
- /*
- * WinSock 2 extension -- new options
- */
- #define SO_GROUP_ID 0x2001 /* ID of a socket group */
- #define SO_GROUP_PRIORITY 0x2002 /* the relative priority within a group*/
- #define SO_MAX_MSG_SIZE 0x2003 /* maximum message size */
- #define SO_PROTOCOL_INFOA 0x2004 /* WSAPROTOCOL_INFOA structure */
- #define SO_PROTOCOL_INFOW 0x2005 /* WSAPROTOCOL_INFOW structure */
- #ifdef UNICODE
- #define SO_PROTOCOL_INFO SO_PROTOCOL_INFOW
- #else
- #define SO_PROTOCOL_INFO SO_PROTOCOL_INFOA
- #endif /* UNICODE */
- #define PVD_CONFIG 0x3001 /* configuration info for service provider */
- #define SO_CONDITIONAL_ACCEPT 0x3002 /* enable true conditional accept: */
- /* connection is not ack-ed to the */
- /* other side until conditional */
- /* function returns CF_ACCEPT */
- /*
- * TCP options.
- */
- #define TCP_NODELAY 0x0001
- /*
- * Address families.
- */
- #define AF_UNSPEC 0 /* unspecified */
- /*
- * Although AF_UNSPEC is defined for backwards compatibility, using
- * AF_UNSPEC for the "af" parameter when creating a socket is STRONGLY
- * DISCOURAGED. The interpretation of the "protocol" parameter
- * depends on the actual address family chosen. As environments grow
- * to include more and more address families that use overlapping
- * protocol values there is more and more chance of choosing an
- * undesired address family when AF_UNSPEC is used.
- */
- #define AF_UNIX 1 /* local to host (pipes, portals) */
- #define AF_INET 2 /* internetwork: UDP, TCP, etc. */
- #define AF_IMPLINK 3 /* arpanet imp addresses */
- #define AF_PUP 4 /* pup protocols: e.g. BSP */
- #define AF_CHAOS 5 /* mit CHAOS protocols */
- #define AF_NS 6 /* XEROX NS protocols */
- #define AF_IPX AF_NS /* IPX protocols: IPX, SPX, etc. */
- #define AF_ISO 7 /* ISO protocols */
- #define AF_OSI AF_ISO /* OSI is ISO */
- #define AF_ECMA 8 /* european computer manufacturers */
- #define AF_DATAKIT 9 /* datakit protocols */
- #define AF_CCITT 10 /* CCITT protocols, X.25 etc */
- #define AF_SNA 11 /* IBM SNA */
- #define AF_DECnet 12 /* DECnet */
- #define AF_DLI 13 /* Direct data link interface */
- #define AF_LAT 14 /* LAT */
- #define AF_HYLINK 15 /* NSC Hyperchannel */
- #define AF_APPLETALK 16 /* AppleTalk */
- #define AF_NETBIOS 17 /* NetBios-style addresses */
- #define AF_VOICEVIEW 18 /* VoiceView */
- #define AF_FIREFOX 19 /* Protocols from Firefox */
- #define AF_UNKNOWN1 20 /* Somebody is using this! */
- #define AF_BAN 21 /* Banyan */
- #define AF_ATM 22 /* Native ATM Services */
- #define AF_INET6 23 /* Internetwork Version 6 */
- #define AF_CLUSTER 24 /* Microsoft Wolfpack */
- #define AF_12844 25 /* IEEE 1284.4 WG AF */
- #define AF_IRDA 26 /* IrDA */
- #define AF_NETDES 28 /* Network Designers OSI & gateway
- enabled protocols */
- #define AF_TCNPROCESS 29
- #define AF_TCNMESSAGE 30
- #define AF_ICLFXBM 31
- #define AF_MAX 32
- /*
- * Structure used by kernel to store most
- * addresses.
- */
- struct sockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
- };
- /*
- * Portable socket structure (RFC 2553).
- */
- /*
- * Desired design of maximum size and alignment.
- * These are implementation specific.
- */
- #define _SS_MAXSIZE 128 // Maximum size.
- #define _SS_ALIGNSIZE (sizeof(__int64)) // Desired alignment.
- /*
- * Definitions used for sockaddr_storage structure paddings design.
- */
- #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short))
- #define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) + _SS_PAD1SIZE \
- + _SS_ALIGNSIZE))
- struct sockaddr_storage {
- short ss_family; // Address family.
- char __ss_pad1[_SS_PAD1SIZE]; // 6 byte pad, this is to make
- // implementation specific pad up to
- // alignment field that follows explicit
- // in the data structure.
- __int64 __ss_align; // Field to force desired structure.
- char __ss_pad2[_SS_PAD2SIZE]; // 112 byte pad to achieve desired size;
- // _SS_MAXSIZE value minus size of
- // ss_family, __ss_pad1, and
- // __ss_align fields is 112.
- };
- /*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
- struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
- };
- /*
- * Protocol families, same as address families for now.
- */
- #define PF_UNSPEC AF_UNSPEC
- #define PF_UNIX AF_UNIX
- #define PF_INET AF_INET
- #define PF_IMPLINK AF_IMPLINK
- #define PF_PUP AF_PUP
- #define PF_CHAOS AF_CHAOS
- #define PF_NS AF_NS
- #define PF_IPX AF_IPX
- #define PF_ISO AF_ISO
- #define PF_OSI AF_OSI
- #define PF_ECMA AF_ECMA
- #define PF_DATAKIT AF_DATAKIT
- #define PF_CCITT AF_CCITT
- #define PF_SNA AF_SNA
- #define PF_DECnet AF_DECnet
- #define PF_DLI AF_DLI
- #define PF_LAT AF_LAT
- #define PF_HYLINK AF_HYLINK
- #define PF_APPLETALK AF_APPLETALK
- #define PF_VOICEVIEW AF_VOICEVIEW
- #define PF_FIREFOX AF_FIREFOX
- #define PF_UNKNOWN1 AF_UNKNOWN1
- #define PF_BAN AF_BAN
- #define PF_ATM AF_ATM
- #define PF_INET6 AF_INET6
- #define PF_MAX AF_MAX
- /*
- * Structure used for manipulating linger option.
- */
- struct linger {
- u_short l_onoff; /* option on/off */
- u_short l_linger; /* linger time */
- };
- /*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
- #define SOL_SOCKET 0xffff /* options for socket level */
- /*
- * Maximum queue length specifiable by listen.
- */
- #define SOMAXCONN 0x7fffffff
- #define MSG_OOB 0x1 /* process out-of-band data */
- #define MSG_PEEK 0x2 /* peek at incoming message */
- #define MSG_DONTROUTE 0x4 /* send without using routing tables */
- #define MSG_PARTIAL 0x8000 /* partial send or recv for message xport */
- /*
- * WinSock 2 extension -- new flags for WSASend(), WSASendTo(), WSARecv() and
- * WSARecvFrom()
- */
- #define MSG_INTERRUPT 0x10 /* send/recv in the interrupt context */
- #define MSG_MAXIOVLEN 16
- /*
- * Define constant based on rfc883, used by gethostbyxxxx() calls.
- */
- #define MAXGETHOSTSTRUCT 1024
- /*
- * WinSock 2 extension -- bit values and indices for FD_XXX network events
- */
- #define FD_READ_BIT 0
- #define FD_READ (1 << FD_READ_BIT)
- #define FD_WRITE_BIT 1
- #define FD_WRITE (1 << FD_WRITE_BIT)
- #define FD_OOB_BIT 2
- #define FD_OOB (1 << FD_OOB_BIT)
- #define FD_ACCEPT_BIT 3
- #define FD_ACCEPT (1 << FD_ACCEPT_BIT)
- #define FD_CONNECT_BIT 4
- #define FD_CONNECT (1 << FD_CONNECT_BIT)
- #define FD_CLOSE_BIT 5
- #define FD_CLOSE (1 << FD_CLOSE_BIT)
- #define FD_QOS_BIT 6
- #define FD_QOS (1 << FD_QOS_BIT)
- #define FD_GROUP_QOS_BIT 7
- #define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT)
- #define FD_ROUTING_INTERFACE_CHANGE_BIT 8
- #define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT)
- #define FD_ADDRESS_LIST_CHANGE_BIT 9
- #define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT)
- #define FD_MAX_EVENTS 10
- #define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1)
- /*
- * WinSock error codes are also defined in winerror.h
- * Hence the IFDEF.
- */
- #ifndef WSABASEERR
- /*
- * All Windows Sockets error constants are biased by WSABASEERR from
- * the "normal"
- */
- #define WSABASEERR 10000
- /*
- * Windows Sockets definitions of regular Microsoft C error constants
- */
- #define WSAEINTR (WSABASEERR+4)
- #define WSAEBADF (WSABASEERR+9)
- #define WSAEACCES (WSABASEERR+13)
- #define WSAEFAULT (WSABASEERR+14)
- #define WSAEINVAL (WSABASEERR+22)
- #define WSAEMFILE (WSABASEERR+24)
- /*
- * Windows Sockets definitions of regular Berkeley error constants
- */
- #define WSAEWOULDBLOCK (WSABASEERR+35)
- #define WSAEINPROGRESS (WSABASEERR+36)
- #define WSAEALREADY (WSABASEERR+37)
- #define WSAENOTSOCK (WSABASEERR+38)
- #define WSAEDESTADDRREQ (WSABASEERR+39)
- #define WSAEMSGSIZE (WSABASEERR+40)
- #define WSAEPROTOTYPE (WSABASEERR+41)
- #define WSAENOPROTOOPT (WSABASEERR+42)
- #define WSAEPROTONOSUPPORT (WSABASEERR+43)
- #define WSAESOCKTNOSUPPORT (WSABASEERR+44)
- #define WSAEOPNOTSUPP (WSABASEERR+45)
- #define WSAEPFNOSUPPORT (WSABASEERR+46)
- #define WSAEAFNOSUPPORT (WSABASEERR+47)
- #define WSAEADDRINUSE (WSABASEERR+48)
- #define WSAEADDRNOTAVAIL (WSABASEERR+49)
- #define WSAENETDOWN (WSABASEERR+50)
- #define WSAENETUNREACH (WSABASEERR+51)
- #define WSAENETRESET (WSABASEERR+52)
- #define WSAECONNABORTED (WSABASEERR+53)
- #define WSAECONNRESET (WSABASEERR+54)
- #define WSAENOBUFS (WSABASEERR+55)
- #define WSAEISCONN (WSABASEERR+56)
- #define WSAENOTCONN (WSABASEERR+57)
- #define WSAESHUTDOWN (WSABASEERR+58)
- #define WSAETOOMANYREFS (WSABASEERR+59)
- #define WSAETIMEDOUT (WSABASEERR+60)
- #define WSAECONNREFUSED (WSABASEERR+61)
- #define WSAELOOP (WSABASEERR+62)
- #define WSAENAMETOOLONG (WSABASEERR+63)
- #define WSAEHOSTDOWN (WSABASEERR+64)
- #define WSAEHOSTUNREACH (WSABASEERR+65)
- #define WSAENOTEMPTY (WSABASEERR+66)
- #define WSAEPROCLIM (WSABASEERR+67)
- #define WSAEUSERS (WSABASEERR+68)
- #define WSAEDQUOT (WSABASEERR+69)
- #define WSAESTALE (WSABASEERR+70)
- #define WSAEREMOTE (WSABASEERR+71)
- /*
- * Extended Windows Sockets error constant definitions
- */
- #define WSASYSNOTREADY (WSABASEERR+91)
- #define WSAVERNOTSUPPORTED (WSABASEERR+92)
- #define WSANOTINITIALISED (WSABASEERR+93)
- #define WSAEDISCON (WSABASEERR+101)
- #define WSAENOMORE (WSABASEERR+102)
- #define WSAECANCELLED (WSABASEERR+103)
- #define WSAEINVALIDPROCTABLE (WSABASEERR+104)
- #define WSAEINVALIDPROVIDER (WSABASEERR+105)
- #define WSAEPROVIDERFAILEDINIT (WSABASEERR+106)
- #define WSASYSCALLFAILURE (WSABASEERR+107)
- #define WSASERVICE_NOT_FOUND (WSABASEERR+108)
- #define WSATYPE_NOT_FOUND (WSABASEERR+109)
- #define WSA_E_NO_MORE (WSABASEERR+110)
- #define WSA_E_CANCELLED (WSABASEERR+111)
- #define WSAEREFUSED (WSABASEERR+112)
- /*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (when using the resolver). Note that these errors are
- * retrieved via WSAGetLastError() and must therefore follow
- * the rules for avoiding clashes with error numbers from
- * specific implementations or language run-time systems.
- * For this reason the codes are based at WSABASEERR+1001.
- * Note also that [WSA]NO_ADDRESS is defined only for
- * compatibility purposes.
- */
- /* Authoritative Answer: Host not found */
- #define WSAHOST_NOT_FOUND (WSABASEERR+1001)
- /* Non-Authoritative: Host not found, or SERVERFAIL */
- #define WSATRY_AGAIN (WSABASEERR+1002)
- /* Non-recoverable errors, FORMERR, REFUSED, NOTIMP */
- #define WSANO_RECOVERY (WSABASEERR+1003)
- /* Valid name, no data record of requested type */
- #define WSANO_DATA (WSABASEERR+1004)
- /*
- * Define QOS related error return codes
- *
- */
- #define WSA_QOS_RECEIVERS (WSABASEERR + 1005)
- /* at least one Reserve has arrived */
- #define WSA_QOS_SENDERS (WSABASEERR + 1006)
- /* at least one Path has arrived */
- #define WSA_QOS_NO_SENDERS (WSABASEERR + 1007)
- /* there are no senders */
- #define WSA_QOS_NO_RECEIVERS (WSABASEERR + 1008)
- /* there are no receivers */
- #define WSA_QOS_REQUEST_CONFIRMED (WSABASEERR + 1009)
- /* Reserve has been confirmed */
- #define WSA_QOS_ADMISSION_FAILURE (WSABASEERR + 1010)
- /* error due to lack of resources */
- #define WSA_QOS_POLICY_FAILURE (WSABASEERR + 1011)
- /* rejected for administrative reasons - bad credentials */
- #define WSA_QOS_BAD_STYLE (WSABASEERR + 1012)
- /* unknown or conflicting style */
- #define WSA_QOS_BAD_OBJECT (WSABASEERR + 1013)
- /* problem with some part of the filterspec or providerspecific
- * buffer in general */
- #define WSA_QOS_TRAFFIC_CTRL_ERROR (WSABASEERR + 1014)
- /* problem with some part of the flowspec */
- #define WSA_QOS_GENERIC_ERROR (WSABASEERR + 1015)
- /* general error */
- #define WSA_QOS_ESERVICETYPE (WSABASEERR + 1016)
- /* invalid service type in flowspec */
- #define WSA_QOS_EFLOWSPEC (WSABASEERR + 1017)
- /* invalid flowspec */
- #define WSA_QOS_EPROVSPECBUF (WSABASEERR + 1018)
- /* invalid provider specific buffer */
- #define WSA_QOS_EFILTERSTYLE (WSABASEERR + 1019)
- /* invalid filter style */
- #define WSA_QOS_EFILTERTYPE (WSABASEERR + 1020)
- /* invalid filter type */
- #define WSA_QOS_EFILTERCOUNT (WSABASEERR + 1021)
- /* incorrect number of filters */
- #define WSA_QOS_EOBJLENGTH (WSABASEERR + 1022)
- /* invalid object length */
- #define WSA_QOS_EFLOWCOUNT (WSABASEERR + 1023)
- /* incorrect number of flows */
- #define WSA_QOS_EUNKOWNPSOBJ (WSABASEERR + 1024)
- /* unknown object in provider specific buffer */
- #define WSA_QOS_EPOLICYOBJ (WSABASEERR + 1025)
- /* invalid policy object in provider specific buffer */
- #define WSA_QOS_EFLOWDESC (WSABASEERR + 1026)
- /* invalid flow descriptor in the list */
- #define WSA_QOS_EPSFLOWSPEC (WSABASEERR + 1027)
- /* inconsistent flow spec in provider specific buffer */
- #define WSA_QOS_EPSFILTERSPEC (WSABASEERR + 1028)
- /* invalid filter spec in provider specific buffer */
- #define WSA_QOS_ESDMODEOBJ (WSABASEERR + 1029)
- /* invalid shape discard mode object in provider specific buffer */
- #define WSA_QOS_ESHAPERATEOBJ (WSABASEERR + 1030)
- /* invalid shaping rate object in provider specific buffer */
- #define WSA_QOS_RESERVED_PETYPE (WSABASEERR + 1031)
- /* reserved policy element in provider specific buffer */
- /*
- * WinSock error codes are also defined in winerror.h
- * Hence the IFDEF.
- */
- #endif /* ifdef WSABASEERR */
- /*
- * Compatibility macros.
- */
- #define h_errno WSAGetLastError()
- #define HOST_NOT_FOUND WSAHOST_NOT_FOUND
- #define TRY_AGAIN WSATRY_AGAIN
- #define NO_RECOVERY WSANO_RECOVERY
- #define NO_DATA WSANO_DATA
- /* no address, look for MX record */
- #define WSANO_ADDRESS WSANO_DATA
- #define NO_ADDRESS WSANO_ADDRESS
- /*
- * Windows Sockets errors redefined as regular Berkeley error constants.
- * These are commented out in Windows NT to avoid conflicts with errno.h.
- * Use the WSA constants instead.
- */
- #if 0
- #define EWOULDBLOCK WSAEWOULDBLOCK
- #define EINPROGRESS WSAEINPROGRESS
- #define EALREADY WSAEALREADY
- #define ENOTSOCK WSAENOTSOCK
- #define EDESTADDRREQ WSAEDESTADDRREQ
- #define EMSGSIZE WSAEMSGSIZE
- #define EPROTOTYPE WSAEPROTOTYPE
- #define ENOPROTOOPT WSAENOPROTOOPT
- #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
- #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
- #define EOPNOTSUPP WSAEOPNOTSUPP
- #define EPFNOSUPPORT WSAEPFNOSUPPORT
- #define EAFNOSUPPORT WSAEAFNOSUPPORT
- #define EADDRINUSE WSAEADDRINUSE
- #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
- #define ENETDOWN WSAENETDOWN
- #define ENETUNREACH WSAENETUNREACH
- #define ENETRESET WSAENETRESET
- #define ECONNABORTED WSAECONNABORTED
- #define ECONNRESET WSAECONNRESET
- #define ENOBUFS WSAENOBUFS
- #define EISCONN WSAEISCONN
- #define ENOTCONN WSAENOTCONN
- #define ESHUTDOWN WSAESHUTDOWN
- #define ETOOMANYREFS WSAETOOMANYREFS
- #define ETIMEDOUT WSAETIMEDOUT
- #define ECONNREFUSED WSAECONNREFUSED
- #define ELOOP WSAELOOP
- #define ENAMETOOLONG WSAENAMETOOLONG
- #define EHOSTDOWN WSAEHOSTDOWN
- #define EHOSTUNREACH WSAEHOSTUNREACH
- #define ENOTEMPTY WSAENOTEMPTY
- #define EPROCLIM WSAEPROCLIM
- #define EUSERS WSAEUSERS
- #define EDQUOT WSAEDQUOT
- #define ESTALE WSAESTALE
- #define EREMOTE WSAEREMOTE
- #endif
- /*
- * WinSock 2 extension -- new error codes and type definition
- */
- #ifdef WIN32
- #define WSAAPI FAR PASCAL
- #define WSAEVENT HANDLE
- #define LPWSAEVENT LPHANDLE
- #define WSAOVERLAPPED OVERLAPPED
- typedef struct _OVERLAPPED * LPWSAOVERLAPPED;
- #define WSA_IO_PENDING (ERROR_IO_PENDING)
- #define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
- #define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
- #define WSA_INVALID_PARAMETER (ERROR_INVALID_PARAMETER)
- #define WSA_NOT_ENOUGH_MEMORY (ERROR_NOT_ENOUGH_MEMORY)
- #define WSA_OPERATION_ABORTED (ERROR_OPERATION_ABORTED)
- #define WSA_INVALID_EVENT ((WSAEVENT)NULL)
- #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
- #define WSA_WAIT_FAILED (WAIT_FAILED)
- #define WSA_WAIT_EVENT_0 (WAIT_OBJECT_0)
- #define WSA_WAIT_IO_COMPLETION (WAIT_IO_COMPLETION)
- #define WSA_WAIT_TIMEOUT (WAIT_TIMEOUT)
- #define WSA_INFINITE (INFINITE)
- #else /* WIN16 */
- #define WSAAPI FAR PASCAL
- typedef DWORD WSAEVENT, FAR * LPWSAEVENT;
- typedef struct _WSAOVERLAPPED {
- DWORD Internal;
- DWORD InternalHigh;
- DWORD Offset;
- DWORD OffsetHigh;
- WSAEVENT hEvent;
- } WSAOVERLAPPED, FAR * LPWSAOVERLAPPED;
- #define WSA_IO_PENDING (WSAEWOULDBLOCK)
- #define WSA_IO_INCOMPLETE (WSAEWOULDBLOCK)
- #define WSA_INVALID_HANDLE (WSAENOTSOCK)
- #define WSA_INVALID_PARAMETER (WSAEINVAL)
- #define WSA_NOT_ENOUGH_MEMORY (WSAENOBUFS)
- #define WSA_OPERATION_ABORTED (WSAEINTR)
- #define WSA_INVALID_EVENT ((WSAEVENT)NULL)
- #define WSA_MAXIMUM_WAIT_EVENTS (MAXIMUM_WAIT_OBJECTS)
- #define WSA_WAIT_FAILED ((DWORD)-1L)
- #define WSA_WAIT_EVENT_0 ((DWORD)0)
- #define WSA_WAIT_TIMEOUT ((DWORD)0x102L)
- #define WSA_INFINITE ((DWORD)-1L)
- #endif /* WIN32 */
- /*
- * WinSock 2 extension -- WSABUF and QOS struct, include qos.h
- * to pull in FLOWSPEC and related definitions
- */
- typedef struct _WSABUF {
- u_long len; /* the length of the buffer */
- char FAR * buf; /* the pointer to the buffer */
- } WSABUF, FAR * LPWSABUF;
- #include <qos.h>
- typedef struct _QualityOfService
- {
- FLOWSPEC SendingFlowspec; /* the flow spec for data sending */
- FLOWSPEC ReceivingFlowspec; /* the flow spec for data receiving */
- WSABUF ProviderSpecific; /* additional provider specific stuff */
- } QOS, FAR * LPQOS;
- /*
- * WinSock 2 extension -- manifest constants for return values of the condition function
- */
- #define CF_ACCEPT 0x0000
- #define CF_REJECT 0x0001
- #define CF_DEFER 0x0002
- /*
- * WinSock 2 extension -- manifest constants for shutdown()
- */
- #define SD_RECEIVE 0x00
- #define SD_SEND 0x01
- #define SD_BOTH 0x02
- /*
- * WinSock 2 extension -- data type and manifest constants for socket groups
- */
- typedef unsigned int GROUP;
- #define SG_UNCONSTRAINED_GROUP 0x01
- #define SG_CONSTRAINED_GROUP 0x02
- /*
- * WinSock 2 extension -- data type for WSAEnumNetworkEvents()
- */
- typedef struct _WSANETWORKEVENTS {
- long lNetworkEvents;
- int iErrorCode[FD_MAX_EVENTS];
- } WSANETWORKEVENTS, FAR * LPWSANETWORKEVENTS;
- /*
- * WinSock 2 extension -- WSAPROTOCOL_INFO structure and associated
- * manifest constants
- */
- #ifndef GUID_DEFINED
- #include <guiddef.h>
- #endif /* GUID_DEFINED */
- #define MAX_PROTOCOL_CHAIN 7
- #define BASE_PROTOCOL 1
- #define LAYERED_PROTOCOL 0
- typedef struct _WSAPROTOCOLCHAIN {
- int ChainLen; /* the length of the chain, */
- /* length = 0 means layered protocol, */
- /* length = 1 means base protocol, */
- /* length > 1 means protocol chain */
- DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */
- } WSAPROTOCOLCHAIN, FAR * LPWSAPROTOCOLCHAIN;
- #define WSAPROTOCOL_LEN 255
- typedef struct _WSAPROTOCOL_INFOA {
- DWORD dwServiceFlags1;
- DWORD dwServiceFlags2;
- DWORD dwServiceFlags3;
- DWORD dwServiceFlags4;
- DWORD dwProviderFlags;
- GUID ProviderId;
- DWORD dwCatalogEntryId;
- WSAPROTOCOLCHAIN ProtocolChain;
- int iVersion;
- int iAddressFamily;
- int iMaxSockAddr;
- int iMinSockAddr;
- int iSocketType;
- int iProtocol;
- int iProtocolMaxOffset;
- int iNetworkByteOrder;
- int iSecurityScheme;
- DWORD dwMessageSize;
- DWORD dwProviderReserved;
- CHAR szProtocol[WSAPROTOCOL_LEN+1];
- } WSAPROTOCOL_INFOA, FAR * LPWSAPROTOCOL_INFOA;
- typedef struct _WSAPROTOCOL_INFOW {
- DWORD dwServiceFlags1;
- DWORD dwServiceFlags2;
- DWORD dwServiceFlags3;
- DWORD dwServiceFlags4;
- DWORD dwProviderFlags;
- GUID ProviderId;
- DWORD dwCatalogEntryId;
- WSAPROTOCOLCHAIN ProtocolChain;
- int iVersion;
- int iAddressFamily;
- int iMaxSockAddr;
- int iMinSockAddr;
- int iSocketType;
- int iProtocol;
- int iProtocolMaxOffset;
- int iNetworkByteOrder;
- int iSecurityScheme;
- DWORD dwMessageSize;
- DWORD dwProviderReserved;
- WCHAR szProtocol[WSAPROTOCOL_LEN+1];
- } WSAPROTOCOL_INFOW, FAR * LPWSAPROTOCOL_INFOW;
- #ifdef UNICODE
- typedef WSAPROTOCOL_INFOW WSAPROTOCOL_INFO;
- typedef LPWSAPROTOCOL_INFOW LPWSAPROTOCOL_INFO;
- #else
- typedef WSAPROTOCOL_INFOA WSAPROTOCOL_INFO;
- typedef LPWSAPROTOCOL_INFOA LPWSAPROTOCOL_INFO;
- #endif /* UNICODE */
- /* Flag bit definitions for dwProviderFlags */
- #define PFL_MULTIPLE_PROTO_ENTRIES 0x00000001
- #define PFL_RECOMMENDED_PROTO_ENTRY 0x00000002
- #define PFL_HIDDEN 0x00000004
- #define PFL_MATCHES_PROTOCOL_ZERO 0x00000008
- /* Flag bit definitions for dwServiceFlags1 */
- #define XP1_CONNECTIONLESS 0x00000001
- #define XP1_GUARANTEED_DELIVERY 0x00000002
- #define XP1_GUARANTEED_ORDER 0x00000004
- #define XP1_MESSAGE_ORIENTED 0x00000008
- #define XP1_PSEUDO_STREAM 0x00000010
- #define XP1_GRACEFUL_CLOSE 0x00000020
- #define XP1_EXPEDITED_DATA 0x00000040
- #define XP1_CONNECT_DATA 0x00000080
- #define XP1_DISCONNECT_DATA 0x00000100
- #define XP1_SUPPORT_BROADCAST 0x00000200
- #define XP1_SUPPORT_MULTIPOINT 0x00000400
- #define XP1_MULTIPOINT_CONTROL_PLANE 0x00000800
- #define XP1_MULTIPOINT_DATA_PLANE 0x00001000
- #define XP1_QOS_SUPPORTED 0x00002000
- #define XP1_INTERRUPT 0x00004000
- #define XP1_UNI_SEND 0x00008000
- #define XP1_UNI_RECV 0x00010000
- #define XP1_IFS_HANDLES 0x00020000
- #define XP1_PARTIAL_MESSAGE 0x00040000
- #define BIGENDIAN 0x0000
- #define LITTLEENDIAN 0x0001
- #define SECURITY_PROTOCOL_NONE 0x0000
- /*
- * WinSock 2 extension -- manifest constants for WSAJoinLeaf()
- */
- #define JL_SENDER_ONLY 0x01
- #define JL_RECEIVER_ONLY 0x02
- #define JL_BOTH 0x04
- /*
- * WinSock 2 extension -- manifest constants for WSASocket()
- */
- #define WSA_FLAG_OVERLAPPED 0x01
- #define WSA_FLAG_MULTIPOINT_C_ROOT 0x02
- #define WSA_FLAG_MULTIPOINT_C_LEAF 0x04
- #define WSA_FLAG_MULTIPOINT_D_ROOT 0x08
- #define WSA_FLAG_MULTIPOINT_D_LEAF 0x10
- /*
- * WinSock 2 extension -- manifest constants for WSAIoctl()
- */
- #define IOC_UNIX 0x00000000
- #define IOC_WS2 0x08000000
- #define IOC_PROTOCOL 0x10000000
- #define IOC_VENDOR 0x18000000
- #define _WSAIO(x,y) (IOC_VOID|(x)|(y))
- #define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
- #define _WSAIOW(x,y) (IOC_IN|(x)|(y))
- #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
- #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
- #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
- #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
- #define SIO_FLUSH _WSAIO(IOC_WS2,4)
- #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
- #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
- #define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
- #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
- #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
- #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
- #define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
- #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
- #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
- #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
- #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
- #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
- #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
- #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24)
- #define SIO_ADDRESS_LIST_SORT _WSAIORW(IOC_WS2,25)
- /*
- * WinSock 2 extensions -- data types for the condition function in
- * WSAAccept() and overlapped I/O completion routine.
- */
- typedef
- int
- (CALLBACK * LPCONDITIONPROC)(
- IN LPWSABUF lpCallerId,
- IN LPWSABUF lpCallerData,
- IN OUT LPQOS lpSQOS,
- IN OUT LPQOS lpGQOS,
- IN LPWSABUF lpCalleeId,
- IN LPWSABUF lpCalleeData,
- OUT GROUP FAR * g,
- IN DWORD_PTR dwCallbackData
- );
- typedef
- void
- (CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(
- IN DWORD dwError,
- IN DWORD cbTransferred,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN DWORD dwFlags
- );
- /*
- * WinSock 2 extension -- manifest constants and associated structures
- * for WSANSPIoctl()
- */
- #define SIO_NSP_NOTIFY_CHANGE _WSAIOW(IOC_WS2,25)
- typedef enum _WSACOMPLETIONTYPE {
- NSP_NOTIFY_IMMEDIATELY = 0,
- NSP_NOTIFY_HWND,
- NSP_NOTIFY_EVENT,
- NSP_NOTIFY_PORT,
- NSP_NOTIFY_APC,
- } WSACOMPLETIONTYPE, *PWSACOMPLETIONTYPE, FAR * LPWSACOMPLETIONTYPE;
- typedef struct _WSACOMPLETION {
- WSACOMPLETIONTYPE Type;
- union {
- struct {
- HWND hWnd;
- UINT uMsg;
- WPARAM context;
- } WindowMessage;
- struct {
- LPWSAOVERLAPPED lpOverlapped;
- } Event;
- struct {
- LPWSAOVERLAPPED lpOverlapped;
- LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc;
- } Apc;
- struct {
- LPWSAOVERLAPPED lpOverlapped;
- HANDLE hPort;
- ULONG_PTR Key;
- } Port;
- } Parameters;
- } WSACOMPLETION, *PWSACOMPLETION, FAR *LPWSACOMPLETION;
- /*
- * WinSock 2 extension -- manifest constants for SIO_TRANSLATE_HANDLE ioctl
- */
- #define TH_NETDEV 0x00000001
- #define TH_TAPI 0x00000002
- /*
- * Microsoft Windows Extended data types required for the functions to
- * convert back and forth between binary and string forms of
- * addresses.
- */
- typedef struct sockaddr SOCKADDR;
- typedef struct sockaddr *PSOCKADDR;
- typedef struct sockaddr FAR *LPSOCKADDR;
- typedef struct sockaddr_storage SOCKADDR_STORAGE;
- typedef struct sockaddr_storage *PSOCKADDR_STORAGE;
- typedef struct sockaddr_storage FAR *LPSOCKADDR_STORAGE;
- /*
- * Manifest constants and type definitions related to name resolution and
- * registration (RNR) API
- */
- #ifndef _tagBLOB_DEFINED
- #define _tagBLOB_DEFINED
- #define _BLOB_DEFINED
- #define _LPBLOB_DEFINED
- typedef struct _BLOB {
- ULONG cbSize ;
- #ifdef MIDL_PASS
- [size_is(cbSize)] BYTE *pBlobData;
- #else /* MIDL_PASS */
- BYTE *pBlobData ;
- #endif /* MIDL_PASS */
- } BLOB, *LPBLOB ;
- #endif
- /*
- * Service Install Flags
- */
- #define SERVICE_MULTIPLE (0x00000001)
- /*
- *& Name Spaces
- */
- #define NS_ALL (0)
- #define NS_SAP (1)
- #define NS_NDS (2)
- #define NS_PEER_BROWSE (3)
- #define NS_SLP (5)
- #define NS_DHCP (6)
- #define NS_TCPIP_LOCAL (10)
- #define NS_TCPIP_HOSTS (11)
- #define NS_DNS (12)
- #define NS_NETBT (13)
- #define NS_WINS (14)
- #define NS_NLA (15) /* Network Location Awareness */
- #define NS_NBP (20)
- #define NS_MS (30)
- #define NS_STDA (31)
- #define NS_NTDS (32)
- #define NS_X500 (40)
- #define NS_NIS (41)
- #define NS_NISPLUS (42)
- #define NS_WRQ (50)
- #define NS_NETDES (60) /* Network Designers Limited */
- /*
- * Resolution flags for WSAGetAddressByName().
- * Note these are also used by the 1.1 API GetAddressByName, so
- * leave them around.
- */
- #define RES_UNUSED_1 (0x00000001)
- #define RES_FLUSH_CACHE (0x00000002)
- #ifndef RES_SERVICE
- #define RES_SERVICE (0x00000004)
- #endif /* RES_SERVICE */
- /*
- * Well known value names for Service Types
- */
- #define SERVICE_TYPE_VALUE_IPXPORTA "IpxSocket"
- #define SERVICE_TYPE_VALUE_IPXPORTW L"IpxSocket"
- #define SERVICE_TYPE_VALUE_SAPIDA "SapId"
- #define SERVICE_TYPE_VALUE_SAPIDW L"SapId"
- #define SERVICE_TYPE_VALUE_TCPPORTA "TcpPort"
- #define SERVICE_TYPE_VALUE_TCPPORTW L"TcpPort"
- #define SERVICE_TYPE_VALUE_UDPPORTA "UdpPort"
- #define SERVICE_TYPE_VALUE_UDPPORTW L"UdpPort"
- #define SERVICE_TYPE_VALUE_OBJECTIDA "ObjectId"
- #define SERVICE_TYPE_VALUE_OBJECTIDW L"ObjectId"
- #ifdef UNICODE
- #define SERVICE_TYPE_VALUE_SAPID SERVICE_TYPE_VALUE_SAPIDW
- #define SERVICE_TYPE_VALUE_TCPPORT SERVICE_TYPE_VALUE_TCPPORTW
- #define SERVICE_TYPE_VALUE_UDPPORT SERVICE_TYPE_VALUE_UDPPORTW
- #define SERVICE_TYPE_VALUE_OBJECTID SERVICE_TYPE_VALUE_OBJECTIDW
- #else /* not UNICODE */
- #define SERVICE_TYPE_VALUE_SAPID SERVICE_TYPE_VALUE_SAPIDA
- #define SERVICE_TYPE_VALUE_TCPPORT SERVICE_TYPE_VALUE_TCPPORTA
- #define SERVICE_TYPE_VALUE_UDPPORT SERVICE_TYPE_VALUE_UDPPORTA
- #define SERVICE_TYPE_VALUE_OBJECTID SERVICE_TYPE_VALUE_OBJECTIDA
- #endif
- #ifndef __CSADDR_DEFINED__
- #define __CSADDR_DEFINED__
- /*
- * SockAddr Information
- */
- typedef struct _SOCKET_ADDRESS {
- LPSOCKADDR lpSockaddr ;
- INT iSockaddrLength ;
- } SOCKET_ADDRESS, *PSOCKET_ADDRESS, FAR * LPSOCKET_ADDRESS ;
- /*
- * CSAddr Information
- */
- typedef struct _CSADDR_INFO {
- SOCKET_ADDRESS LocalAddr ;
- SOCKET_ADDRESS RemoteAddr ;
- INT iSocketType ;
- INT iProtocol ;
- } CSADDR_INFO, *PCSADDR_INFO, FAR * LPCSADDR_INFO ;
- #endif /* __CSADDR_DEFINED__ */
- /*
- * Address list returned via SIO_ADDRESS_LIST_QUERY
- */
- typedef struct _SOCKET_ADDRESS_LIST {
- INT iAddressCount;
- SOCKET_ADDRESS Address[1];
- } SOCKET_ADDRESS_LIST, FAR * LPSOCKET_ADDRESS_LIST;
- /*
- * Address Family/Protocol Tuples
- */
- typedef struct _AFPROTOCOLS {
- INT iAddressFamily;
- INT iProtocol;
- } AFPROTOCOLS, *PAFPROTOCOLS, *LPAFPROTOCOLS;
- /*
- * Client Query API Typedefs
- */
- /*
- * The comparators
- */
- typedef enum _WSAEcomparator
- {
- COMP_EQUAL = 0,
- COMP_NOTLESS
- } WSAECOMPARATOR, *PWSAECOMPARATOR, *LPWSAECOMPARATOR;
- typedef struct _WSAVersion
- {
- DWORD dwVersion;
- WSAECOMPARATOR ecHow;
- }WSAVERSION, *PWSAVERSION, *LPWSAVERSION;
- typedef struct _WSAQuerySetA
- {
- DWORD dwSize;
- LPSTR lpszServiceInstanceName;
- LPGUID lpServiceClassId;
- LPWSAVERSION lpVersion;
- LPSTR lpszComment;
- DWORD dwNameSpace;
- LPGUID lpNSProviderId;
- LPSTR lpszContext;
- DWORD dwNumberOfProtocols;
- LPAFPROTOCOLS lpafpProtocols;
- LPSTR lpszQueryString;
- DWORD dwNumberOfCsAddrs;
- LPCSADDR_INFO lpcsaBuffer;
- DWORD dwOutputFlags;
- LPBLOB lpBlob;
- } WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA;
- typedef struct _WSAQuerySetW
- {
- DWORD dwSize;
- LPWSTR lpszServiceInstanceName;
- LPGUID lpServiceClassId;
- LPWSAVERSION lpVersion;
- LPWSTR lpszComment;
- DWORD dwNameSpace;
- LPGUID lpNSProviderId;
- LPWSTR lpszContext;
- DWORD dwNumberOfProtocols;
- LPAFPROTOCOLS lpafpProtocols;
- LPWSTR lpszQueryString;
- DWORD dwNumberOfCsAddrs;
- LPCSADDR_INFO lpcsaBuffer;
- DWORD dwOutputFlags;
- LPBLOB lpBlob;
- } WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW;
- #ifdef UNICODE
- typedef WSAQUERYSETW WSAQUERYSET;
- typedef PWSAQUERYSETW PWSAQUERYSET;
- typedef LPWSAQUERYSETW LPWSAQUERYSET;
- #else
- typedef WSAQUERYSETA WSAQUERYSET;
- typedef PWSAQUERYSETA PWSAQUERYSET;
- typedef LPWSAQUERYSETA LPWSAQUERYSET;
- #endif /* UNICODE */
- #define LUP_DEEP 0x0001
- #define LUP_CONTAINERS 0x0002
- #define LUP_NOCONTAINERS 0x0004
- #define LUP_NEAREST 0x0008
- #define LUP_RETURN_NAME 0x0010
- #define LUP_RETURN_TYPE 0x0020
- #define LUP_RETURN_VERSION 0x0040
- #define LUP_RETURN_COMMENT 0x0080
- #define LUP_RETURN_ADDR 0x0100
- #define LUP_RETURN_BLOB 0x0200
- #define LUP_RETURN_ALIASES 0x0400
- #define LUP_RETURN_QUERY_STRING 0x0800
- #define LUP_RETURN_ALL 0x0FF0
- #define LUP_RES_SERVICE 0x8000
- #define LUP_FLUSHCACHE 0x1000
- #define LUP_FLUSHPREVIOUS 0x2000
- /*
- * Return flags
- */
- #define RESULT_IS_ALIAS 0x0001
- #define RESULT_IS_ADDED 0x0010
- #define RESULT_IS_CHANGED 0x0020
- #define RESULT_IS_DELETED 0x0040
- /*
- * Service Address Registration and Deregistration Data Types.
- */
- typedef enum _WSAESETSERVICEOP
- {
- RNRSERVICE_REGISTER=0,
- RNRSERVICE_DEREGISTER,
- RNRSERVICE_DELETE
- } WSAESETSERVICEOP, *PWSAESETSERVICEOP, *LPWSAESETSERVICEOP;
- /*
- * Service Installation/Removal Data Types.
- */
- typedef struct _WSANSClassInfoA
- {
- LPSTR lpszName;
- DWORD dwNameSpace;
- DWORD dwValueType;
- DWORD dwValueSize;
- LPVOID lpValue;
- }WSANSCLASSINFOA, *PWSANSCLASSINFOA, *LPWSANSCLASSINFOA;
- typedef struct _WSANSClassInfoW
- {
- LPWSTR lpszName;
- DWORD dwNameSpace;
- DWORD dwValueType;
- DWORD dwValueSize;
- LPVOID lpValue;
- }WSANSCLASSINFOW, *PWSANSCLASSINFOW, *LPWSANSCLASSINFOW;
- #ifdef UNICODE
- typedef WSANSCLASSINFOW WSANSCLASSINFO;
- typedef PWSANSCLASSINFOW PWSANSCLASSINFO;
- typedef LPWSANSCLASSINFOW LPWSANSCLASSINFO;
- #else
- typedef WSANSCLASSINFOA WSANSCLASSINFO;
- typedef PWSANSCLASSINFOA PWSANSCLASSINFO;
- typedef LPWSANSCLASSINFOA LPWSANSCLASSINFO;
- #endif /* UNICODE */
- typedef struct _WSAServiceClassInfoA
- {
- LPGUID lpServiceClassId;
- LPSTR lpszServiceClassName;
- DWORD dwCount;
- LPWSANSCLASSINFOA lpClassInfos;
- }WSASERVICECLASSINFOA, *PWSASERVICECLASSINFOA, *LPWSASERVICECLASSINFOA;
- typedef struct _WSAServiceClassInfoW
- {
- LPGUID lpServiceClassId;
- LPWSTR lpszServiceClassName;
- DWORD dwCount;
- LPWSANSCLASSINFOW lpClassInfos;
- }WSASERVICECLASSINFOW, *PWSASERVICECLASSINFOW, *LPWSASERVICECLASSINFOW;
- #ifdef UNICODE
- typedef WSASERVICECLASSINFOW WSASERVICECLASSINFO;
- typedef PWSASERVICECLASSINFOW PWSASERVICECLASSINFO;
- typedef LPWSASERVICECLASSINFOW LPWSASERVICECLASSINFO;
- #else
- typedef WSASERVICECLASSINFOA WSASERVICECLASSINFO;
- typedef PWSASERVICECLASSINFOA PWSASERVICECLASSINFO;
- typedef LPWSASERVICECLASSINFOA LPWSASERVICECLASSINFO;
- #endif /* UNICODE */
- typedef struct _WSANAMESPACE_INFOA {
- GUID NSProviderId;
- DWORD dwNameSpace;
- BOOL fActive;
- DWORD dwVersion;
- LPSTR lpszIdentifier;
- } WSANAMESPACE_INFOA, *PWSANAMESPACE_INFOA, *LPWSANAMESPACE_INFOA;
- typedef struct _WSANAMESPACE_INFOW {
- GUID NSProviderId;
- DWORD dwNameSpace;
- BOOL fActive;
- DWORD dwVersion;
- LPWSTR lpszIdentifier;
- } WSANAMESPACE_INFOW, *PWSANAMESPACE_INFOW, *LPWSANAMESPACE_INFOW;
- #ifdef UNICODE
- typedef WSANAMESPACE_INFOW WSANAMESPACE_INFO;
- typedef PWSANAMESPACE_INFOW PWSANAMESPACE_INFO;
- typedef LPWSANAMESPACE_INFOW LPWSANAMESPACE_INFO;
- #else
- typedef WSANAMESPACE_INFOA WSANAMESPACE_INFO;
- typedef PWSANAMESPACE_INFOA PWSANAMESPACE_INFO;
- typedef LPWSANAMESPACE_INFOA LPWSANAMESPACE_INFO;
- #endif /* UNICODE */
- /* Socket function prototypes */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- SOCKET
- WSAAPI
- accept(
- IN SOCKET s,
- OUT struct sockaddr FAR * addr,
- IN OUT int FAR * addrlen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- SOCKET
- (WSAAPI * LPFN_ACCEPT)(
- IN SOCKET s,
- OUT struct sockaddr FAR * addr,
- IN OUT int FAR * addrlen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- bind(
- IN SOCKET s,
- IN const struct sockaddr FAR * name,
- IN int namelen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_BIND)(
- IN SOCKET s,
- IN const struct sockaddr FAR * name,
- IN int namelen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- closesocket(
- IN SOCKET s
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_CLOSESOCKET)(
- IN SOCKET s
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- connect(
- IN SOCKET s,
- IN const struct sockaddr FAR * name,
- IN int namelen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_CONNECT)(
- IN SOCKET s,
- IN const struct sockaddr FAR * name,
- IN int namelen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- ioctlsocket(
- IN SOCKET s,
- IN long cmd,
- IN OUT u_long FAR * argp
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_IOCTLSOCKET)(
- IN SOCKET s,
- IN long cmd,
- IN OUT u_long FAR * argp
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- getpeername(
- IN SOCKET s,
- OUT struct sockaddr FAR * name,
- IN OUT int FAR * namelen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_GETPEERNAME)(
- IN SOCKET s,
- IN struct sockaddr FAR * name,
- IN OUT int FAR * namelen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- getsockname(
- IN SOCKET s,
- OUT struct sockaddr FAR * name,
- IN OUT int FAR * namelen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_GETSOCKNAME)(
- IN SOCKET s,
- OUT struct sockaddr FAR * name,
- IN OUT int FAR * namelen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- getsockopt(
- IN SOCKET s,
- IN int level,
- IN int optname,
- OUT char FAR * optval,
- IN OUT int FAR * optlen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_GETSOCKOPT)(
- IN SOCKET s,
- IN int level,
- IN int optname,
- OUT char FAR * optval,
- IN OUT int FAR * optlen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- u_long
- WSAAPI
- htonl(
- IN u_long hostlong
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- u_long
- (WSAAPI * LPFN_HTONL)(
- IN u_long hostlong
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- u_short
- WSAAPI
- htons(
- IN u_short hostshort
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- u_short
- (WSAAPI * LPFN_HTONS)(
- IN u_short hostshort
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- unsigned long
- WSAAPI
- inet_addr(
- IN const char FAR * cp
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- unsigned long
- (WSAAPI * LPFN_INET_ADDR)(
- IN const char FAR * cp
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- char FAR *
- WSAAPI
- inet_ntoa(
- IN struct in_addr in
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- char FAR *
- (WSAAPI * LPFN_INET_NTOA)(
- IN struct in_addr in
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- listen(
- IN SOCKET s,
- IN int backlog
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_LISTEN)(
- IN SOCKET s,
- IN int backlog
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- u_long
- WSAAPI
- ntohl(
- IN u_long netlong
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- u_long
- (WSAAPI * LPFN_NTOHL)(
- IN u_long netlong
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- u_short
- WSAAPI
- ntohs(
- IN u_short netshort
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- u_short
- (WSAAPI * LPFN_NTOHS)(
- IN u_short netshort
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- recv(
- IN SOCKET s,
- OUT char FAR * buf,
- IN int len,
- IN int flags
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_RECV)(
- IN SOCKET s,
- OUT char FAR * buf,
- IN int len,
- IN int flags
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- recvfrom(
- IN SOCKET s,
- OUT char FAR * buf,
- IN int len,
- IN int flags,
- OUT struct sockaddr FAR * from,
- IN OUT int FAR * fromlen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_RECVFROM)(
- IN SOCKET s,
- OUT char FAR * buf,
- IN int len,
- IN int flags,
- OUT struct sockaddr FAR * from,
- IN OUT int FAR * fromlen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- select(
- IN int nfds,
- IN OUT fd_set FAR * readfds,
- IN OUT fd_set FAR * writefds,
- IN OUT fd_set FAR *exceptfds,
- IN const struct timeval FAR * timeout
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_SELECT)(
- IN int nfds,
- IN OUT fd_set FAR * readfds,
- IN OUT fd_set FAR * writefds,
- IN OUT fd_set FAR *exceptfds,
- IN const struct timeval FAR * timeout
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- send(
- IN SOCKET s,
- IN const char FAR * buf,
- IN int len,
- IN int flags
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_SEND)(
- IN SOCKET s,
- IN const char FAR * buf,
- IN int len,
- IN int flags
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- sendto(
- IN SOCKET s,
- IN const char FAR * buf,
- IN int len,
- IN int flags,
- IN const struct sockaddr FAR * to,
- IN int tolen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_SENDTO)(
- IN SOCKET s,
- IN const char FAR * buf,
- IN int len,
- IN int flags,
- IN const struct sockaddr FAR * to,
- IN int tolen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- setsockopt(
- IN SOCKET s,
- IN int level,
- IN int optname,
- IN const char FAR * optval,
- IN int optlen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_SETSOCKOPT)(
- IN SOCKET s,
- IN int level,
- IN int optname,
- IN const char FAR * optval,
- IN int optlen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- shutdown(
- IN SOCKET s,
- IN int how
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_SHUTDOWN)(
- IN SOCKET s,
- IN int how
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- SOCKET
- WSAAPI
- socket(
- IN int af,
- IN int type,
- IN int protocol
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- SOCKET
- (WSAAPI * LPFN_SOCKET)(
- IN int af,
- IN int type,
- IN int protocol
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- /* Database function prototypes */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- struct hostent FAR *
- WSAAPI
- gethostbyaddr(
- IN const char FAR * addr,
- IN int len,
- IN int type
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- struct hostent FAR *
- (WSAAPI * LPFN_GETHOSTBYADDR)(
- IN const char FAR * addr,
- IN int len,
- IN int type
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- struct hostent FAR *
- WSAAPI
- gethostbyname(
- IN const char FAR * name
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- struct hostent FAR *
- (WSAAPI * LPFN_GETHOSTBYNAME)(
- IN const char FAR * name
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- gethostname(
- OUT char FAR * name,
- IN int namelen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_GETHOSTNAME)(
- OUT char FAR * name,
- IN int namelen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- struct servent FAR *
- WSAAPI
- getservbyport(
- IN int port,
- IN const char FAR * proto
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- struct servent FAR *
- (WSAAPI * LPFN_GETSERVBYPORT)(
- IN int port,
- IN const char FAR * proto
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- struct servent FAR *
- WSAAPI
- getservbyname(
- IN const char FAR * name,
- IN const char FAR * proto
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- struct servent FAR *
- (WSAAPI * LPFN_GETSERVBYNAME)(
- IN const char FAR * name,
- IN const char FAR * proto
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- struct protoent FAR *
- WSAAPI
- getprotobynumber(
- IN int number
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- struct protoent FAR *
- (WSAAPI * LPFN_GETPROTOBYNUMBER)(
- IN int number
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- struct protoent FAR *
- WSAAPI
- getprotobyname(
- IN const char FAR * name
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- struct protoent FAR *
- (WSAAPI * LPFN_GETPROTOBYNAME)(
- IN const char FAR * name
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- /* Microsoft Windows Extension function prototypes */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAStartup(
- IN WORD wVersionRequested,
- OUT LPWSADATA lpWSAData
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSASTARTUP)(
- IN WORD wVersionRequested,
- OUT LPWSADATA lpWSAData
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSACleanup(
- void
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSACLEANUP)(
- void
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- void
- WSAAPI
- WSASetLastError(
- IN int iError
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- void
- (WSAAPI * LPFN_WSASETLASTERROR)(
- IN int iError
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAGetLastError(
- void
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAGETLASTERROR)(
- void
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- BOOL
- WSAAPI
- WSAIsBlocking(
- void
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- BOOL
- (WSAAPI * LPFN_WSAISBLOCKING)(
- void
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAUnhookBlockingHook(
- void
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAUNHOOKBLOCKINGHOOK)(
- void
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- FARPROC
- WSAAPI
- WSASetBlockingHook(
- IN FARPROC lpBlockFunc
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- FARPROC
- (WSAAPI * LPFN_WSASETBLOCKINGHOOK)(
- IN FARPROC lpBlockFunc
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSACancelBlockingCall(
- void
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSACANCELBLOCKINGCALL)(
- void
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- HANDLE
- WSAAPI
- WSAAsyncGetServByName(
- IN HWND hWnd,
- IN u_int wMsg,
- IN const char FAR * name,
- IN const char FAR * proto,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- HANDLE
- (WSAAPI * LPFN_WSAASYNCGETSERVBYNAME)(
- IN HWND hWnd,
- IN u_int wMsg,
- IN const char FAR * name,
- IN const char FAR * proto,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- HANDLE
- WSAAPI
- WSAAsyncGetServByPort(
- IN HWND hWnd,
- IN u_int wMsg,
- IN int port,
- IN const char FAR * proto,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- HANDLE
- (WSAAPI * LPFN_WSAASYNCGETSERVBYPORT)(
- IN HWND hWnd,
- IN u_int wMsg,
- IN int port,
- IN const char FAR * proto,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- HANDLE
- WSAAPI
- WSAAsyncGetProtoByName(
- IN HWND hWnd,
- IN u_int wMsg,
- IN const char FAR * name,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- HANDLE
- (WSAAPI * LPFN_WSAASYNCGETPROTOBYNAME)(
- IN HWND hWnd,
- IN u_int wMsg,
- IN const char FAR * name,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- HANDLE
- WSAAPI
- WSAAsyncGetProtoByNumber(
- IN HWND hWnd,
- IN u_int wMsg,
- IN int number,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- HANDLE
- (WSAAPI * LPFN_WSAASYNCGETPROTOBYNUMBER)(
- IN HWND hWnd,
- IN u_int wMsg,
- IN int number,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- HANDLE
- WSAAPI
- WSAAsyncGetHostByName(
- IN HWND hWnd,
- IN u_int wMsg,
- IN const char FAR * name,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- HANDLE
- (WSAAPI * LPFN_WSAASYNCGETHOSTBYNAME)(
- IN HWND hWnd,
- IN u_int wMsg,
- IN const char FAR * name,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- HANDLE
- WSAAPI
- WSAAsyncGetHostByAddr(
- IN HWND hWnd,
- IN u_int wMsg,
- IN const char FAR * addr,
- IN int len,
- IN int type,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- HANDLE
- (WSAAPI * LPFN_WSAASYNCGETHOSTBYADDR)(
- IN HWND hWnd,
- IN u_int wMsg,
- IN const char FAR * addr,
- IN int len,
- IN int type,
- OUT char FAR * buf,
- IN int buflen
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSACancelAsyncRequest(
- IN HANDLE hAsyncTaskHandle
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSACANCELASYNCREQUEST)(
- IN HANDLE hAsyncTaskHandle
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAAsyncSelect(
- IN SOCKET s,
- IN HWND hWnd,
- IN u_int wMsg,
- IN long lEvent
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAASYNCSELECT)(
- IN SOCKET s,
- IN HWND hWnd,
- IN u_int wMsg,
- IN long lEvent
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- /* WinSock 2 API new function prototypes */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- SOCKET
- WSAAPI
- WSAAccept(
- IN SOCKET s,
- OUT struct sockaddr FAR * addr,
- IN OUT LPINT addrlen,
- IN LPCONDITIONPROC lpfnCondition,
- IN DWORD_PTR dwCallbackData
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- SOCKET
- (WSAAPI * LPFN_WSAACCEPT)(
- IN SOCKET s,
- OUT struct sockaddr FAR * addr,
- IN OUT LPINT addrlen,
- IN LPCONDITIONPROC lpfnCondition,
- IN DWORD_PTR dwCallbackData
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- BOOL
- WSAAPI
- WSACloseEvent(
- IN WSAEVENT hEvent
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- BOOL
- (WSAAPI * LPFN_WSACLOSEEVENT)(
- IN WSAEVENT hEvent
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAConnect(
- IN SOCKET s,
- IN const struct sockaddr FAR * name,
- IN int namelen,
- IN LPWSABUF lpCallerData,
- OUT LPWSABUF lpCalleeData,
- IN LPQOS lpSQOS,
- IN LPQOS lpGQOS
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSACONNECT)(
- IN SOCKET s,
- IN const struct sockaddr FAR * name,
- IN int namelen,
- IN LPWSABUF lpCallerData,
- OUT LPWSABUF lpCalleeData,
- IN LPQOS lpSQOS,
- IN LPQOS lpGQOS
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- WSAEVENT
- WSAAPI
- WSACreateEvent(
- void
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- WSAEVENT
- (WSAAPI * LPFN_WSACREATEEVENT)(
- void
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSADuplicateSocketA(
- IN SOCKET s,
- IN DWORD dwProcessId,
- OUT LPWSAPROTOCOL_INFOA lpProtocolInfo
- );
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSADuplicateSocketW(
- IN SOCKET s,
- IN DWORD dwProcessId,
- OUT LPWSAPROTOCOL_INFOW lpProtocolInfo
- );
- #ifdef UNICODE
- #define WSADuplicateSocket WSADuplicateSocketW
- #else
- #define WSADuplicateSocket WSADuplicateSocketA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSADUPLICATESOCKETA)(
- IN SOCKET s,
- IN DWORD dwProcessId,
- OUT LPWSAPROTOCOL_INFOA lpProtocolInfo
- );
- typedef
- int
- (WSAAPI * LPFN_WSADUPLICATESOCKETW)(
- IN SOCKET s,
- IN DWORD dwProcessId,
- OUT LPWSAPROTOCOL_INFOW lpProtocolInfo
- );
- #ifdef UNICODE
- #define LPFN_WSADUPLICATESOCKET LPFN_WSADUPLICATESOCKETW
- #else
- #define LPFN_WSADUPLICATESOCKET LPFN_WSADUPLICATESOCKETA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAEnumNetworkEvents(
- IN SOCKET s,
- IN WSAEVENT hEventObject,
- OUT LPWSANETWORKEVENTS lpNetworkEvents
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAENUMNETWORKEVENTS)(
- IN SOCKET s,
- IN WSAEVENT hEventObject,
- OUT LPWSANETWORKEVENTS lpNetworkEvents
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAEnumProtocolsA(
- IN LPINT lpiProtocols,
- OUT LPWSAPROTOCOL_INFOA lpProtocolBuffer,
- IN OUT LPDWORD lpdwBufferLength
- );
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAEnumProtocolsW(
- IN LPINT lpiProtocols,
- OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer,
- IN OUT LPDWORD lpdwBufferLength
- );
- #ifdef UNICODE
- #define WSAEnumProtocols WSAEnumProtocolsW
- #else
- #define WSAEnumProtocols WSAEnumProtocolsA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAENUMPROTOCOLSA)(
- IN LPINT lpiProtocols,
- OUT LPWSAPROTOCOL_INFOA lpProtocolBuffer,
- IN OUT LPDWORD lpdwBufferLength
- );
- typedef
- int
- (WSAAPI * LPFN_WSAENUMPROTOCOLSW)(
- IN LPINT lpiProtocols,
- OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer,
- IN OUT LPDWORD lpdwBufferLength
- );
- #ifdef UNICODE
- #define LPFN_WSAENUMPROTOCOLS LPFN_WSAENUMPROTOCOLSW
- #else
- #define LPFN_WSAENUMPROTOCOLS LPFN_WSAENUMPROTOCOLSA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAEventSelect(
- IN SOCKET s,
- IN WSAEVENT hEventObject,
- IN long lNetworkEvents
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAEVENTSELECT)(
- IN SOCKET s,
- IN WSAEVENT hEventObject,
- IN long lNetworkEvents
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- BOOL
- WSAAPI
- WSAGetOverlappedResult(
- IN SOCKET s,
- IN LPWSAOVERLAPPED lpOverlapped,
- OUT LPDWORD lpcbTransfer,
- IN BOOL fWait,
- OUT LPDWORD lpdwFlags
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- BOOL
- (WSAAPI * LPFN_WSAGETOVERLAPPEDRESULT)(
- IN SOCKET s,
- IN LPWSAOVERLAPPED lpOverlapped,
- OUT LPDWORD lpcbTransfer,
- IN BOOL fWait,
- OUT LPDWORD lpdwFlags
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- BOOL
- WSAAPI
- WSAGetQOSByName(
- IN SOCKET s,
- IN LPWSABUF lpQOSName,
- OUT LPQOS lpQOS
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- BOOL
- (WSAAPI * LPFN_WSAGETQOSBYNAME)(
- IN SOCKET s,
- IN LPWSABUF lpQOSName,
- OUT LPQOS lpQOS
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAHtonl(
- IN SOCKET s,
- IN u_long hostlong,
- OUT u_long FAR * lpnetlong
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAHTONL)(
- IN SOCKET s,
- IN u_long hostlong,
- OUT u_long FAR * lpnetlong
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAHtons(
- IN SOCKET s,
- IN u_short hostshort,
- OUT u_short FAR * lpnetshort
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAHTONS)(
- IN SOCKET s,
- IN u_short hostshort,
- OUT u_short FAR * lpnetshort
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSAIoctl(
- IN SOCKET s,
- IN DWORD dwIoControlCode,
- IN LPVOID lpvInBuffer,
- IN DWORD cbInBuffer,
- OUT LPVOID lpvOutBuffer,
- IN DWORD cbOutBuffer,
- OUT LPDWORD lpcbBytesReturned,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSAIOCTL)(
- IN SOCKET s,
- IN DWORD dwIoControlCode,
- IN LPVOID lpvInBuffer,
- IN DWORD cbInBuffer,
- OUT LPVOID lpvOutBuffer,
- IN DWORD cbOutBuffer,
- OUT LPDWORD lpcbBytesReturned,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- SOCKET
- WSAAPI
- WSAJoinLeaf(
- IN SOCKET s,
- IN const struct sockaddr FAR * name,
- IN int namelen,
- IN LPWSABUF lpCallerData,
- OUT LPWSABUF lpCalleeData,
- IN LPQOS lpSQOS,
- IN LPQOS lpGQOS,
- IN DWORD dwFlags
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- SOCKET
- (WSAAPI * LPFN_WSAJOINLEAF)(
- IN SOCKET s,
- IN const struct sockaddr FAR * name,
- IN int namelen,
- IN LPWSABUF lpCallerData,
- OUT LPWSABUF lpCalleeData,
- IN LPQOS lpSQOS,
- IN LPQOS lpGQOS,
- IN DWORD dwFlags
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSANtohl(
- IN SOCKET s,
- IN u_long netlong,
- OUT u_long FAR * lphostlong
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSANTOHL)(
- IN SOCKET s,
- IN u_long netlong,
- OUT u_long FAR * lphostlong
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSANtohs(
- IN SOCKET s,
- IN u_short netshort,
- OUT u_short FAR * lphostshort
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSANTOHS)(
- IN SOCKET s,
- IN u_short netshort,
- OUT u_short FAR * lphostshort
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSARecv(
- IN SOCKET s,
- IN OUT LPWSABUF lpBuffers,
- IN DWORD dwBufferCount,
- OUT LPDWORD lpNumberOfBytesRecvd,
- IN OUT LPDWORD lpFlags,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSARECV)(
- IN SOCKET s,
- IN OUT LPWSABUF lpBuffers,
- IN DWORD dwBufferCount,
- OUT LPDWORD lpNumberOfBytesRecvd,
- IN OUT LPDWORD lpFlags,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSARecvDisconnect(
- IN SOCKET s,
- OUT LPWSABUF lpInboundDisconnectData
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSARECVDISCONNECT)(
- IN SOCKET s,
- OUT LPWSABUF lpInboundDisconnectData
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSARecvFrom(
- IN SOCKET s,
- IN OUT LPWSABUF lpBuffers,
- IN DWORD dwBufferCount,
- OUT LPDWORD lpNumberOfBytesRecvd,
- IN OUT LPDWORD lpFlags,
- OUT struct sockaddr FAR * lpFrom,
- IN OUT LPINT lpFromlen,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSARECVFROM)(
- IN SOCKET s,
- IN OUT LPWSABUF lpBuffers,
- IN DWORD dwBufferCount,
- OUT LPDWORD lpNumberOfBytesRecvd,
- IN OUT LPDWORD lpFlags,
- OUT struct sockaddr FAR * lpFrom,
- IN OUT LPINT lpFromlen,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- BOOL
- WSAAPI
- WSAResetEvent(
- IN WSAEVENT hEvent
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- BOOL
- (WSAAPI * LPFN_WSARESETEVENT)(
- IN WSAEVENT hEvent
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSASend(
- IN SOCKET s,
- IN LPWSABUF lpBuffers,
- IN DWORD dwBufferCount,
- OUT LPDWORD lpNumberOfBytesSent,
- IN DWORD dwFlags,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSASEND)(
- IN SOCKET s,
- IN LPWSABUF lpBuffers,
- IN DWORD dwBufferCount,
- OUT LPDWORD lpNumberOfBytesSent,
- IN DWORD dwFlags,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSASendDisconnect(
- IN SOCKET s,
- IN LPWSABUF lpOutboundDisconnectData
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSASENDDISCONNECT)(
- IN SOCKET s,
- IN LPWSABUF lpOutboundDisconnectData
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- int
- WSAAPI
- WSASendTo(
- IN SOCKET s,
- IN LPWSABUF lpBuffers,
- IN DWORD dwBufferCount,
- OUT LPDWORD lpNumberOfBytesSent,
- IN DWORD dwFlags,
- IN const struct sockaddr FAR * lpTo,
- IN int iTolen,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- int
- (WSAAPI * LPFN_WSASENDTO)(
- IN SOCKET s,
- IN LPWSABUF lpBuffers,
- IN DWORD dwBufferCount,
- OUT LPDWORD lpNumberOfBytesSent,
- IN DWORD dwFlags,
- IN const struct sockaddr FAR * lpTo,
- IN int iTolen,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- BOOL
- WSAAPI
- WSASetEvent(
- IN WSAEVENT hEvent
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- BOOL
- (WSAAPI * LPFN_WSASETEVENT)(
- IN WSAEVENT hEvent
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- SOCKET
- WSAAPI
- WSASocketA(
- IN int af,
- IN int type,
- IN int protocol,
- IN LPWSAPROTOCOL_INFOA lpProtocolInfo,
- IN GROUP g,
- IN DWORD dwFlags
- );
- WINSOCK_API_LINKAGE
- SOCKET
- WSAAPI
- WSASocketW(
- IN int af,
- IN int type,
- IN int protocol,
- IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
- IN GROUP g,
- IN DWORD dwFlags
- );
- #ifdef UNICODE
- #define WSASocket WSASocketW
- #else
- #define WSASocket WSASocketA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- SOCKET
- (WSAAPI * LPFN_WSASOCKETA)(
- IN int af,
- IN int type,
- IN int protocol,
- IN LPWSAPROTOCOL_INFOA lpProtocolInfo,
- IN GROUP g,
- IN DWORD dwFlags
- );
- typedef
- SOCKET
- (WSAAPI * LPFN_WSASOCKETW)(
- IN int af,
- IN int type,
- IN int protocol,
- IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
- IN GROUP g,
- IN DWORD dwFlags
- );
- #ifdef UNICODE
- #define LPFN_WSASOCKET LPFN_WSASOCKETW
- #else
- #define LPFN_WSASOCKET LPFN_WSASOCKETA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- DWORD
- WSAAPI
- WSAWaitForMultipleEvents(
- IN DWORD cEvents,
- IN const WSAEVENT FAR * lphEvents,
- IN BOOL fWaitAll,
- IN DWORD dwTimeout,
- IN BOOL fAlertable
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- DWORD
- (WSAAPI * LPFN_WSAWAITFORMULTIPLEEVENTS)(
- IN DWORD cEvents,
- IN const WSAEVENT FAR * lphEvents,
- IN BOOL fWaitAll,
- IN DWORD dwTimeout,
- IN BOOL fAlertable
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAAddressToStringA(
- IN LPSOCKADDR lpsaAddress,
- IN DWORD dwAddressLength,
- IN LPWSAPROTOCOL_INFOA lpProtocolInfo,
- IN OUT LPSTR lpszAddressString,
- IN OUT LPDWORD lpdwAddressStringLength
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAAddressToStringW(
- IN LPSOCKADDR lpsaAddress,
- IN DWORD dwAddressLength,
- IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
- IN OUT LPWSTR lpszAddressString,
- IN OUT LPDWORD lpdwAddressStringLength
- );
- #ifdef UNICODE
- #define WSAAddressToString WSAAddressToStringW
- #else
- #define WSAAddressToString WSAAddressToStringA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSAADDRESSTOSTRINGA)(
- IN LPSOCKADDR lpsaAddress,
- IN DWORD dwAddressLength,
- IN LPWSAPROTOCOL_INFOA lpProtocolInfo,
- IN OUT LPSTR lpszAddressString,
- IN OUT LPDWORD lpdwAddressStringLength
- );
- typedef
- INT
- (WSAAPI * LPFN_WSAADDRESSTOSTRINGW)(
- IN LPSOCKADDR lpsaAddress,
- IN DWORD dwAddressLength,
- IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
- IN OUT LPWSTR lpszAddressString,
- IN OUT LPDWORD lpdwAddressStringLength
- );
- #ifdef UNICODE
- #define LPFN_WSAADDRESSTOSTRING LPFN_WSAADDRESSTOSTRINGW
- #else
- #define LPFN_WSAADDRESSTOSTRING LPFN_WSAADDRESSTOSTRINGA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAStringToAddressA(
- IN LPSTR AddressString,
- IN INT AddressFamily,
- IN LPWSAPROTOCOL_INFOA lpProtocolInfo,
- OUT LPSOCKADDR lpAddress,
- IN OUT LPINT lpAddressLength
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAStringToAddressW(
- IN LPWSTR AddressString,
- IN INT AddressFamily,
- IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
- OUT LPSOCKADDR lpAddress,
- IN OUT LPINT lpAddressLength
- );
- #ifdef UNICODE
- #define WSAStringToAddress WSAStringToAddressW
- #else
- #define WSAStringToAddress WSAStringToAddressA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSASTRINGTOADDRESSA)(
- IN LPSTR AddressString,
- IN INT AddressFamily,
- IN LPWSAPROTOCOL_INFOA lpProtocolInfo,
- OUT LPSOCKADDR lpAddress,
- IN OUT LPINT lpAddressLength
- );
- typedef
- INT
- (WSAAPI * LPFN_WSASTRINGTOADDRESSW)(
- IN LPWSTR AddressString,
- IN INT AddressFamily,
- IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
- OUT LPSOCKADDR lpAddress,
- IN OUT LPINT lpAddressLength
- );
- #ifdef UNICODE
- #define LPFN_WSASTRINGTOADDRESS LPFN_WSASTRINGTOADDRESSW
- #else
- #define LPFN_WSASTRINGTOADDRESS LPFN_WSASTRINGTOADDRESSA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- /* Registration and Name Resolution API functions */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSALookupServiceBeginA(
- IN LPWSAQUERYSETA lpqsRestrictions,
- IN DWORD dwControlFlags,
- OUT LPHANDLE lphLookup
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSALookupServiceBeginW(
- IN LPWSAQUERYSETW lpqsRestrictions,
- IN DWORD dwControlFlags,
- OUT LPHANDLE lphLookup
- );
- #ifdef UNICODE
- #define WSALookupServiceBegin WSALookupServiceBeginW
- #else
- #define WSALookupServiceBegin WSALookupServiceBeginA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSALOOKUPSERVICEBEGINA)(
- IN LPWSAQUERYSETA lpqsRestrictions,
- IN DWORD dwControlFlags,
- OUT LPHANDLE lphLookup
- );
- typedef
- INT
- (WSAAPI * LPFN_WSALOOKUPSERVICEBEGINW)(
- IN LPWSAQUERYSETW lpqsRestrictions,
- IN DWORD dwControlFlags,
- OUT LPHANDLE lphLookup
- );
- #ifdef UNICODE
- #define LPFN_WSALOOKUPSERVICEBEGIN LPFN_WSALOOKUPSERVICEBEGINW
- #else
- #define LPFN_WSALOOKUPSERVICEBEGIN LPFN_WSALOOKUPSERVICEBEGINA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSALookupServiceNextA(
- IN HANDLE hLookup,
- IN DWORD dwControlFlags,
- IN OUT LPDWORD lpdwBufferLength,
- OUT LPWSAQUERYSETA lpqsResults
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSALookupServiceNextW(
- IN HANDLE hLookup,
- IN DWORD dwControlFlags,
- IN OUT LPDWORD lpdwBufferLength,
- OUT LPWSAQUERYSETW lpqsResults
- );
- #ifdef UNICODE
- #define WSALookupServiceNext WSALookupServiceNextW
- #else
- #define WSALookupServiceNext WSALookupServiceNextA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSALOOKUPSERVICENEXTA)(
- IN HANDLE hLookup,
- IN DWORD dwControlFlags,
- IN OUT LPDWORD lpdwBufferLength,
- OUT LPWSAQUERYSETA lpqsResults
- );
- typedef
- INT
- (WSAAPI * LPFN_WSALOOKUPSERVICENEXTW)(
- IN HANDLE hLookup,
- IN DWORD dwControlFlags,
- IN OUT LPDWORD lpdwBufferLength,
- OUT LPWSAQUERYSETW lpqsResults
- );
- #ifdef UNICODE
- #define LPFN_WSALOOKUPSERVICENEXT LPFN_WSALOOKUPSERVICENEXTW
- #else
- #define LPFN_WSALOOKUPSERVICENEXT LPFN_WSALOOKUPSERVICENEXTA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSANSPIoctl(
- IN HANDLE hLookup,
- IN DWORD dwControlCode,
- IN LPVOID lpvInBuffer,
- IN DWORD cbInBuffer,
- OUT LPVOID lpvOutBuffer,
- IN DWORD cbOutBuffer,
- OUT LPDWORD lpcbBytesReturned,
- IN LPWSACOMPLETION lpCompletion
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSANSPIOCTL)(
- IN HANDLE hLookup,
- IN DWORD dwControlCode,
- IN LPVOID lpvInBuffer,
- IN DWORD cbInBuffer,
- OUT LPVOID lpvOutBuffer,
- IN DWORD cbOutBuffer,
- OUT LPDWORD lpcbBytesReturned,
- IN LPWSACOMPLETION lpCompletion
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSALookupServiceEnd(
- IN HANDLE hLookup
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSALOOKUPSERVICEEND)(
- IN HANDLE hLookup
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAInstallServiceClassA(
- IN LPWSASERVICECLASSINFOA lpServiceClassInfo
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAInstallServiceClassW(
- IN LPWSASERVICECLASSINFOW lpServiceClassInfo
- );
- #ifdef UNICODE
- #define WSAInstallServiceClass WSAInstallServiceClassW
- #else
- #define WSAInstallServiceClass WSAInstallServiceClassA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSAINSTALLSERVICECLASSA)(
- IN LPWSASERVICECLASSINFOA lpServiceClassInfo
- );
- typedef
- INT
- (WSAAPI * LPFN_WSAINSTALLSERVICECLASSW)(
- IN LPWSASERVICECLASSINFOW lpServiceClassInfo
- );
- #ifdef UNICODE
- #define LPFN_WSAINSTALLSERVICECLASS LPFN_WSAINSTALLSERVICECLASSW
- #else
- #define LPFN_WSAINSTALLSERVICECLASS LPFN_WSAINSTALLSERVICECLASSA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSARemoveServiceClass(
- IN LPGUID lpServiceClassId
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSAREMOVESERVICECLASS)(
- IN LPGUID lpServiceClassId
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAGetServiceClassInfoA(
- IN LPGUID lpProviderId,
- IN LPGUID lpServiceClassId,
- IN OUT LPDWORD lpdwBufSize,
- OUT LPWSASERVICECLASSINFOA lpServiceClassInfo
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAGetServiceClassInfoW(
- IN LPGUID lpProviderId,
- IN LPGUID lpServiceClassId,
- IN OUT LPDWORD lpdwBufSize,
- OUT LPWSASERVICECLASSINFOW lpServiceClassInfo
- );
- #ifdef UNICODE
- #define WSAGetServiceClassInfo WSAGetServiceClassInfoW
- #else
- #define WSAGetServiceClassInfo WSAGetServiceClassInfoA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSAGETSERVICECLASSINFOA)(
- IN LPGUID lpProviderId,
- IN LPGUID lpServiceClassId,
- IN OUT LPDWORD lpdwBufSize,
- OUT LPWSASERVICECLASSINFOA lpServiceClassInfo
- );
- typedef
- INT
- (WSAAPI * LPFN_WSAGETSERVICECLASSINFOW)(
- IN LPGUID lpProviderId,
- IN LPGUID lpServiceClassId,
- IN OUT LPDWORD lpdwBufSize,
- OUT LPWSASERVICECLASSINFOW lpServiceClassInfo
- );
- #ifdef UNICODE
- #define LPFN_WSAGETSERVICECLASSINFO LPFN_WSAGETSERVICECLASSINFOW
- #else
- #define LPFN_WSAGETSERVICECLASSINFO LPFN_WSAGETSERVICECLASSINFOA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAEnumNameSpaceProvidersA(
- IN OUT LPDWORD lpdwBufferLength,
- OUT LPWSANAMESPACE_INFOA lpnspBuffer
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAEnumNameSpaceProvidersW(
- IN OUT LPDWORD lpdwBufferLength,
- OUT LPWSANAMESPACE_INFOW lpnspBuffer
- );
- #ifdef UNICODE
- #define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersW
- #else
- #define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSAENUMNAMESPACEPROVIDERSA)(
- IN OUT LPDWORD lpdwBufferLength,
- OUT LPWSANAMESPACE_INFOA lpnspBuffer
- );
- typedef
- INT
- (WSAAPI * LPFN_WSAENUMNAMESPACEPROVIDERSW)(
- IN OUT LPDWORD lpdwBufferLength,
- OUT LPWSANAMESPACE_INFOW lpnspBuffer
- );
- #ifdef UNICODE
- #define LPFN_WSAENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSW
- #else
- #define LPFN_WSAENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAGetServiceClassNameByClassIdA(
- IN LPGUID lpServiceClassId,
- OUT LPSTR lpszServiceClassName,
- IN OUT LPDWORD lpdwBufferLength
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAGetServiceClassNameByClassIdW(
- IN LPGUID lpServiceClassId,
- OUT LPWSTR lpszServiceClassName,
- IN OUT LPDWORD lpdwBufferLength
- );
- #ifdef UNICODE
- #define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdW
- #else
- #define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA)(
- IN LPGUID lpServiceClassId,
- OUT LPSTR lpszServiceClassName,
- IN OUT LPDWORD lpdwBufferLength
- );
- typedef
- INT
- (WSAAPI * LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW)(
- IN LPGUID lpServiceClassId,
- OUT LPWSTR lpszServiceClassName,
- IN OUT LPDWORD lpdwBufferLength
- );
- #ifdef UNICODE
- #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW
- #else
- #define LPFN_WSAGETSERVICECLASSNAMEBYCLASSID LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSASetServiceA(
- IN LPWSAQUERYSETA lpqsRegInfo,
- IN WSAESETSERVICEOP essoperation,
- IN DWORD dwControlFlags
- );
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSASetServiceW(
- IN LPWSAQUERYSETW lpqsRegInfo,
- IN WSAESETSERVICEOP essoperation,
- IN DWORD dwControlFlags
- );
- #ifdef UNICODE
- #define WSASetService WSASetServiceW
- #else
- #define WSASetService WSASetServiceA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSASETSERVICEA)(
- IN LPWSAQUERYSETA lpqsRegInfo,
- IN WSAESETSERVICEOP essoperation,
- IN DWORD dwControlFlags
- );
- typedef
- INT
- (WSAAPI * LPFN_WSASETSERVICEW)(
- IN LPWSAQUERYSETW lpqsRegInfo,
- IN WSAESETSERVICEOP essoperation,
- IN DWORD dwControlFlags
- );
- #ifdef UNICODE
- #define LPFN_WSASETSERVICE LPFN_WSASETSERVICEW
- #else
- #define LPFN_WSASETSERVICE LPFN_WSASETSERVICEA
- #endif /* !UNICODE */
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- #if INCL_WINSOCK_API_PROTOTYPES
- WINSOCK_API_LINKAGE
- INT
- WSAAPI
- WSAProviderConfigChange(
- IN OUT LPHANDLE lpNotificationHandle,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_PROTOTYPES */
- #if INCL_WINSOCK_API_TYPEDEFS
- typedef
- INT
- (WSAAPI * LPFN_WSAPROVIDERCONFIGCHANGE)(
- IN OUT LPHANDLE lpNotificationHandle,
- IN LPWSAOVERLAPPED lpOverlapped,
- IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
- );
- #endif /* INCL_WINSOCK_API_TYPEDEFS */
- /* Microsoft Windows Extended data types */
- typedef struct sockaddr_in SOCKADDR_IN;
- typedef struct sockaddr_in *PSOCKADDR_IN;
- typedef struct sockaddr_in FAR *LPSOCKADDR_IN;
- typedef struct linger LINGER;
- typedef struct linger *PLINGER;
- typedef struct linger FAR *LPLINGER;
- typedef struct in_addr IN_ADDR;
- typedef struct in_addr *PIN_ADDR;
- typedef struct in_addr FAR *LPIN_ADDR;
- typedef struct fd_set FD_SET;
- typedef struct fd_set *PFD_SET;
- typedef struct fd_set FAR *LPFD_SET;
- typedef struct hostent HOSTENT;
- typedef struct hostent *PHOSTENT;
- typedef struct hostent FAR *LPHOSTENT;
- typedef struct servent SERVENT;
- typedef struct servent *PSERVENT;
- typedef struct servent FAR *LPSERVENT;
- typedef struct protoent PROTOENT;
- typedef struct protoent *PPROTOENT;
- typedef struct protoent FAR *LPPROTOENT;
- typedef struct timeval TIMEVAL;
- typedef struct timeval *PTIMEVAL;
- typedef struct timeval FAR *LPTIMEVAL;
- /*
- * Windows message parameter composition and decomposition
- * macros.
- *
- * WSAMAKEASYNCREPLY is intended for use by the Windows Sockets implementation
- * when constructing the response to a WSAAsyncGetXByY() routine.
- */
- #define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error)
- /*
- * WSAMAKESELECTREPLY is intended for use by the Windows Sockets implementation
- * when constructing the response to WSAAsyncSelect().
- */
- #define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error)
- /*
- * WSAGETASYNCBUFLEN is intended for use by the Windows Sockets application
- * to extract the buffer length from the lParam in the response
- * to a WSAAsyncGetXByY().
- */
- #define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam)
- /*
- * WSAGETASYNCERROR is intended for use by the Windows Sockets application
- * to extract the error code from the lParam in the response
- * to a WSAGetXByY().
- */
- #define WSAGETASYNCERROR(lParam) HIWORD(lParam)
- /*
- * WSAGETSELECTEVENT is intended for use by the Windows Sockets application
- * to extract the event code from the lParam in the response
- * to a WSAAsyncSelect().
- */
- #define WSAGETSELECTEVENT(lParam) LOWORD(lParam)
- /*
- * WSAGETSELECTERROR is intended for use by the Windows Sockets application
- * to extract the error code from the lParam in the response
- * to a WSAAsyncSelect().
- */
- #define WSAGETSELECTERROR(lParam) HIWORD(lParam)
- #ifdef __cplusplus
- }
- #endif
- #if !defined(WIN32) && !defined(_WIN64)
- #include <poppack.h>
- #endif
- #ifdef IPV6STRICT
- #include <wsipv6ok.h>
- #endif // IPV6STRICT
- #endif /* _WINSOCK2API_ */
|