Changeset 42


Ignore:
Timestamp:
Dec 30, 2006, 11:20:03 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

api_winerror.sbpとapi_winsock2.sbpとの間での定義の重複を除去など。

Location:
Include
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Threading/Thread.ab

    r19 r42  
    5656    Function Equals(ByRef obj_Thread As Thread) As BOOL
    5757        If m_dwThreadId=obj_Thread.m_dwThreadId Then
    58             Return TRUE
     58            Return _System_TRUE
    5959        End If
    60         Return FALSE
     60        Return _System_FALSE
    6161    End Function
    6262
  • Include/OAIdl.ab

    r35 r42  
    66#define _INC_OAIDL_AB
    77
    8 ' verify that the <rpcndr.h> version is high enough to compile this file*/
    9 '/*
    10 '#ifndef __REQUIRED_RPCNDR_H_VERSION__
    11 '#define __REQUIRED_RPCNDR_H_VERSION__ 475
    12 '#endif
    13 '
    14 '#include "rpc.h"
    15 '#include "rpcndr.h"
    16 '
    17 '#ifndef __RPCNDR_H_VERSION__
    18 '#error this stub requires an updated version of <rpcndr.h>
    19 '#endif // __RPCNDR_H_VERSION__
    20 '
    218'#ifndef COM_NO_WINDOWS_H
    22 '#include "windows.h"
    23 '#include "ole2.h"
     9#include <windows.sbp>
     10#include <ole2.ab>
    2411'#endif /*COM_NO_WINDOWS_H*/
    2512
    26 #include <ole2.ab>
    27 '/* header files for imported files */
    28 '#include "objidl.h"
     13#include <objidl.sbp>
    2914
    3015#ifndef __IOleAutomationTypes_INTERFACE_DEFINED__
     
    174159Const FADF_RESERVED = &hf008
    175160
     161Const Enum VARENUM 'WTypes.idl
     162    VT_EMPTY    = 0
     163    VT_NULL = 1
     164    VT_I2   = 2
     165    VT_I4   = 3
     166    VT_R4   = 4
     167    VT_R8   = 5
     168    VT_CY   = 6
     169    VT_DATE = 7
     170    VT_BSTR = 8
     171    VT_DISPATCH = 9
     172    VT_ERROR    = 10
     173    VT_BOOL = 11
     174    VT_VARIANT  = 12
     175    VT_UNKNOWN  = 13
     176    VT_DECIMAL  = 14
     177    VT_I1   = 16
     178    VT_UI1  = 17
     179    VT_UI2  = 18
     180    VT_UI4  = 19
     181    VT_I8   = 20
     182    VT_UI8  = 21
     183    VT_INT  = 22
     184    VT_UINT = 23
     185    VT_VOID = 24
     186    VT_HRESULT  = 25
     187    VT_PTR  = 26
     188    VT_SAFEARRAY    = 27
     189    VT_CARRAY   = 28
     190    VT_USERDEFINED  = 29
     191    VT_LPSTR    = 30
     192    VT_LPWSTR   = 31
     193    VT_RECORD   = 36
     194    VT_INT_PTR  = 37
     195    VT_UINT_PTR = 38
     196    VT_FILETIME = 64
     197    VT_BLOB = 65
     198    VT_STREAM   = 66
     199    VT_STORAGE  = 67
     200    VT_STREAMED_OBJECT  = 68
     201    VT_STORED_OBJECT    = 69
     202    VT_BLOB_OBJECT  = 70
     203    VT_CF   = 71
     204    VT_CLSID    = 72
     205    VT_VERSIONED_STREAM = 73
     206    VT_BSTR_BLOB    = &hfff
     207    VT_VECTOR   = &h1000
     208    VT_ARRAY    = &h2000
     209    VT_BYREF    = &h4000
     210    VT_RESERVED = &h8000
     211    VT_ILLEGAL  = &hffff
     212    VT_ILLEGALMASKED    = &hfff
     213    VT_TYPEMASK = &hfff
     214End Enum
     215
    176216Class VARIANT
    177217Public
     
    588628Private
    589629    p As VoidPtr
    590 '    /* [switch_is][switch_type] */ Union
    591 '        /* [case()] */ lptdesc As *TYPEDESC
    592 '        /* [case()] */ lpadesc As *ARRAYDESC
    593 '        /* [case()] */ hreftype As HREFTYPE
    594 '        /* [default] */  /* Empty union arm */
    595 '    End Union
     630'   /* [switch_is][switch_type] */ Union
     631'       /* [case()] */ lptdesc As *TYPEDESC
     632'       /* [case()] */ lpadesc As *ARRAYDESC
     633'       /* [case()] */ hreftype As HREFTYPE
     634'       /* [default] */  /* Empty union arm */
     635'   End Union
    596636Public
    597637    vt As VARTYPE
     
    752792/* [v1_enum] */
    753793Const Enum INVOKEKIND
    754     INVOKE_FUNC = 1
    755     INVOKE_PROPERTYGET  = 2
    756     INVOKE_PROPERTYPUT  = 4
    757     INVOKE_PROPERTYPUTREF   = 8
     794    INVOKE_FUNC = 1
     795    INVOKE_PROPERTYGET = 2
     796    INVOKE_PROPERTYPUT = 4
     797    INVOKE_PROPERTYPUTREF = 8
    758798End Enum
    759799
     
    868908
    869909Type CUSTDATAITEM
    870     guid As GUID
    871     varValue As VARIANTARG
     910    guid As GUID
     911    varValue As VARIANTARG
    872912End Type
    873913
     
    883923#endif /* __IOleAutomationTypes_INTERFACE_DEFINED__ */
    884924
    885 #ifdef __UNDEFINED__
    886 
    887925#ifndef __ICreateTypeInfo_INTERFACE_DEFINED__
    888926#define __ICreateTypeInfo_INTERFACE_DEFINED__
     
    891929/* [local][unique][uuid][object] */
    892930
    893 'typedef /* [unique] */ ICreateTypeInfo *LPCREATETYPEINFO;
    894 
    895 
    896 EXTERN_C const IID IID_ICreateTypeInfo;
    897 
    898     MIDL_INTERFACE("00020405-0000-0000-C000-000000000046")
    899     ICreateTypeInfo : public IUnknown
    900     {
    901     public:
    902         Function SetGuid(
    903             /* [in] */ REFGUID guid) As HRESULT
    904 
    905         Function SetTypeFlags(
    906             /* [in] */ UINT uTypeFlags) As HRESULT
    907 
    908         Function SetDocString(
    909             /* [in] */ LPOLESTR pStrDoc) As HRESULT
    910 
    911         Function SetHelpContext(
    912             /* [in] */ DWORD dwHelpContext) As HRESULT
    913 
    914         Function SetVersion(
    915             /* [in] */ WORD wMajorVerNum,
    916             /* [in] */ WORD wMinorVerNum) As HRESULT
    917 
    918         Function AddRefTypeInfo(
    919             /* [in] */ ITypeInfo *pTInfo,
    920             /* [in] */ HREFTYPE *phRefType) As HRESULT
    921 
    922         Function AddFuncDesc(
    923             /* [in] */ UINT index,
    924             /* [in] */ FUNCDESC *pFuncDesc) As HRESULT
    925 
    926         Function AddImplType(
    927             /* [in] */ UINT index,
    928             /* [in] */ HREFTYPE hRefType) As HRESULT
    929 
    930         Function SetImplTypeFlags(
    931             /* [in] */ UINT index,
    932             /* [in] */ INT implTypeFlags) As HRESULT
    933 
    934         Function SetAlignment(
    935             /* [in] */ WORD cbAlignment) As HRESULT
    936 
    937         Function SetSchema(
    938             /* [in] */ LPOLESTR pStrSchema) As HRESULT
    939 
    940         Function AddVarDesc(
    941             /* [in] */ UINT index,
    942             /* [in] */ VARDESC *pVarDesc) As HRESULT
    943 
    944         Function SetFuncAndParamNames(
    945             /* [in] */ UINT index,
    946             /* [in][size_is][in] */ LPOLESTR *rgszNames,
    947             /* [in] */ UINT cNames) As HRESULT
    948 
    949         Function SetVarName(
    950             /* [in] */ UINT index,
    951             /* [in] */ LPOLESTR szName) As HRESULT
    952 
    953         Function SetTypeDescAlias(
    954             /* [in] */ TYPEDESC *pTDescAlias) As HRESULT
    955 
    956         Function DefineFuncAsDllEntry(
    957             /* [in] */ UINT index,
    958             /* [in] */ LPOLESTR szDllName,
    959             /* [in] */ LPOLESTR szProcName) As HRESULT
    960 
    961         Function SetFuncDocString(
    962             /* [in] */ UINT index,
    963             /* [in] */ LPOLESTR szDocString) As HRESULT
    964 
    965         Function SetVarDocString(
    966             /* [in] */ UINT index,
    967             /* [in] */ LPOLESTR szDocString) As HRESULT
    968 
    969         Function SetFuncHelpContext(
    970             /* [in] */ UINT index,
    971             /* [in] */ DWORD dwHelpContext) As HRESULT
    972 
    973         Function SetVarHelpContext(
    974             /* [in] */ UINT index,
    975             /* [in] */ DWORD dwHelpContext) As HRESULT
    976 
    977         Function SetMops(
    978             /* [in] */ UINT index,
    979             /* [in] */ BSTR bstrMops) As HRESULT
    980 
    981         Function SetTypeIdldesc(
    982             /* [in] */ IDLDESC *pIdlDesc) As HRESULT
    983 
    984         Function LayOut( void) As HRESULT
    985 
    986     };
     931'TypeDef /* [unique] */ ICreateTypeInfo *LPCREATETYPEINFO;
     932
     933Dim IID_ICreateTypeInfo = [&h00020405, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     934
     935Interface ICreateTypeInfo
     936    Inherits IUnknown
     937
     938        Function SetGuid(
     939            /* [in] */ ByRef guid As GUID) As HRESULT
     940
     941        Function SetTypeFlags(
     942            /* [in] */ uTypeFlags As DWord) As HRESULT
     943
     944        Function SetDocString(
     945            /* [in] */ pStrDoc As LPOLESTR) As HRESULT
     946
     947        Function SetHelpContext(
     948            /* [in] */ dwHelpContext As DWord) As HRESULT
     949
     950        Function SetVersion(
     951            /* [in] */ wMajorVerNum As Word,
     952            /* [in] */ wMinorVerNum As Word) As HRESULT
     953
     954        Function AddRefTypeInfo(
     955            /* [in] */ pTInfo As VoidPtr /* *ITypeInfo */,
     956            /* [in] */ByRef hRefType As HREFTYPE) As HRESULT
     957
     958        Function AddFuncDesc(
     959            /* [in] */ index As DWord,
     960            /* [in] */ ByRef FuncDesc As FUNCDESC) As HRESULT
     961
     962        Function AddImplType(
     963            /* [in] */ index As DWord,
     964            /* [in] */ hRefType As HREFTYPE) As HRESULT
     965
     966        Function SetImplTypeFlags(
     967            /* [in] */ index As DWord,
     968            /* [in] */ implTypeFlags As Long) As HRESULT
     969
     970        Function SetAlignment(
     971            /* [in] */ cbAlignment As Long) As HRESULT
     972
     973        Function SetSchema(
     974            /* [in] */ pStrSchema As LPOLESTR) As HRESULT
     975
     976        Function AddVarDesc(
     977            /* [in] */ index As DWord,
     978            /* [in] */ ByRef VarDesc As VARDESC) As HRESULT
     979
     980        Function SetFuncAndParamNames(
     981            /* [in] */ index As DWord,
     982            /* [in][size_is][in] */ rgszNames As *LPOLESTR,
     983            /* [in] */ cNames As DWord) As HRESULT
     984
     985        Function SetVarName(
     986            /* [in] */ index As DWord,
     987            /* [in] */ szName As LPOLESTR) As HRESULT
     988
     989        Function SetTypeDescAlias(
     990            /* [in] */ ByRef TDescAlias As TYPEDESC) As HRESULT
     991
     992        Function DefineFuncAsDllEntry(
     993            /* [in] */ index As DWord,
     994            /* [in] */ szDllName As LPOLESTR,
     995            /* [in] */ zProcName As LPOLESTR) As HRESULT
     996
     997        Function SetFuncDocString(
     998            /* [in] */ index As DWord,
     999            /* [in] */ szDocString As LPOLESTR) As HRESULT
     1000
     1001        Function SetVarDocString(
     1002            /* [in] */ index As DWord,
     1003            /* [in] */ szDocString As LPOLESTR) As HRESULT
     1004
     1005        Function SetFuncHelpContext(
     1006            /* [in] */ index As DWord,
     1007            /* [in] */ dwHelpContext As DWord) As HRESULT
     1008
     1009        Function SetVarHelpContext(
     1010            /* [in] */ index As DWord,
     1011            /* [in] */ dwHelpContext As DWord) As HRESULT
     1012
     1013        Function SetMops(
     1014            /* [in] */ index As DWord,
     1015            /* [in] */ bstrMops As BSTR) As HRESULT
     1016
     1017        Function SetTypeIdldesc(
     1018            /* [in] */ ByRef IdlDesc As IDLDESC) As HRESULT
     1019
     1020        Function LayOut() As HRESULT
     1021End Interface
    9871022
    9881023#endif  /* __ICreateTypeInfo_INTERFACE_DEFINED__ */
    989 
    9901024
    9911025#ifndef __ICreateTypeInfo2_INTERFACE_DEFINED__
     
    9951029/* [local][unique][uuid][object] */
    9961030
    997 'typedef /* [unique] */ ICreateTypeInfo2 *LPCREATETYPEINFO2;
    998 
    999 
    1000 EXTERN_C const IID IID_ICreateTypeInfo2;
    1001 
    1002     MIDL_INTERFACE("0002040E-0000-0000-C000-000000000046")
    1003     ICreateTypeInfo2 : public ICreateTypeInfo
    1004     {
    1005     public:
    1006         Function DeleteFuncDesc(
    1007             /* [in] */ UINT index) As HRESULT
    1008 
    1009         Function DeleteFuncDescByMemId(
    1010             /* [in] */ MEMBERID memid,
    1011             /* [in] */ INVOKEKIND invKind) As HRESULT
    1012 
    1013         Function DeleteVarDesc(
    1014             /* [in] */ UINT index) As HRESULT
    1015 
    1016         Function DeleteVarDescByMemId(
    1017             /* [in] */ MEMBERID memid) As HRESULT
    1018 
    1019         Function DeleteImplType(
    1020             /* [in] */ UINT index) As HRESULT
    1021 
    1022         Function SetCustData(
    1023             /* [in] */ REFGUID guid,
    1024             /* [in] */ VARIANT *pVarVal) As HRESULT
    1025 
    1026         Function SetFuncCustData(
    1027             /* [in] */ UINT index,
    1028             /* [in] */ REFGUID guid,
    1029             /* [in] */ VARIANT *pVarVal) As HRESULT
    1030 
    1031         Function SetParamCustData(
    1032             /* [in] */ UINT indexFunc,
    1033             /* [in] */ UINT indexParam,
    1034             /* [in] */ REFGUID guid,
    1035             /* [in] */ VARIANT *pVarVal) As HRESULT
    1036 
    1037         Function SetVarCustData(
    1038             /* [in] */ UINT index,
    1039             /* [in] */ REFGUID guid,
    1040             /* [in] */ VARIANT *pVarVal) As HRESULT
    1041 
    1042         Function SetImplTypeCustData(
    1043             /* [in] */ UINT index,
    1044             /* [in] */ REFGUID guid,
    1045             /* [in] */ VARIANT *pVarVal) As HRESULT
    1046 
    1047         Function SetHelpStringContext(
    1048             /* [in] */ ULONG dwHelpStringContext) As HRESULT
    1049 
    1050         Function SetFuncHelpStringContext(
    1051             /* [in] */ UINT index,
    1052             /* [in] */ ULONG dwHelpStringContext) As HRESULT
    1053 
    1054         Function SetVarHelpStringContext(
    1055             /* [in] */ UINT index,
    1056             /* [in] */ ULONG dwHelpStringContext) As HRESULT
    1057 
    1058         Function Invalidate( void) As HRESULT
    1059 
    1060         Function SetName(
    1061             /* [in] */ LPOLESTR szName) As HRESULT
    1062 
    1063     };
    1064 
    1065 
     1031TypeDef LPCREATETYPEINFO2 = /* [unique] */ *ICreateTypeInfo2
     1032
     1033Dim IID_ICreateTypeInfo2 = [&h0002040E, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     1034
     1035Interface ICreateTypeInfo2
     1036    Inherits ICreateTypeInfo
     1037
     1038    Function DeleteFuncDesc(
     1039        /* [in] */ index As DWord) As HRESULT
     1040
     1041    Function DeleteFuncDescByMemId(
     1042        /* [in] */ memid As *MEMBERID,
     1043        /* [in] */ invKind As *INVOKEKIND) As HRESULT
     1044
     1045    Function DeleteVarDesc(
     1046        /* [in] */ index As DWord) As HRESULT
     1047
     1048    Function DeleteVarDescByMemId(
     1049        /* [in] */ memid As *MEMBERID) As HRESULT
     1050
     1051    Function DeleteImplType(
     1052        /* [in] */ index As DWord) As HRESULT
     1053
     1054    Function SetCustData(
     1055        /* [in] */ ByRef guid As GUID,
     1056        /* [in] */ ByRef VarVal As VARIANT) As HRESULT
     1057
     1058    Function SetFuncCustData(
     1059        /* [in] */ index As DWord,
     1060        /* [in] */ ByRef guid As GUID,
     1061        /* [in] */ ByRef VarVal As VARIANT) As HRESULT
     1062
     1063    Function SetParamCustData(
     1064        /* [in] */ indexFunc As DWord,
     1065        /* [in] */ indexParam As DWord,
     1066        /* [in] */ ByRef guid As GUID,
     1067        /* [in] */ ByRef VarVal As VARIANT) As HRESULT
     1068
     1069    Function SetVarCustData(
     1070        /* [in] */ index As DWord,
     1071        /* [in] */ ByRef guid As GUID,
     1072        /* [in] */ ByRef VarVal As VARIANT) As HRESULT
     1073
     1074    Function SetImplTypeCustData(
     1075        /* [in] */ index As DWord,
     1076        /* [in] */ ByRef guid As GUID,
     1077        /* [in] */ ByRef VarVal As VARIANT) As HRESULT
     1078
     1079    Function SetHelpStringContext(
     1080        /* [in] */ dwHelpStringContext As DWord) As HRESULT
     1081
     1082    Function SetFuncHelpStringContext(
     1083        /* [in] */ index As DWord,
     1084        /* [in] */ dwHelpStringContext As DWord) As HRESULT
     1085
     1086    Function SetVarHelpStringContext(
     1087        /* [in] */ index As DWord,
     1088        /* [in] */ dwHelpStringContext As DWord) As HRESULT
     1089
     1090    Function Invalidate() As HRESULT
     1091
     1092    Function SetName(
     1093        /* [in] */ szName As LPOLESTR) As HRESULT
     1094End Interface
    10661095
    10671096#endif  /* __ICreateTypeInfo2_INTERFACE_DEFINED__ */
     
    10741103/* [local][unique][uuid][object] */
    10751104
    1076 'typedef /* [unique] */ ICreateTypeLib *LPCREATETYPELIB;
    1077 
    1078 
    1079 EXTERN_C const IID IID_ICreateTypeLib;
    1080 
    1081     MIDL_INTERFACE("00020406-0000-0000-C000-000000000046")
    1082     ICreateTypeLib : public IUnknown
    1083     {
    1084     public:
    1085         Function CreateTypeInfo(
    1086             /* [in] */ LPOLESTR szName,
    1087             /* [in] */ TYPEKIND tkind,
    1088             /* [out] */ ICreateTypeInfo **ppCTInfo) As HRESULT
    1089 
    1090         Function SetName(
    1091             /* [in] */ LPOLESTR szName) As HRESULT
    1092 
    1093         Function SetVersion(
    1094             /* [in] */ WORD wMajorVerNum,
    1095             /* [in] */ WORD wMinorVerNum) As HRESULT
    1096 
    1097         Function SetGuid(
    1098             /* [in] */ REFGUID guid) As HRESULT
    1099 
    1100         Function SetDocString(
    1101             /* [in] */ LPOLESTR szDoc) As HRESULT
    1102 
    1103         Function SetHelpFileName(
    1104             /* [in] */ LPOLESTR szHelpFileName) As HRESULT
    1105 
    1106         Function SetHelpContext(
    1107             /* [in] */ DWORD dwHelpContext) As HRESULT
    1108 
    1109         Function SetLcid(
    1110             /* [in] */ LCID lcid) As HRESULT
    1111 
    1112         Function SetLibFlags(
    1113             /* [in] */ UINT uLibFlags) As HRESULT
    1114 
    1115         Function SaveAllChanges( void) As HRESULT
    1116 
    1117     };
     1105TypeDef LPCREATETYPELIB = /* [unique] */ *ICreateTypeLib
     1106
     1107
     1108Dim IID_ICreateTypeLib = [&h00020406, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     1109Interface ICreateTypeLib
     1110    Inherits IUnknown
     1111
     1112    Function CreateTypeInfo(
     1113        /* [in] */ szName As LPOLESTR,
     1114        /* [in] */ tkind As *TYPEKIND,
     1115        /* [out] */ ByRef pCTInfo As *ICreateTypeInfo) As HRESULT
     1116
     1117    Function SetName(
     1118        /* [in] */ szName As LPOLESTR) As HRESULT
     1119
     1120    Function SetVersion(
     1121        /* [in] */ wMajorVerNum As Word,
     1122        /* [in] */ wMinorVerNum As Word) As HRESULT
     1123
     1124    Function SetGuid(
     1125        /* [in] */ ByRef guid As GUID) As HRESULT
     1126
     1127    Function SetDocString(
     1128        /* [in] */ szDoc As LPOLESTR) As HRESULT
     1129
     1130    Function SetHelpFileName(
     1131        /* [in] */ szHelpFileName As LPOLESTR) As HRESULT
     1132
     1133    Function SetHelpContext(
     1134        /* [in] */ dwHelpContext As DWord) As HRESULT
     1135
     1136    Function SetLcid(
     1137        /* [in] */ lcid As LCID) As HRESULT
     1138
     1139    Function SetLibFlags(
     1140        /* [in] */ uLibFlags As DWord) As HRESULT
     1141
     1142    Function SaveAllChanges() As HRESULT
     1143End Interface
    11181144
    11191145
    11201146#endif  /* __ICreateTypeLib_INTERFACE_DEFINED__ */
    1121 
    11221147
    11231148#ifndef __ICreateTypeLib2_INTERFACE_DEFINED__
     
    11271152/* [local][unique][uuid][object] */
    11281153
    1129 typedef /* [unique] */ ICreateTypeLib2 *LPCREATETYPELIB2;
    1130 
    1131 
    1132 EXTERN_C const IID IID_ICreateTypeLib2;
    1133 
    1134     MIDL_INTERFACE("0002040F-0000-0000-C000-000000000046")
    1135     ICreateTypeLib2 : public ICreateTypeLib
    1136     {
    1137     public:
    1138         Function DeleteTypeInfo(
    1139             /* [in] */ LPOLESTR szName) As HRESULT
    1140 
    1141         Function SetCustData(
    1142             /* [in] */ REFGUID guid,
    1143             /* [in] */ VARIANT *pVarVal) As HRESULT
    1144 
    1145         Function SetHelpStringContext(
    1146             /* [in] */ ULONG dwHelpStringContext) As HRESULT
    1147 
    1148         Function SetHelpStringDll(
    1149             /* [in] */ LPOLESTR szFileName) As HRESULT
    1150 
    1151     };
     1154TypeDef LPCREATETYPELIB2 = /* [unique] */ *ICreateTypeLib2
     1155
     1156
     1157Dim IID_ICreateTypeLib2 = [&h0002040F, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     1158
     1159Interface ICreateTypeLib2
     1160    Inherits ICreateTypeLib
     1161
     1162    Function DeleteTypeInfo(
     1163        /* [in] */ szName As LPOLESTR) As HRESULT
     1164
     1165    Function SetCustData(
     1166        /* [in] */ ByRef guid As GUID,
     1167        /* [in] */ ByRef VarVal As VARIANT) As HRESULT
     1168
     1169    Function SetHelpStringContext(
     1170        /* [in] */ dwHelpStringContext As DWord) As HRESULT
     1171
     1172    Function SetHelpStringDll(
     1173        /* [in] */ szFileName As LPOLESTR) As HRESULT
     1174
     1175End Interface
    11521176
    11531177
    11541178#endif  /* __ICreateTypeLib2_INTERFACE_DEFINED__ */
    1155 
    1156 #endif '__UNDECLARED__
    11571179
    11581180#ifndef __IDispatch_INTERFACE_DEFINED__
     
    12461268/* [unique][uuid][object] */
    12471269
    1248 typedef /* [unique] */ ITypeComp *LPTYPECOMP;
    1249 
    1250 typedef /* [v1_enum] */
    1251 enum tagDESCKIND
    1252     {   DESCKIND_NONE = 0,
    1253     DESCKIND_FUNCDESC = DESCKIND_NONE + 1,
    1254     DESCKIND_VARDESC = DESCKIND_FUNCDESC + 1,
    1255     DESCKIND_TYPECOMP = DESCKIND_VARDESC + 1,
    1256     DESCKIND_IMPLICITAPPOBJ = DESCKIND_TYPECOMP + 1,
    1257     DESCKIND_MAX = DESCKIND_IMPLICITAPPOBJ + 1
    1258     }   DESCKIND;
    1259 
    1260 typedef union tagBINDPTR
    1261     {
    1262     FUNCDESC *lpfuncdesc;
    1263     VARDESC *lpvardesc;
    1264     ITypeComp *lptcomp;
    1265     }   BINDPTR;
    1266 
    1267 typedef union tagBINDPTR *LPBINDPTR;
    1268 
     1270TypeDef /* [unique] */ ITypeComp *LPTYPECOMP;
     1271
     1272/* [v1_enum] */
     1273Const Enum DESCKIND
     1274    DESCKIND_NONE
     1275    DESCKIND_FUNCDESC = DESCKIND_NONE
     1276    DESCKIND_VARDESC = DESCKIND_FUNCDESC
     1277    DESCKIND_TYPECOMP = DESCKIND_VARDESC
     1278    DESCKIND_IMPLICITAPPOBJ = DESCKIND_TYPECOMP
     1279    DESCKIND_MAX = DESCKIND_IMPLICITAPPOBJ
     1280End Enum
     1281/*
     1282Union BINDPTR
     1283    lpfuncdesc As *FUNCDESC
     1284    lpvardesc As *VARDESC
     1285    lptcomp As *ITypeComp
     1286End Union
     1287
     1288TypeDef LPBINDPTR = *BINDPTR
     1289*/
    12691290
    12701291EXTERN_C const IID IID_ITypeComp;
     
    13001321/* [unique][uuid][object] */
    13011322
    1302 typedef /* [unique] */ ITypeInfo *LPTYPEINFO;
     1323TypeDef /* [unique] */ ITypeInfo *LPTYPEINFO;
    13031324
    13041325
     
    14071428/* [unique][uuid][object] */
    14081429
    1409 typedef /* [unique] */ ITypeInfo2 *LPTYPEINFO2;
     1430TypeDef /* [unique] */ ITypeInfo2 *LPTYPEINFO2;
    14101431
    14111432
     
    14951516/* [unique][uuid][object] */
    14961517
    1497 typedef /* [v1_enum] */
     1518TypeDef /* [v1_enum] */
    14981519enum tagSYSKIND
    14991520    {   SYS_WIN16 = 0,
     
    15031524    }   SYSKIND;
    15041525
    1505 typedef /* [v1_enum] */
     1526TypeDef /* [v1_enum] */
    15061527enum tagLIBFLAGS
    15071528    {   LIBFLAG_FRESTRICTED = 0x1,
     
    15111532    }   LIBFLAGS;
    15121533
    1513 typedef /* [unique] */ ITypeLib *LPTYPELIB;
    1514 
    1515 typedef struct tagTLIBATTR
     1534TypeDef /* [unique] */ ITypeLib *LPTYPELIB;
     1535
     1536TypeDef struct tagTLIBATTR
    15161537    {
    15171538    GUID guid;
     
    15231544    }   TLIBATTR;
    15241545
    1525 typedef struct tagTLIBATTR *LPTLIBATTR;
     1546TypeDef struct tagTLIBATTR *LPTLIBATTR;
    15261547
    15271548
     
    15851606/* [unique][uuid][object] */
    15861607
    1587 typedef /* [unique] */ ITypeLib2 *LPTYPELIB2;
     1608TypeDef /* [unique] */ ITypeLib2 *LPTYPELIB2;
    15881609
    15891610
     
    16231644/* [local][unique][uuid][object] */
    16241645
    1625 typedef /* [unique] */ ITypeChangeEvents *LPTYPECHANGEEVENTS;
    1626 
    1627 typedef
    1628 enum tagCHANGEKIND
    1629     {   CHANGEKIND_ADDMEMBER = 0,
     1646TypeDef /* [unique] */ ITypeChangeEvents *LPTYPECHANGEEVENTS;
     1647
     1648Enum CHANGEKIND
     1649    CHANGEKIND_ADDMEMBER = 0,
    16301650    CHANGEKIND_DELETEMEMBER = CHANGEKIND_ADDMEMBER + 1,
    16311651    CHANGEKIND_SETNAMES = CHANGEKIND_DELETEMEMBER + 1,
     
    16351655    CHANGEKIND_CHANGEFAILED = CHANGEKIND_INVALIDATE + 1,
    16361656    CHANGEKIND_MAX = CHANGEKIND_CHANGEFAILED + 1
    1637     }   CHANGEKIND;
     1657End Enum
    16381658
    16391659
     
    16661686/* [unique][uuid][object] */
    16671687
    1668 typedef /* [unique] */ IErrorInfo *LPERRORINFO;
     1688TypeDef /* [unique] */ IErrorInfo *LPERRORINFO;
    16691689
    16701690
     
    17011721/* [unique][uuid][object] */
    17021722
    1703 typedef /* [unique] */ ICreateErrorInfo *LPCREATEERRORINFO;
     1723TypeDef /* [unique] */ ICreateErrorInfo *LPCREATEERRORINFO;
    17041724
    17051725
     
    17361756/* [unique][uuid][object] */
    17371757
    1738 typedef /* [unique] */ ISupportErrorInfo *LPSUPPORTERRORINFO;
     1758TypeDef /* [unique] */ ISupportErrorInfo *LPSUPPORTERRORINFO;
    17391759
    17401760
     
    18241844/* [uuid][object][local] */
    18251845
    1826 typedef /* [unique] */ IRecordInfo *LPRECORDINFO;
     1846TypeDef /* [unique] */ IRecordInfo *LPRECORDINFO;
    18271847
    18281848
     
    18981918#endif  /* __IRecordInfo_INTERFACE_DEFINED__ */
    18991919
     1920#endif ' __UNDEFINED__
     1921
    19001922
    19011923#ifndef __IErrorLog_INTERFACE_DEFINED__
     
    19051927/* [unique][uuid][object] */
    19061928
    1907 typedef IErrorLog *LPERRORLOG;
    1908 
    1909 
    1910 EXTERN_C const IID IID_IErrorLog;
    1911 
    1912     MIDL_INTERFACE("3127CA40-446E-11CE-8135-00AA004BB851")
    1913     IErrorLog : public IUnknown
    1914     {
    1915     public:
    1916         Function AddError(
    1917             /* [in] */ LPCOLESTR pszPropName,
    1918             /* [in] */ EXCEPINFO *pExcepInfo) As HRESULT
    1919 
    1920     };
     1929TypeDef LPERRORLOG = *IErrorLog
     1930
     1931Dim IID_IErrorLog = [&h3127CA40, &h446E, &h11CE, [&h81, &h35, &h00, &hAA, &h00, &h4B, &hB8, &h51]] As IID
     1932
     1933Interface IErrorLog
     1934    Inherits IUnknown
     1935
     1936    Function AddError(
     1937        /* [in] */ pszPropName As LPCOLESTR,
     1938        /* [in] */ ByRef pExcepInfo As EXCEPINFO) As HRESULT
     1939End Interface
    19211940
    19221941#endif  /* __IErrorLog_INTERFACE_DEFINED__ */
     
    19291948/* [unique][uuid][object] */
    19301949
    1931 typedef IPropertyBag *LPPROPERTYBAG;
    1932 
    1933 
    1934 EXTERN_C const IID IID_IPropertyBag;
    1935 
    1936     MIDL_INTERFACE("55272A00-42CB-11CE-8135-00AA004BB851")
    1937     IPropertyBag : public IUnknown
    1938     {
    1939     public:
    1940         virtual /* [local] */ HRESULT STDMETHODCALLTYPE Read(
    1941             /* [in] */ LPCOLESTR pszPropName,
    1942             /* [out][in] */ VARIANT *pVar,
    1943             /* [in] */ IErrorLog *pErrorLog) As HRESULT
    1944 
    1945         Function Write(
    1946             /* [in] */ LPCOLESTR pszPropName,
    1947             /* [in] */ VARIANT *pVar) As HRESULT
    1948 
    1949     };
     1950TypeDef LPPROPERTYBAG = *IPropertyBag
     1951
     1952Dim IID_IPropertyBag = [&h55272A00, &h42CB, &h11CE, [&h81, &h35, &h00, &hAA, &h00, &h4B, &hB8, &h51]] As IID
     1953
     1954Interface IPropertyBag
     1955    Inherits IUnknown
     1956
     1957    /* [local] */ Function Read(
     1958        /* [in] */ pszPropName As LPCOLESTR,
     1959        /* [out][in] */ ByRef Var As VARIANT,
     1960        /* [in] */ pErrorLog As *IErrorLog) As HRESULT
     1961
     1962    Function Write(
     1963        /* [in] */ pszPropName As LPCOLESTR,
     1964        /* [in] */ ByRef Var As VARIANT) As HRESULT
     1965End Interface
     1966
    19501967#endif  /* __IPropertyBag_INTERFACE_DEFINED__ */
    19511968
    1952 #endif ' __UNDEFINED__
    1953 
    19541969#endif '_INC_OAIDL_AB
  • Include/OleAuto.ab

    r35 r42  
    11' OleAuto.ab
    22
    3 #ifdef _INC_OLEAUTO_AB
     3#ifndef _INC_OLEAUTO_AB
    44#define _INC_OLEAUTO_AB
    55
     
    2323
    2424#include <oaidl.ab>
     25'Dummy
     26Interface ITypeLib
     27    Inherits IUnknown
     28End Interface
     29
     30Interface ITypeInfo
     31    Inherits IUnknown
     32End Interface
     33
     34Interface IErrorInfo
     35    Inherits IUnknown
     36End Interface
     37
     38Interface ICreateErrorInfo
     39    Inherits IUnknown
     40End Interface
     41
     42Const Enum SYSKIND
     43End Enum
    2544
    2645' BSTR API
     
    5271Declare Function SafeArrayCreate Lib "oleaut32" (vt As VARTYPE, cDims As DWord, ByRef rgsabound As SAFEARRAYBOUND) As *SAFEARRAY
    5372Declare Function SafeArrayCreateEx Lib "oleaut32" (vt As VARTYPE, cDims As DWord, ByRef rgsabound As SAFEARRAYBOUND, pvExtra As VoidPtr) As *SAFEARRAY
    54 Declare Function SafeArrayAllocData Lib "oleaut32" (psaSource As *SAFEARRAY, psaTarget As *SAFEARRAY) As HRESULT
     73Declare Function SafeArrayCopyData Lib "oleaut32" (psaSource As *SAFEARRAY, psaTarget As *SAFEARRAY) As HRESULT
    5574Declare Function SafeArrayDestroyDescriptor Lib "oleaut32" (psa As *SAFEARRAY) As HRESULT
    5675Declare Function SafeArrayDestroyData Lib "oleaut32" (psa As *SAFEARRAY) As HRESULT
     
    6786Declare Function SafeArrayGetElement Lib "oleaut32" (psa As *SAFEARRAY, rgIndices As *Long, ByRef v As Any) As HRESULT
    6887Declare Function SafeArrayPutElement Lib "oleaut32" (psa As *SAFEARRAY, rgIndices As *Long, ByRef v As Any) As HRESULT
    69 Declare Function SafeArrayUnaccessData Lib "oleaut32" (psa As *SAFEARRAY, ByRef ppsaOut As *SAFEARRAY) As HRESULT
     88Declare Function SafeArrayCopy Lib "oleaut32" (psa As *SAFEARRAY, ByRef ppsaOut As *SAFEARRAY) As HRESULT
    7089Declare Function SafeArrayPtrOfIndex Lib "oleaut32" (psa As *SAFEARRAY, rgIndices As *Long, ByRef pvData As VoidPtr) As HRESULT
    7190Declare Function SafeArraySetRecordInfo Lib "oleaut32" (psa As *SAFEARRAY, prinfo As *IRecordInfo) As HRESULT
     
    252271Declare Function VarBstrFromDate Lib "oleaut32" (dateIn As DATE, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    253272Declare Function VarBstrFromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    254 Declare Function VarBstrFromBool Lib "oleaut32" (VARIANT_BOOL boolIn, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
     273Declare Function VarBstrFromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    255274Declare Function VarBstrFromI1 Lib "oleaut32" (cIn As CHAR, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    256 Declare Function VarBstrFromUI2 Lib "oleaut32" (Word uiIn, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
     275Declare Function VarBstrFromUI2 Lib "oleaut32" (uiIn As Word, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    257276Declare Function VarBstrFromUI4 Lib "oleaut32" (ulIn As DWord, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    258277Declare Function VarBstrFromUI8 Lib "oleaut32" (i64In As QWord, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
     
    331350Declare Function VarUI8FromCy Lib "oleaut32" (cyIn As CY, ByRef i64Out As QWord) As HRESULT
    332351Declare Function VarUI8FromDate Lib "oleaut32" (dateIn As DATE, ByRef i64Out As QWord) As HRESULT
    333 Declare Function VarUI8FromStr Lib "oleaut32" (strIn As *OLECHAR, lcid As LCID, dwFlags As DWord, QWord pi64Out) As HRESULT
    334 Declare Function VarUI8FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, QWord pi64Out) As HRESULT
     352Declare Function VarUI8FromStr Lib "oleaut32" (strIn As *OLECHAR, lcid As LCID, dwFlags As DWord, ByRef i64Out As QWord) As HRESULT
     353Declare Function VarUI8FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef i64Out As QWord) As HRESULT
    335354Declare Function VarUI8FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef i64Out As QWord) As HRESULT
    336355Declare Function VarUI8FromI1 Lib "oleaut32" (cIn As CHAR, ByRef i64Out As QWord) As HRESULT
     
    338357Declare Function VarUI8FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef i64Out As QWord) As HRESULT
    339358Declare Function VarUI8FromDec Lib "oleaut32" (ByRef decIn As DECIMAL, ByRef i64Out As QWord) As HRESULT
    340 Declare Function VarUI8FromInt Lib "oleaut32" (intIn As Long, ByRef i64Out As QWord) As HRESULT
    341359
    342360Declare Function VarDecFromUI1 Lib "oleaut32" (bIn As Byte, ByRef decOut As DECIMAL) As HRESULT
     
    349367Declare Function VarDecFromCy Lib "oleaut32" (cyIn As CY, ByRef decOut As DECIMAL) As HRESULT
    350368Declare Function VarDecFromStr Lib "oleaut32" (strIn As *OLECHAR, lcid As LCID, dwFlags As DWord, ByRef decOut As DECIMAL) As HRESULT
    351 Declare Function VarDecFromDisp Lib "oleaut32" (pdispIn As *IDispatch,, lcid As LCID, ByRef decOut As DECIMAL) As HRESULT
     369Declare Function VarDecFromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef decOut As DECIMAL) As HRESULT
    352370Declare Function VarDecFromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef decOut As DECIMAL) As HRESULT
    353371Declare Function VarDecFromI1 Lib "oleaut32" (cIn As CHAR, ByRef decOut As DECIMAL) As HRESULT
     
    383401Declare Function VarUI8FromUint Lib "oleaut32" Alias "VarUI8FromUI4" (ulIn As DWord, ByRef i64Out As QWord) As HRESULT
    384402Declare Function VarDecFromInt Lib "oleaut32" Alias "VarDecFromI4" (lIn As LONG, ByRef decOut As DECIMAL) As HRESULT
    385 Declare Function VarDecFromUI8 Lib "oleaut32" (ui64In As QWord, ByRef decOut As DECIMAL) As HRESULT
    386403
    387404Declare Function VarIntFromUI1 Lib "oleaut32" Alias "VarI4FromUI1" (bIn As Byte, ByRef lOut As Long) As HRESULT
     
    475492Const VTBIT_DECIMAL = (1 << VT_DECIMAL)
    476493
    477 Declare Function VarParseNumFromStr(strIn As *OLECHAR, lcid As LCID, dwFlags As DWord, ByRef numprs As NUMPARSE, rgbDig As *Byte) As HRESULT
    478 Declare Function VarNumFromParseNum(ByRef numprs As NUMPARSE, rgbDig As *Byte, dwVtBits As DWord, ByRef var As VARIANT) As HRESULT
     494Declare Function VarParseNumFromStr Lib "oleaut32" (strIn As *OLECHAR, lcid As LCID, dwFlags As DWord, ByRef numprs As NUMPARSE, rgbDig As *Byte) As HRESULT
     495Declare Function VarNumFromParseNum Lib "oleaut32" (ByRef numprs As NUMPARSE, rgbDig As *Byte, dwVtBits As DWord, ByRef var As VARIANT) As HRESULT
    479496
    480497' VARTYPE Math API
     
    493510Declare Function VarXor Lib "oleaut32" (ByRef lhs As VARIANT, ByRef rhs As VARIANT, ByRef result As VARIANT) As HRESULT
    494511
    495 Declare Function VarXor Lib "oleaut32" (ByRef in As VARIANT, ByRef result As VARIANT) As HRESULT
     512Declare Function VarAbs Lib "oleaut32" (ByRef in As VARIANT, ByRef result As VARIANT) As HRESULT
    496513Declare Function VarFix Lib "oleaut32" (ByRef in As VARIANT, ByRef result As VARIANT) As HRESULT
    497514Declare Function VarInt Lib "oleaut32" (ByRef in As VARIANT, ByRef result As VARIANT) As HRESULT
     
    535552
    536553Declare Function VarBstrCat Lib "oleaut32" (lhs As BSTR, rhs As BSTR, ByRef result As BSTR) As HRESULT
    537 Declare Function VarBstrCat Lib "oleaut32" (lhs As BSTR, rhs As BSTR, lcid As LCID, dwFlags As DWord) As HRESULT
     554Declare Function VarBstrCmp Lib "oleaut32" (lhs As BSTR, rhs As BSTR, lcid As LCID, dwFlags As DWord) As HRESULT
    538555Declare Function VarR8Pow Lib "oleaut32" (lhs As Double, rhs As Double, ByRef result As Double) As HRESULT
    539556Declare Function VarR4CmpR8 Lib "oleaut32" (lhs As Single, rhs As Double) As HRESULT
     
    557574Declare Function VarUdateFromDate Lib "oleaut32" (dateIn As DATE, dwFlags As DWord, ByRef udateOut As UDATE) As HRESULT
    558575
    559 Declare Function VarUdateFromDate Lib "oleaut32" (lcid As LCID, ByRef rgp As LPOLESTR) As HRESULT
     576Declare Function GetAltMonthNames Lib "oleaut32" (lcid As LCID, ByRef rgp As LPOLESTR) As HRESULT
    560577
    561578' Format
     
    569586Declare Function VarMonthName Lib "oleaut32" (iMonth As Long, fAbbrev As Long, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    570587
    571 Declare Function VarFormatFromTokens Lib "oleaut32" (ByRef in As VARIANT, pstrFormat As LPOLESTR, pbTokCur As *Bute, dwFlags As DWord, ByRef bstrOut As BSTR, lcid As LCID) As HRESULT
    572 Declare Function VarTokenizeFormatString Lib "oleaut32" (pstrFormat As LPOLESTR, rgbTok As *Bute, cbTok As Long, iFirstDay As Long, iFirstWeek As Long, lcid As LCID, ByRef cbActual As Long) As HRESULT
     588Declare Function VarFormatFromTokens Lib "oleaut32" (ByRef in As VARIANT, pstrFormat As LPOLESTR, pbTokCur As *Byte, dwFlags As DWord, ByRef bstrOut As BSTR, lcid As LCID) As HRESULT
     589Declare Function VarTokenizeFormatString Lib "oleaut32" (pstrFormat As LPOLESTR, rgbTok As *Byte, cbTok As Long, iFirstDay As Long, iFirstWeek As Long, lcid As LCID, ByRef cbActual As Long) As HRESULT
    573590
    574591' ITypeLib
     
    669686
    670687Declare Function RegisterActiveObject Lib "oleaut32" (punk As *IUnknown, ByRef rclsid As CLSID, dwFlags As DWord, ByRef dwRegister As DWord) As HRESULT
    671 Declare Function RegisterActiveObject Lib "oleaut32" (dwRegister As DWord, pvReserved As VoidPtr) As HRESULT
     688Declare Function RevokeActiveObject Lib "oleaut32" (dwRegister As DWord, pvReserved As VoidPtr) As HRESULT
    672689Declare Function GetActiveObject Lib "oleaut32" (ByRef rclsid As CLSID, pvReserved As VoidPtr, ByRef punk As *IUnknown) As HRESULT
    673690
     
    683700' MISC API
    684701Declare Function OaBuildVersion Lib "oleaut32" () As DWord
    685 Declare Sub OaBuildVersion Lib "oleaut32" (ByRef CustData As CUSTDATA)
     702Declare Sub ClearCustData Lib "oleaut32" (ByRef CustData As CUSTDATA)
    686703
    687704#endif '_INC_OLEAUTO_AB
  • Include/api_system.sbp

    r35 r42  
    2121Const STANDARD_RIGHTS_REQUIRED = &H000F0000
    2222
     23Const MAXIMUM_WAIT_OBJECTS = 64
    2324
    2425'-----------------
  • Include/api_winerror.sbp

    r35 r42  
    16081608Const DNS_ERROR_DP_NOT_AVAILABLE = 9905
    16091609Const DNS_ERROR_DP_FSMO_ERROR = 9906
    1610 '#ifndef WSABASEERR
    1611 'Const WSABASEERR = 10000
     1610#ifndef WSABASEERR
     1611#define WSABASEERR
     1612Const WSABASEERR = 10000
    16121613Const WSAEINTR = 10004
    16131614Const WSAEBADF = 10009
     
    16991700Const WSA_QOS_ESHAPERATEOBJ = 11030
    17001701Const WSA_QOS_RESERVED_PETYPE = 11031
    1701 '#endif
     1702#endif
    17021703Const ERROR_SXS_SECTION_NOT_FOUND = 14000
    17031704Const ERROR_SXS_CANT_GEN_ACTCTX = 14001
  • Include/api_winsock2.sbp

    r24 r42  
    1 ' api_winsock2.sbp
    2 'Windows Sockets Ver2.0
    3 
    4 
    5 #ifndef _INC_WINSOCK2
    6 #define _INC_WINSOCK2
     1#ifndef _WINSOCK2API_
     2#define _WINSOCK2API_
     3#define _WINSOCKAPI_
     4/*
     5#ifndef INCL_WINSOCK_API_PROTOTYPES
     6#define INCL_WINSOCK_API_PROTOTYPES 1
     7#endif
     8
     9#ifndef INCL_WINSOCK_API_TYPEDEFS
     10#define INCL_WINSOCK_API_TYPEDEFS 0
     11#endif
     12*/
     13
     14Const WINSOCK_VERSION = MAKEWORD(2, 2)
    715
    816TypeDef SOCKET = ULONG_PTR
    917
    10 Const SOCKET_ERROR = -1
    11 Const INVALID_SOCKET = -1
    12 
    13 
    14 'Port/socket numbers - network standard functions
    15 Const IPPORT_ECHO =           7
    16 Const IPPORT_DISCARD =        9
    17 Const IPPORT_SYSTAT =         11
    18 Const IPPORT_DAYTIME =        13
    19 Const IPPORT_NETSTAT =        15
    20 Const IPPORT_FTP =            21
    21 Const IPPORT_TELNET =         23
    22 Const IPPORT_SMTP =           25
    23 Const IPPORT_TIMESERVER =     37
    24 Const IPPORT_NAMESERVER =     42
    25 Const IPPORT_WHOIS =          43
    26 Const IPPORT_MTP =            57
    27 
    28 
    29 'Address families
    30 Const AF_UNSPEC =     0
    31 Const AF_UNIX =       1
    32 Const AF_INET =       2
    33 Const AF_IMPLINK =    3
    34 Const AF_PUP =        4
    35 Const AF_CHAOS =      5
    36 Const AF_NS =         6
    37 Const AF_IPX =        AF_NS
    38 Const AF_ISO =        7
    39 Const AF_OSI =        AF_ISO
    40 Const AF_ECMA =       8
    41 Const AF_DATAKIT =    9
    42 Const AF_CCITT =      10
    43 Const AF_SNA =        11
    44 Const AF_DECnet =     12
    45 Const AF_DLI =        13
    46 Const AF_LAT =        14
    47 Const AF_HYLINK =     15
    48 Const AF_APPLETALK =  16
    49 Const AF_NETBIOS =    17
    50 Const AF_VOICEVIEW =  18
    51 Const AF_FIREFOX =    19
    52 Const AF_UNKNOWN1 =   20
    53 Const AF_BAN =        21
    54 Const AF_ATM =        22
    55 Const AF_INET6 =      23
    56 Const AF_CLUSTER =    24
    57 Const AF_12844 =      25
    58 Const AF_MAX =        26
    59 
    60 
    61 'Protocol families
    62 Const PF_UNSPEC =     AF_UNSPEC
    63 Const PF_UNIX =       AF_UNIX
    64 Const PF_INET =       AF_INET
    65 Const PF_IMPLINK =    AF_IMPLINK
    66 Const PF_PUP =        AF_PUP
    67 Const PF_CHAOS =      AF_CHAOS
    68 Const PF_NS =         AF_NS
    69 Const PF_IPX =        AF_IPX
    70 Const PF_ISO =        AF_ISO
    71 Const PF_OSI =        AF_OSI
    72 Const PF_ECMA =       AF_ECMA
    73 Const PF_DATAKIT =    AF_DATAKIT
    74 Const PF_CCITT =      AF_CCITT
    75 Const PF_SNA =        AF_SNA
    76 Const PF_DECnet =     AF_DECnet
    77 Const PF_DLI =        AF_DLI
    78 Const PF_LAT =        AF_LAT
    79 Const PF_HYLINK =     AF_HYLINK
    80 Const PF_APPLETALK =  AF_APPLETALK
    81 Const PF_VOICEVIEW =  AF_VOICEVIEW
    82 Const PF_FIREFOX =    AF_FIREFOX
    83 Const PF_UNKNOWN1 =   AF_UNKNOWN1
    84 Const PF_BAN =        AF_BAN
    85 Const PF_ATM =        AF_ATM
    86 Const PF_INET6 =      AF_INET6
    87 Const PF_MAX =        AF_MAX
    88 
    89 
    90 Const MSG_OOB =       1       'process out-of-band data
    91 Const MSG_PEEK =      2       'peek at incoming message
    92 Const MSG_DONTROUTE = 4       'send without using routing tables
    93 
    94 
    95 'Error code
    96 Const WSABASEERR =            10000
    97 Const WSAEINTR =              WSABASEERR+4
    98 Const WSAEBADF =              WSABASEERR+9
    99 Const WSAEACCES =             WSABASEERR+13
    100 Const WSAEFAULT =             WSABASEERR+14
    101 Const WSAEINVAL =             WSABASEERR+22
    102 Const WSAEMFILE =             WSABASEERR+24
    103 Const WSAEWOULDBLOCK =        WSABASEERR+35
    104 Const WSAEINPROGRESS =        WSABASEERR+36
    105 Const WSAEALREADY =           WSABASEERR+37
    106 Const WSAENOTSOCK =           WSABASEERR+38
    107 Const WSAEDESTADDRREQ =       WSABASEERR+39
    108 Const WSAEMSGSIZE =           WSABASEERR+40
    109 Const WSAEPROTOTYPE =         WSABASEERR+41
    110 Const WSAENOPROTOOPT =        WSABASEERR+42
    111 Const WSAEPROTONOSUPPORT =    WSABASEERR+43
    112 Const WSAESOCKTNOSUPPORT =    WSABASEERR+44
    113 Const WSAEOPNOTSUPP =         WSABASEERR+45
    114 Const WSAEPFNOSUPPORT =       WSABASEERR+46
    115 Const WSAEAFNOSUPPORT =       WSABASEERR+47
    116 Const WSAEADDRINUSE =         WSABASEERR+48
    117 Const WSAEADDRNOTAVAIL =      WSABASEERR+49
    118 Const WSAENETDOWN =           WSABASEERR+50
    119 Const WSAENETUNREACH =        WSABASEERR+51
    120 Const WSAENETRESET =          WSABASEERR+52
    121 Const WSAECONNABORTED =       WSABASEERR+53
    122 Const WSAECONNRESET =         WSABASEERR+54
    123 Const WSAENOBUFS =            WSABASEERR+55
    124 Const WSAEISCONN =            WSABASEERR+56
    125 Const WSAENOTCONN =           WSABASEERR+57
    126 Const WSAESHUTDOWN =          WSABASEERR+58
    127 Const WSAETOOMANYREFS =       WSABASEERR+59
    128 Const WSAETIMEDOUT =          WSABASEERR+60
    129 Const WSAECONNREFUSED =       WSABASEERR+61
    130 Const WSAELOOP =              WSABASEERR+62
    131 Const WSAENAMETOOLONG =       WSABASEERR+63
    132 Const WSAEHOSTDOWN =          WSABASEERR+64
    133 Const WSAEHOSTUNREACH =       WSABASEERR+65
    134 Const WSAENOTEMPTY =          WSABASEERR+66
    135 Const WSAEPROCLIM =           WSABASEERR+67
    136 Const WSAEUSERS =             WSABASEERR+68
    137 Const WSAEDQUOT =             WSABASEERR+69
    138 Const WSAESTALE =             WSABASEERR+70
    139 Const WSAEREMOTE =            WSABASEERR+71
    140 Const WSASYSNOTREADY =        WSABASEERR+91
    141 Const WSAVERNOTSUPPORTED =    WSABASEERR+92
    142 Const WSANOTINITIALISED =     WSABASEERR+93
    143 Const WSAEDISCON =            WSABASEERR+101
    144 Const WSAENOMORE =            WSABASEERR+102
    145 Const WSAECANCELLED =         WSABASEERR+103
    146 Const WSAEINVALIDPROCTABLE =  WSABASEERR+104
    147 Const WSAEINVALIDPROVIDER =   WSABASEERR+105
    148 Const WSAEPROVIDERFAILEDINIT =WSABASEERR+106
    149 Const WSASYSCALLFAILURE =     WSABASEERR+107
    150 Const WSASERVICE_NOT_FOUND =  WSABASEERR+108
    151 Const WSATYPE_NOT_FOUND =     WSABASEERR+109
    152 Const WSA_E_NO_MORE =         WSABASEERR+110
    153 Const WSA_E_CANCELLED =       WSABASEERR+111
    154 Const WSAEREFUSED =           WSABASEERR+112
    155 
    156 
    157 
    158 '---------------
    159 ' WinSock Types
    160 '---------------
    161 
    162 Type HOSTENT
    163     h_name As BytePtr
    164     h_aliases As DWordPtr
     18Const FD_SETSIZE = 64
     19
     20Type fd_set
     21    fd_count As DWord
     22    fd_array[ELM(FD_SETSIZE)] As SOCKET
     23End Type
     24
     25Declare Function __WSAFDIsSet Lib "ws2_32" (fd As SOCKET, ByRef set As fd_set) As Long
     26
     27Sub FD_CLR(fd As SOCKET, ByRef set As fd_set)
     28    Dim i As DWord
     29    With set
     30        For i = 0 To .fd_count
     31            If .fd_array[i] = fd Then
     32                While i < .fd_count - 1
     33                    .fd_array[i] = .fd_array[i + 1]
     34                WEnd
     35                .fd_count--
     36                Exit For
     37            End If
     38        Next
     39    End With
     40End Sub
     41
     42Sub FD_SET(fd As SOCKET, ByRef set As fd_set)
     43    Dim i As DWord
     44    With set
     45        For i = 0 To ELM(.fd_count)
     46            If .fd_array[i] = fd Then
     47                Exit Sub
     48            End If
     49        Next
     50        If i = .fd_count Then
     51            If .fd_count < FD_SET_SIZE Then
     52                .fd_array[i] = fd
     53                .fd_count++
     54            End If
     55        End If
     56    End With
     57End Sub
     58
     59Sub FD_ZERO(ByRef set As fd_set)
     60    set.fd_count = 0
     61End Sub
     62
     63Const FD_ISSET(fd, set) = __WSAFDIsSet(fd, set)
     64
     65Type timeval
     66    tv_sec As  Long
     67    tv_usec As  Long
     68End Type
     69
     70' Operations on timevals.
     71Function timerisset(ByRef tvp As timeval) As BOOL
     72    Return tvp.tv_sec Or tvp.tv_usec
     73End Function
     74
     75/*
     76#define timercmp(tvp, uvp, cmp) \
     77        ((tvp)->tv_sec cmp (uvp)->tv_sec || \
     78         (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
     79*/
     80
     81Sub timerclear(ByRef tvp As timeval)
     82    tvp.tv_sec = 0
     83    tvp.tv_usec = 0
     84End Sub
     85
     86' Commands for ioctlsocket(),  taken from the BSD file fcntl.h.
     87Const IOCPARM_MASK = &h7f
     88Const IOC_VOID = &h20000000
     89Const IOC_OUT = &h40000000
     90Const IOC_IN = &h80000000
     91Const IOC_INOUT= (IOC_IN Or IOC_OUT)
     92
     93Const _IO(x ,y) = (IOC_VOID Or (x << 8) Or y)
     94
     95Const _IOR(x, y, size) = (IOC_OUT Or ((size And IOCPARM_MASK) << 16) Or ((x) << 8) Or (y))
     96
     97Const _IOW(x, y, size) = (IOC_IN Or ((size And IOCPARM_MASK) << 16) Or ((x) << 8) Or (y))
     98
     99Const FIONREAD = _IOR(&h66,127, SizeOf (DWord)) '&h66は'f'
     100Const FIONBIO = _IOW(&h66,126, SizeOf (DWord))
     101Const FIOASYNC = _IOW(&h66,125, SizeOf (DWord))
     102
     103' Socket I/O Controls
     104Const SIOCSHIWAT = _IOW(&h73, 0, SizeOf (DWord)) '&h73は's'
     105Const SIOCGHIWAT = _IOR(&h73, 1, SizeOf (DWord))
     106Const SIOCSLOWAT = _IOW(&h73, 2, SizeOf (DWord))
     107Const SIOCGLOWAT = _IOR(&h73, 3, SizeOf (DWord))
     108Const SIOCATMARK = _IOR(&h73, 7, SizeOf (DWord))
     109
     110
     111Class hostent
     112Public
     113    h_name As *Byte
     114    h_aliases As **Byte
    165115    h_addrtype As Integer
    166     h_length As Integer
    167     h_addr_list As DWordPtr
    168 End Type
    169 
    170 Type SERVENT
    171     s_name As BytePtr
    172     s_aliases As DWordPtr
     116    h_lengt As Integer
     117    h_addr_list As **Byte
     118
     119    Function h_addr() As *Byte
     120        Return h_addr_list[0]
     121    End Function
     122
     123    Sub h_addr(l As *Byte)
     124        h_addr_list[0] = i
     125    End Sub
     126End Class
     127
     128Type netent
     129    FAR * n_name As *Byte
     130    FAR * FAR * n_aliases As **Byte
     131    n_addrtyp As Integer
     132    n_net As DWord
     133End Type
     134
     135Type servent
     136    s_name As *Byte
     137    s_aliases As **Byte
     138#ifdef _WIN64
     139    s_proto As *Byte
    173140    s_port As Integer
    174     s_proto As BytePtr
    175 End Type
    176 
    177 Type SOCKADDR
    178     sa_family As Word
    179     sa_data[13] As Byte
    180 End Type
    181 Type SOCKADDR_IN
    182     sin_family As Word
     141#else
     142    s_port As Integer
     143    s_proto As *Byte
     144#endif
     145End Type
     146
     147Type protoent
     148    p_name As *Byte
     149    p_aliases As **Byte
     150    p_proto As Integer
     151End Type
     152
     153' Protocols
     154Const IPPROTO_IP = 0
     155Const IPPROTO_HOPOPTS = 0
     156Const IPPROTO_ICMP = 1
     157Const IPPROTO_IGMP = 2
     158Const IPPROTO_GGP = 3
     159Const IPPROTO_IPV4 = 4
     160Const IPPROTO_TCP = 6
     161Const IPPROTO_PUP = 12
     162Const IPPROTO_UDP = 17
     163Const IPPROTO_IDP = 22
     164Const IPPROTO_IPV6 = 41
     165Const IPPROTO_ROUTING = 43
     166Const IPPROTO_FRAGMENT = 44
     167Const IPPROTO_ESP = 50
     168Const IPPROTO_AH = 51
     169Const IPPROTO_ICMPV6 = 58
     170Const IPPROTO_NONE = 59
     171Const IPPROTO_DSTOPTS = 60
     172Const IPPROTO_ND = 77
     173Const IPPROTO_ICLFXBM = 78
     174
     175Const IPPROTO_RAW = 255
     176Const IPPROTO_MAX = 256
     177
     178' Port/socket numbers: network standard functions
     179Const IPPORT_ECHO = 7
     180Const IPPORT_DISCARD = 9
     181Const IPPORT_SYSTAT = 11
     182Const IPPORT_DAYTIME = 13
     183Const IPPORT_NETSTAT = 15
     184Const IPPORT_FTP = 21
     185Const IPPORT_TELNET = 23
     186Const IPPORT_SMTP = 25
     187Const IPPORT_TIMESERVER = 37
     188Const IPPORT_NAMESERVER = 42
     189Const IPPORT_WHOIS = 43
     190Const IPPORT_MTP = 57
     191
     192' Port/socket numbers: host specific functions
     193Const IPPORT_TFTP = 69
     194Const IPPORT_RJE = 77
     195Const IPPORT_FINGER = 79
     196Const IPPORT_TTYLINK = 87
     197Const IPPORT_SUPDUP = 95
     198
     199' UNIX TCP sockets
     200Const IPPORT_EXECSERVER = 512
     201Const IPPORT_LOGINSERVER = 513
     202Const IPPORT_CMDSERVER = 514
     203Const IPPORT_EFSSERVER = 520
     204
     205' UNIX UDP sockets
     206Const IPPORT_BIFFUDP = 512
     207Const IPPORT_WHOSERVER = 513
     208Const IPPORT_ROUTESERVER = 520
     209' 520+1 also used
     210
     211' Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root).
     212Const IPPORT_RESERVED = 1024
     213
     214' Link numbers
     215Const IMPLINK_IP = 155
     216Const IMPLINK_LOWEXPER = 156
     217Const IMPLINK_HIGHEXPER = 158
     218
     219#ifndef s_addr
     220#define s_addr
     221' Internet address (old style... should be updated)
     222Class in_addr
     223Public
     224/*
     225    Union S_un
     226        S_un_b As Type
     227            s_b1 As Byte
     228            s_b2 As Byte
     229            s_b3 As Byte
     230            s_b4 As Byte
     231        End Type
     232        S_un_w As Type
     233            s_w1 As Word
     234            s_w2 As Word
     235        End Type
     236        S_addr As DWord
     237    End Union
     238*/
     239    s_addr As DWord
     240
     241    Function s_host() As Byte
     242        Return GetByte(VarPtr(s_addr) + 1)
     243    End Function
     244
     245    Sub s_host(h As Byte)
     246        Return SetByte(VarPtr(s_addr) + 2, h)
     247    End Sub
     248
     249    Function s_net() As Byte
     250        Return GetByte(VarPtr(s_addr) + 0)
     251    End Function
     252
     253    Sub s_net(n As Byte)
     254        Return SetByte(VarPtr(s_addr) + 0, n)
     255    End Sub
     256
     257    Function s_imp() As Word
     258        Return GetWord(VarPtr(s_addr) + 1)
     259    End Function
     260
     261    Sub s_imp(i As Word)
     262        Return SetWord(VarPtr(s_addr) + 1, i)
     263    End Sub
     264
     265    Function s_impno() As Byte
     266        Return GetByte(VarPtr(s_addr) + 3)
     267    End Function
     268
     269    Sub s_impno(i As Byte)
     270        Return SetByte(VarPtr(s_addr) + 3, i)
     271    End Sub
     272
     273    Function s_lh() As Byte
     274        Return GetByte(VarPtr(s_addr) + 2)
     275    End Function
     276
     277    Sub s_lh(l As Byte)
     278        Return SetByte(VarPtr(s_addr) + 2, l)
     279    End Sub
     280End Class
     281#endif
     282
     283Const IN_CLASSA(i) = (((i) As DWord And &h80000000) = 0)
     284Const IN_CLASSA_NET = &hff000000
     285Const IN_CLASSA_NSHIFT = 24
     286Const IN_CLASSA_HOST = &h00ffffff
     287Const IN_CLASSA_MAX = 128
     288
     289Const IN_CLASSB(i) = (((i) As DWord & &hc0000000) = &h80000000)
     290Const IN_CLASSB_NET= &hffff0000
     291Const IN_CLASSB_NSHIFT = 16
     292Const IN_CLASSB_HOST = &h0000ffff
     293Const IN_CLASSB_MAX = 65536
     294
     295Const IN_CLASSC(i) = (((i) As DWord And &he0000000) = &hc0000000)
     296Const IN_CLASSC_NET = &hffffff00
     297Const IN_CLASSC_NSHIFT = 8
     298Const IN_CLASSC_HOST = &h000000ff
     299
     300Const IN_CLASSD(i) = (((i) As DWord And &hf0000000) = &he0000000)
     301Const IN_CLASSD_NET  = &hf0000000
     302Const IN_CLASSD_NSHIFT = 28
     303Const IN_CLASSD_HOST = &h0fffffff
     304Const IN_MULTICAST(i) = IN_CLASSD(i)
     305
     306Const INADDR_ANY = &h00000000 As DWord
     307Const INADDR_LOOPBACK = &h7f000001
     308Const INADDR_BROADCAST = &hffffffff As DWord
     309Const INADDR_NONE = &hffffffff
     310
     311Const ADDR_ANY = INADDR_ANY
     312
     313' Socket address, internet style.
     314Type sockaddr_in
     315    sin_family As Integer
    183316    sin_port As Word
    184     sin_addr As DWord
    185     sin_zero[7] As Byte
    186 End Type
    187 
    188 
    189 '-------------
    190 ' WinSock API
    191 '-------------
    192 
    193 Declare Function closesocket Lib "ws2_32.dll" (s As SOCKET) As Long
    194 Declare Function connect Lib "ws2_32.dll" (s As SOCKET, ByRef name As Any, namelen As Long) As Long
    195 Declare Function gethostbyname Lib "ws2_32.dll" (name As BytePtr) As *HOSTENT
    196 Declare Function getservbyname Lib "ws2_32.dll" (name As BytePtr, proto As BytePtr) As *SERVENT
    197 Declare Function htonl Lib "ws2_32.dll" (hostlong As DWord) As DWord
    198 Declare Function htons Lib "ws2_32.dll" (hostshort As Word) As Word
    199 Declare Function recv Lib "ws2_32.dll" (s As SOCKET, buf As BytePtr, length As Long, flags As Long) As Long
    200 Declare Function send Lib "ws2_32.dll" (s As SOCKET, buf As BytePtr, length As Long, flags As Long) As Long
    201 
    202 Const SD_RECEIVE = 0
    203 Const SD_SEND =    1
    204 Const SD_BOTH =    2
    205 Declare Function shutdown Lib "ws2_32.dll" (s As SOCKET, how As Long) As Long
    206 
    207 Const SOCK_STREAM =    1
    208 Const SOCK_DGRAM =     2
    209 Const SOCK_RAW =       3
    210 Const SOCK_RDM =       4
    211 Const SOCK_SEQPACKET = 5
    212 Declare Function socket Lib "ws2_32.dll" (af As Long, sokettype As Long, protocol As Long) As SOCKET
    213 
    214 Declare Function WSACleanup Lib "ws2_32.dll" () As Integer
     317    sin_addr As in_addr
     318    sin_zero[ELM(8)] As Byte
     319End Type
    215320
    216321Const WSADESCRIPTION_LEN = 256
    217 Const WSASYS_STATUS_LEN  = 128
     322Const WSASYS_STATUS_LEN = 128
     323
    218324Type WSADATA
    219325    wVersion As Word
    220326    wHighVersion As Word
     327#ifdef _WIN64
     328    iMaxSockets As Word
     329    iMaxUdpDg As Word
     330    lpVendorInfo As *Byte
     331    szDescription[WSADESCRIPTION_LEN] As Byte
     332    szSystemStatus[WSASYS_STATUS_LEN] As Byte
     333#else
    221334    szDescription[WSADESCRIPTION_LEN] As Byte
    222335    szSystemStatus[WSASYS_STATUS_LEN] As Byte
    223336    iMaxSockets As Word
    224337    iMaxUdpDg As Word
    225     lpVendorInfo As BytePtr
    226 End Type
    227 Declare Function WSAStartup Lib "ws2_32.dll" (wVersionRequested As Word, ByRef lpWSAData As WSADATA) As Long
    228 
    229 
    230 Declare Function accept Lib "ws2_32.dll" (s As SOCKET, ByRef addr As SOCKADDR_IN, ByVal addrlen As Long) As SOCKET
    231 Declare Function bind Lib "ws2_32.dll" (s As SOCKET, ByRef sName As SOCKADDR_IN, ByVal namelen As Long) As Long
    232 Declare Function ioctlsocket Lib "ws2_32.dll" (s As SOCKET, ByVal cmd As Long, argp As DWord) As Long
    233 Declare Function listen Lib "ws2_32.dll" (s As SOCKET, ByVal backlog As Long) As Long
    234 
    235 Declare Function recvfrom Lib "ws2_32.dll" (s As SOCKET, buf As BytePtr, length As Long, flags As Long, ByRef from As SOCKADDR_IN, fromlen As Long) As Long
    236 Declare Function sendto Lib "ws2_32.dll" (s As SOCKET, buf As BytePtr, length As Long, flags As Long, ByRef sTo As SOCKADDR_IN, tolen As Long) As Long
    237 
    238 Const INADDR_ANY = &h0
    239 
    240 Declare Function htons Lib "ws2_32.dll" (netshort As Word) As Word
    241 Declare Function htonl Lib "ws2_32.dll" (netshort As DWord)  As DWord
    242 Declare Function ntohs Lib "ws2_32.dll" (netshort As Word) As Word
    243 Declare Function ntohl Lib "ws2_32.dll" (netshort As DWord)  As DWord
    244 
    245 #endif '_INC_WINSOCK2
     338    lpVendorInfo As *Byte
     339#endif
     340End Type
     341
     342TypeDef LPWSADATA = *WSADATA
     343
     344' Definitions related to sockets: types, address families, options,  taken from the BSD file sys/socket.h.
     345
     346Const INVALID_SOCKET = (Not 0) As ULONG_PTR
     347Const SOCKET_ERROR = (-1)
     348
     349Const FROM_PROTOCOL_INFO = (-1)
     350
     351' Types
     352Const SOCK_STREAM = 1
     353Const SOCK_DGRAM = 2
     354Const SOCK_RAW = 3
     355Const SOCK_RDM = 4
     356Const SOCK_SEQPACKET = 5
     357
     358' Option flags per-socket.
     359Const SO_DEBUG = &h0001
     360Const SO_ACCEPTCONN = &h0002
     361Const SO_REUSEADDR = &h0004
     362Const SO_KEEPALIVE = &h0008
     363Const SO_DONTROUTE = &h0010
     364Const SO_BROADCAST = &h0020
     365Const SO_USELOOPBACK = &h0040
     366Const SO_LINGER = &h0080
     367Const SO_OOBINLINE = &h0100
     368
     369Const SO_DONTLINGER = ((Not SO_LINGER) As Long)
     370Const SO_EXCLUSIVEADDRUSE = ((Not SO_REUSEADDR) As Long)
     371
     372' Additional options.
     373Const SO_SNDBUF = &h1001
     374Const SO_RCVBUF = &h1002
     375Const SO_SNDLOWAT = &h1003
     376Const SO_RCVLOWAT = &h1004
     377Const SO_SNDTIMEO = &h1005
     378Const SO_RCVTIMEO = &h1006
     379Const SO_ERROR = &h1007
     380Const SO_TYPE = &h1008
     381
     382' WinSock 2 extension -- new options
     383Const SO_GROUP_ID = &h2001
     384Const SO_GROUP_PRIORITY = &h2002
     385Const SO_MAX_MSG_SIZE = &h2003
     386Const SO_PROTOCOL_INFOA = &h2004
     387Const SO_PROTOCOL_INFOW = &h2005
     388#ifdef UNICODE
     389Const SO_PROTOCOL_INFO = SO_PROTOCOL_INFOW
     390#else
     391Const SO_PROTOCOL_INFO = SO_PROTOCOL_INFOA
     392#endif /* UNICODE */
     393Const PVD_CONFIG = &h3001
     394Const SO_CONDITIONAL_ACCEPT = &h3002
     395
     396' TCP options.
     397Const TCP_NODELAY = &h0001
     398
     399' Address families.
     400Const AF_UNSPEC = 0
     401Const AF_UNIX = 1
     402Const AF_INET = 2
     403Const AF_IMPLINK = 3
     404Const AF_PUP = 4
     405Const AF_CHAOS = 5
     406Const AF_NS = 6
     407Const AF_IPX = AF_NS
     408Const AF_ISO = 7
     409Const AF_OSI = AF_ISO
     410Const AF_ECMA = 8
     411Const AF_DATAKIT = 9
     412Const AF_CCITT = 10
     413Const AF_SNA = 11
     414Const AF_DECnet = 12
     415Const AF_DLI = 13
     416Const AF_LAT = 14
     417Const AF_HYLINK = 15
     418Const AF_APPLETALK = 16
     419Const AF_NETBIOS = 17
     420Const AF_VOICEVIEW = 18
     421Const AF_FIREFOX = 19
     422Const AF_UNKNOWN1 = 20
     423Const AF_BAN = 21
     424Const AF_ATM = 22
     425Const AF_INET6 = 23
     426Const AF_CLUSTER = 24
     427Const AF_12844 = 25
     428Const AF_IRDA = 26
     429Const AF_NETDES = 28
     430
     431Const AF_TCNPROCESS = 29
     432Const AF_TCNMESSAGE = 30
     433Const AF_ICLFXBM = 31
     434
     435Const AF_MAX = 32
     436
     437' Structure used by kernel to store most addresses.
     438Type sockaddr
     439    sa_family As Word
     440    sa_data[ELM(14)] As Byte
     441End Type
     442
     443' Portable socket structure (RFC 2553).
     444
     445' Desired design of maximum size and alignment.
     446' These are implementation specific.
     447Const _SS_MAXSIZE = 128 ' Maximum size.
     448Const _SS_ALIGNSIZE = (SizeOf (Int64)) 'Desired alignment.
     449
     450' Definitions used for sockaddr_storage structure paddings design.
     451Const _SS_PAD1SIZE = (_SS_ALIGNSIZE - SizeOf (Integer))
     452Const _SS_PAD2SIZE = (_SS_MAXSIZE - (SizeOf (Integer) + _SS_PAD1SIZE + _SS_ALIGNSIZE))
     453
     454Type sockaddr_storage
     455    ss_family As Integer
     456    __ss_pad1[ELM(_SS_PAD1SIZE)] As Byte
     457    __ss_align As Int64
     458    __ss_pad2[ELM(_SS_PAD2SIZE)] As Byte
     459End Type
     460
     461Type sockproto
     462    sp_family As Word
     463    sp_protocol As Word
     464End Type
     465
     466' Protocol families, same as address families for now.
     467Const PF_UNSPEC = AF_UNSPEC
     468Const PF_UNIX = AF_UNIX
     469Const PF_INET = AF_INET
     470Const PF_IMPLINK = AF_IMPLINK
     471Const PF_PUP = AF_PUP
     472Const PF_CHAOS = AF_CHAOS
     473Const PF_NS = AF_NS
     474Const PF_IPX = AF_IPX
     475Const PF_ISO = AF_ISO
     476Const PF_OSI = AF_OSI
     477Const PF_ECMA = AF_ECMA
     478Const PF_DATAKIT = AF_DATAKIT
     479Const PF_CCITT = AF_CCITT
     480Const PF_SNA = AF_SNA
     481Const PF_DECnet = AF_DECnet
     482Const PF_DLI = AF_DLI
     483Const PF_LAT = AF_LAT
     484Const PF_HYLINK = AF_HYLINK
     485Const PF_APPLETALK = AF_APPLETALK
     486Const PF_VOICEVIEW = AF_VOICEVIEW
     487Const PF_FIREFOX = AF_FIREFOX
     488Const PF_UNKNOWN1 = AF_UNKNOWN1
     489Const PF_BAN = AF_BAN
     490Const PF_ATM = AF_ATM
     491Const PF_INET6 = AF_INET6
     492
     493Const PF_MAX = AF_MAX
     494
     495' Structure used for manipulating linger option.
     496Type linger
     497    l_onoff As Word
     498    l_linger As Word
     499End Type
     500
     501' Level number for (get/set)sockopt() to apply to socket itself.
     502Const SOL_SOCKET = &hffff
     503
     504' Maximum queue length specifiable by listen.
     505Const SOMAXCONN = &h7fffffff
     506
     507Const MSG_OOB = &h1
     508Const MSG_PEEK = &h2
     509Const MSG_DONTROUTE = &h4
     510Const MSG_WAITALL = &h8
     511
     512Const MSG_PARTIAL = &h8000
     513
     514' WinSock 2 extension -- new flags for WSASend(), WSASendTo(), WSARecv() and
     515'                          WSARecvFrom()
     516Const MSG_INTERRUPT = &h10
     517
     518Const MSG_MAXIOVLEN = 16
     519
     520' Define constant based on rfc883, used by gethostbyxxxx() calls.
     521Const MAXGETHOSTSTRUCT = 1024
     522
     523' WinSock 2 extension -- bit values and indices for FD_XXX network events
     524Const FD_READ_BIT = 0
     525Const FD_READ = (1 << FD_READ_BIT)
     526
     527Const FD_WRITE_BIT = 1
     528Const FD_WRITE = (1 << FD_WRITE_BIT)
     529
     530Const FD_OOB_BIT = 2
     531Const FD_OOB = (1 << FD_OOB_BIT)
     532
     533Const FD_ACCEPT_BIT = 3
     534Const FD_ACCEPT = (1 << FD_ACCEPT_BIT)
     535
     536Const FD_CONNECT_BIT = 4
     537Const FD_CONNECT = (1 << FD_CONNECT_BIT)
     538
     539Const FD_CLOSE_BIT = 5
     540Const FD_CLOSE = (1 << FD_CLOSE_BIT)
     541
     542Const FD_QOS_BIT = 6
     543Const FD_QOS = (1 << FD_QOS_BIT)
     544
     545Const FD_GROUP_QOS_BIT = 7
     546Const FD_GROUP_QOS = (1 << FD_GROUP_QOS_BIT)
     547
     548Const FD_ROUTING_INTERFACE_CHANGE_BIT = 8
     549Const FD_ROUTING_INTERFACE_CHANGE = (1 << FD_ROUTING_INTERFACE_CHANGE_BIT)
     550
     551Const FD_ADDRESS_LIST_CHANGE_BIT = 9
     552Const FD_ADDRESS_LIST_CHANGE = (1 << FD_ADDRESS_LIST_CHANGE_BIT)
     553
     554Const FD_MAX_EVENTS = 10
     555Const FD_ALL_EVENTS = ((1 << FD_MAX_EVENTS) - 1)
     556
     557#include <api_winerror.sbp>
     558
     559' Compatibility macros.
     560
     561'Const h_errno = WSAGetLastError()
     562Const HOST_NOT_FOUND = WSAHOST_NOT_FOUND
     563Const TRY_AGAIN = WSATRY_AGAIN
     564Const NO_RECOVERY = WSANO_RECOVERY
     565Const NO_DATA = WSANO_DATA
     566Const WSANO_ADDRESS = WSANO_DATA
     567Const NO_ADDRESS = WSANO_ADDRESS
     568
     569' WinSock 2 extension -- new error codes and type definition
     570
     571'#ifdef _WIN32
     572
     573TypeDef WSAEVENT = HANDLE
     574TypeDef LPWSAEVENT = *HANDLE
     575TypeDef WSAOVERLAPPED = OVERLAPPED
     576TypeDef LPWSAOVERLAPPED = *OVERLAPPED
     577
     578Const WSA_IO_PENDING = (ERROR_IO_PENDING)
     579Const WSA_IO_INCOMPLETE = (ERROR_IO_INCOMPLETE)
     580Const WSA_INVALID_HANDLE = (ERROR_INVALID_HANDLE)
     581Const WSA_INVALID_PARAMETER = (ERROR_INVALID_PARAMETER)
     582Const WSA_NOT_ENOUGH_MEMORY = (ERROR_NOT_ENOUGH_MEMORY)
     583Const WSA_OPERATION_ABORTED = (ERROR_OPERATION_ABORTED)
     584
     585Const WSA_INVALID_EVENT = (0 As WSAEVENT)
     586Const WSA_MAXIMUM_WAIT_EVENTS = (MAXIMUM_WAIT_OBJECTS)
     587Const WSA_WAIT_FAILED = (WAIT_FAILED)
     588Const WSA_WAIT_EVENT_0 = (WAIT_OBJECT_0)
     589Const WSA_WAIT_IO_COMPLETION = (WAIT_IO_COMPLETION)
     590Const WSA_WAIT_TIMEOUT = (WAIT_TIMEOUT)
     591Const WSA_INFINITE = (INFINITE)
     592
     593'#elif defined _WIN16
     594'#endif
     595
     596Type WSABUF
     597    len As DWord
     598    buf As *Byte
     599End Type
     600TypeDef LPWSABUF = *WSABUF
     601
     602#include <qos.ab>
     603
     604Type QOS 'struct _QualityOfService
     605    SendingFlowspec As FLOWSPEC
     606    ReceivingFlowspec As FLOWSPEC
     607    ProviderSpecific As WSABUF
     608End Type
     609TypeDef LPQOS = *QOS
     610
     611' WinSock 2 extension -- manifest constants for return values of the condition function
     612Const CF_ACCEPT = &h0000
     613Const CF_REJECT = &h0001
     614Const CF_DEFER = &h0002
     615
     616' WinSock 2 extension -- manifest constants for shutdown()
     617Const SD_RECEIVE = &h00
     618Const SD_SEND = &h01
     619Const SD_BOTH = &h02
     620
     621' WinSock 2 extension -- data type and manifest constants for socket groups
     622TypeDef GROUP = DWord
     623
     624Const SG_UNCONSTRAINED_GROUP = &h01
     625Const SG_CONSTRAINED_GROUP = &h02
     626
     627' WinSock 2 extension -- data type for WSAEnumNetworkEvents()
     628Type WSANETWORKEVENTS
     629    lNetworkEvents As Long
     630    iErrorCode[ELM(FD_MAX_EVENTS)] As Long
     631End Type
     632TypeDef LPWSANETWORKEVENTS = *WSANETWORKEVENTS
     633
     634' WinSock 2 extension -- WSAPROTOCOL_INFO structure and associated
     635' manifest constants
     636
     637Const MAX_PROTOCOL_CHAIN = 7
     638
     639Const BASE_PROTOCOL = 1
     640Const LAYERED_PROTOCOL = 0
     641
     642Type WSAPROTOCOLCHAIN
     643    ChainLen As Long
     644    ChainEntries[ELM(MAX_PROTOCOL_CHAIN)] As DWord
     645End Type
     646TypeDef LPWSAPROTOCOLCHAIN = *WSAPROTOCOLCHAIN
     647
     648Const WSAPROTOCOL_LEN = 255
     649
     650Type WSAPROTOCOL_INFOA
     651    dwServiceFlags1 As DWord
     652    dwServiceFlags2 As DWord
     653    dwServiceFlags3 As DWord
     654    dwServiceFlags4 As DWord
     655    dwProviderFlags As DWord
     656    ProviderId As GUID
     657    dwCatalogEntryId As DWord
     658    ProtocolChain As WSAPROTOCOLCHAIN
     659    iVersion As Long
     660    iAddressFamily As Long
     661    iMaxSockAddr As Long
     662    iMinSockAddr As Long
     663    iSocketType As Long
     664    iProtocol As Long
     665    iProtocolMaxOffset As Long
     666    iNetworkByteOrder As Long
     667    iSecurityScheme As Long
     668    dwMessageSize As DWord
     669    dwProviderReserved As DWord
     670    szProtocol[WSAPROTOCOL_LEN] As Byte
     671End Type
     672TypeDef LPWSAPROTOCOL_INFOA = *WSAPROTOCOL_INFOA
     673
     674Type WSAPROTOCOL_INFOW
     675    dwServiceFlags1 As DWord
     676    dwServiceFlags2 As DWord
     677    dwServiceFlags3 As DWord
     678    dwServiceFlags4 As DWord
     679    dwProviderFlags As DWord
     680    ProviderId As GUID
     681    dwCatalogEntryId As DWord
     682    ProtocolChain As WSAPROTOCOLCHAIN
     683    iVersion As Long
     684    iAddressFamily As Long
     685    iMaxSockAddr As Long
     686    iMinSockAddr As Long
     687    iSocketType As Long
     688    iProtocol As Long
     689    iProtocolMaxOffset As Long
     690    iNetworkByteOrder As Long
     691    iSecurityScheme As Long
     692    dwMessageSize As DWord
     693    dwProviderReserved As DWord
     694    szProtocol[WSAPROTOCOL_LEN] As WCHAR
     695End Type
     696TypeDef LPWSAPROTOCOL_INFOW = *WSAPROTOCOL_INFOW
     697
     698#ifdef UNICODE
     699TypeDef WSAPROTOCOL_INFO = WSAPROTOCOL_INFOW
     700TypeDef LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOW
     701#else
     702TypeDef WSAPROTOCOL_INFO = WSAPROTOCOL_INFOA
     703TypeDef LPWSAPROTOCOL_INFO = LPWSAPROTOCOL_INFOA
     704#endif
     705
     706' Flag bit definitions for dwProviderFlags
     707Const PFL_MULTIPLE_PROTO_ENTRIES = &h00000001
     708Const PFL_RECOMMENDED_PROTO_ENTRY = &h00000002
     709Const PFL_HIDDEN = &h00000004
     710Const PFL_MATCHES_PROTOCOL_ZERO = &h00000008
     711
     712' Flag bit definitions for dwServiceFlags1
     713Const XP1_CONNECTIONLESS = &h00000001
     714Const XP1_GUARANTEED_DELIVERY = &h00000002
     715Const XP1_GUARANTEED_ORDER = &h00000004
     716Const XP1_MESSAGE_ORIENTED = &h00000008
     717Const XP1_PSEUDO_STREAM = &h00000010
     718Const XP1_GRACEFUL_CLOSE = &h00000020
     719Const XP1_EXPEDITED_DATA = &h00000040
     720Const XP1_CONNECT_DATA = &h00000080
     721Const XP1_DISCONNECT_DATA = &h00000100
     722Const XP1_SUPPORT_BROADCAST = &h00000200
     723Const XP1_SUPPORT_MULTIPOINT = &h00000400
     724Const XP1_MULTIPOINT_CONTROL_PLANE = &h00000800
     725Const XP1_MULTIPOINT_DATA_PLANE = &h00001000
     726Const XP1_QOS_SUPPORTED = &h00002000
     727Const XP1_INTERRUPT = &h00004000
     728Const XP1_UNI_SEND = &h00008000
     729Const XP1_UNI_RECV = &h00010000
     730Const XP1_IFS_HANDLES = &h00020000
     731Const XP1_PARTIAL_MESSAGE = &h00040000
     732
     733Const BIGENDIAN = &h0000
     734Const LITTLEENDIAN = &h0001
     735
     736Const SECURITY_PROTOCOL_NONE = &h0000
     737
     738' WinSock 2 extension -- manifest constants for WSAJoinLeaf()
     739Const JL_SENDER_ONLY = &h01
     740Const JL_RECEIVER_ONLY = &h02
     741Const JL_BOTH = &h04
     742
     743' WinSock 2 extension -- manifest constants for WSASocket()
     744Const WSA_FLAG_OVERLAPPED = &h01
     745Const WSA_FLAG_MULTIPOINT_C_ROOT = &h02
     746Const WSA_FLAG_MULTIPOINT_C_LEAF = &h04
     747Const WSA_FLAG_MULTIPOINT_D_ROOT = &h08
     748Const WSA_FLAG_MULTIPOINT_D_LEAF = &h10
     749
     750' WinSock 2 extension -- manifest constants for WSAIoctl()
     751Const IOC_UNIX = &h00000000
     752Const IOC_WS2 = &h08000000
     753Const IOC_PROTOCOL = &h10000000
     754Const IOC_VENDOR = &h18000000
     755
     756Const _WSAIO(x, y) = (IOC_VOID Or (x) Or (y))
     757Const _WSAIOR(x, y) = (IOC_OUT Or (x) Or (y))
     758Const _WSAIOW(x, y) = (IOC_IN Or (x) Or (y))
     759Const _WSAIORW(x, y) = (IOC_INOUT Or (x) Or (y))
     760
     761Const SIO_ASSOCIATE_HANDLE = _WSAIOW(IOC_WS2, 1)
     762Const SIO_ENABLE_CIRCULAR_QUEUEING = _WSAIO(IOC_WS2, 2)
     763Const SIO_FIND_ROUTE = _WSAIOR(IOC_WS2, 3)
     764Const SIO_FLUSH = _WSAIO(IOC_WS2, 4)
     765Const SIO_GET_BROADCAST_ADDRESS = _WSAIOR(IOC_WS2, 5)
     766Const SIO_GET_EXTENSION_FUNCTION_POINTER = _WSAIORW(IOC_WS2, 6)
     767Const SIO_GET_QOS = _WSAIORW(IOC_WS2, 7)
     768Const SIO_GET_GROUP_QOS = _WSAIORW(IOC_WS2, 8)
     769Const SIO_MULTIPOINT_LOOPBACK = _WSAIOW(IOC_WS2, 9)
     770Const SIO_MULTICAST_SCOPE = _WSAIOW(IOC_WS2, 10)
     771Const SIO_SET_QOS = _WSAIOW(IOC_WS2, 11)
     772Const SIO_SET_GROUP_QOS = _WSAIOW(IOC_WS2, 12)
     773Const SIO_TRANSLATE_HANDLE = _WSAIORW(IOC_WS2, 13)
     774Const SIO_ROUTING_INTERFACE_QUERY = _WSAIORW(IOC_WS2, 20)
     775Const SIO_ROUTING_INTERFACE_CHANGE = _WSAIOW(IOC_WS2, 21)
     776Const SIO_ADDRESS_LIST_QUERY = _WSAIOR(IOC_WS2, 22)
     777Const SIO_ADDRESS_LIST_CHANGE = _WSAIO(IOC_WS2, 23)
     778Const SIO_QUERY_TARGET_PNP_HANDLE = _WSAIOR(IOC_WS2, 24)
     779Const SIO_ADDRESS_LIST_SORT = _WSAIORW(IOC_WS2, 25)
     780
     781' WinSock 2 extensions -- data types for the condition function in
     782' WSAAccept() and overlapped I/O completion routine.
     783
     784TypeDef LPCONDITIONPROC = *Function(
     785    ByRef CallerId As WSABUF,
     786    ByRef CallerData As WSABUF,
     787    ByRef lpSQOS As QOS,
     788    ByRef lpGQOS As QOS,
     789    ByRef lpCalleeId As WSABUF,
     790    ByRef lpCalleeData As WSABUF,
     791    ByRef g As GROUP,
     792    dwCallbackData As ULONG_PTR
     793) As Long
     794
     795TypeDef LPWSAOVERLAPPED_COMPLETION_ROUTINE = *Sub(
     796    dwError As DWord,
     797    cbTransferred As DWord,
     798    ByRef Overlapped As WSAOVERLAPPED,
     799    dwFlags As DWord)
     800
     801' WinSock 2 extension -- manifest constants and associated structures
     802' for WSANSPIoctl()
     803Const SIO_NSP_NOTIFY_CHANGE = _WSAIOW(IOC_WS2, 25)
     804
     805Const Enum WSACOMPLETIONTYPE
     806    NSP_NOTIFY_IMMEDIATELY = 0
     807    NSP_NOTIFY_HWND
     808    NSP_NOTIFY_EVENT
     809    NSP_NOTIFY_PORT
     810    NSP_NOTIFY_APC
     811End Enum
     812
     813TypeDef PWSACOMPLETIONTYPE = *WSACOMPLETIONTYPE
     814TypeDef LPWSACOMPLETIONTYPE = *WSACOMPLETIONTYPE
     815
     816Type _System_WinSock_WSACOMPLETION_WINDOWMESSAGE
     817    hWnd As HWND
     818    uMsg As DWord
     819    context As WPARAM
     820End Type
     821
     822Type _System_WinSock_WSACOMPLETION_EVENT
     823    lpOverlapped As LPWSAOVERLAPPED
     824End Type
     825
     826Type _System_WinSock_WSACOMPLETION_APC
     827    lpOverlapped As LPWSAOVERLAPPED
     828    lpfnCompletionProc As LPWSAOVERLAPPED_COMPLETION_ROUTINE
     829End Type
     830
     831Type _System_WinSock_WSACOMPLETION_PORT
     832    lpOverlapped As LPWSAOVERLAPPED
     833    hPort As HANDLE
     834    Key As ULONG_PTR
     835End Type
     836
     837Class WSACOMPLETION
     838Public
     839    Type_ As WSACOMPLETIONTYPE
     840/*
     841    Parameters As Union
     842        WindowMessage As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE
     843        Event As _System_WinSock_WSACOMPLETION_EVENT
     844        Apc As _System_WinSock_WSACOMPLETION_APC
     845        Port As _System_WinSock_WSACOMPLETION_PORT
     846    End Union
     847*/
     848    Port As _System_WinSock_WSACOMPLETION_PORT
     849
     850    Function WindowMessage() As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE
     851        Dim p As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE
     852        p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE
     853        Return p[0]
     854    End Function
     855
     856    Sub WindowMessage(w As _System_WinSock_WSACOMPLETION_WINDOWMESSAGE)
     857        Dim p As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE
     858        p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_WINDOWMESSAGE
     859        p[0] = w
     860    End Sub
     861
     862    Function Event() As _System_WinSock_WSACOMPLETION_EVENT
     863        Dim p As *_System_WinSock_WSACOMPLETION_EVENT
     864        p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_EVENT
     865        Return p[0]
     866    End Function
     867
     868    Sub Event(e As _System_WinSock_WSACOMPLETION_EVENT)
     869        Dim p As *_System_WinSock_WSACOMPLETION_EVENT
     870        p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_EVENT
     871        p[0] = e
     872    End Sub
     873
     874    Function Apc() As _System_WinSock_WSACOMPLETION_APC
     875        Dim p As *_System_WinSock_WSACOMPLETION_APC
     876        p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_APC
     877        Return p[0]
     878    End Function
     879
     880    Sub Apc(a As _System_WinSock_WSACOMPLETION_APC)
     881        Dim p As *_System_WinSock_WSACOMPLETION_APC
     882        p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_APC
     883        p[0] = a
     884    End Sub
     885/*
     886    Function Port() As _System_WinSock_WSACOMPLETION_PORT
     887        Dim p As *_System_WinSock_WSACOMPLETION_PORT
     888        p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_PORT
     889        Return p[0]
     890    End Function
     891
     892    Sub Port(p As _System_WinSock_WSACOMPLETION_PORT)
     893        Dim p As *_System_WinSock_WSACOMPLETION_PORT
     894        p = VarPtr(Port) As *_System_WinSock_WSACOMPLETION_PORT
     895        p[0] = p
     896    End Sub
     897*/
     898End Class
     899
     900TypeDef PWSACOMPLETION = *WSACOMPLETION
     901TypeDef LPWSACOMPLETION = *WSACOMPLETION
     902
     903' WinSock 2 extension -- manifest constants for SIO_TRANSLATE_HANDLE ioctl
     904Const TH_NETDEV = &h00000001
     905Const TH_TAPI = &h00000002
     906
     907TypeDef SOCKADDR = sockaddr
     908TypeDef PSOCKADDR = *sockaddr
     909TypeDef LPSOCKADDR = *sockaddr
     910
     911TypeDef SOCKADDR_STORAGE = sockaddr_storage
     912TypeDef PSOCKADDR_STORAGE = *sockaddr_storage
     913TypeDef LPSOCKADDR_STORAGE = *sockaddr_storage
     914
     915' Manifest constants and type definitions related to name resolution and
     916' registration (RNR) API
     917
     918#ifndef _tagBLOB_DEFINED
     919#define _tagBLOB_DEFINED
     920#define _BLOB_DEFINED
     921#define _LPBLOB_DEFINED
     922Type BLOB
     923    cbSize As DWord
     924#ifdef MIDL_PASS
     925    [size_is(cbSize)] pBlobData As *Byte
     926#else
     927    pBlobData As *Byte
     928#endif
     929End Type
     930TypeDef LPBLOB = *BLOB
     931#endif
     932
     933' Service Install Flags
     934Const SERVICE_MULTIPLE = (&h00000001)
     935
     936' Name Spaces
     937
     938Const NS_ALL = (0)
     939
     940Const NS_SAP = (1)
     941Const NS_NDS = (2)
     942Const NS_PEER_BROWSE = (3)
     943Const NS_SLP = (5)
     944Const NS_DHCP = (6)
     945
     946Const NS_TCPIP_LOCAL = (10)
     947Const NS_TCPIP_HOSTS = (11)
     948Const NS_DNS = (12)
     949Const NS_NETBT = (13)
     950Const NS_WINS = (14)
     951Const NS_NLA = (15)
     952
     953Const NS_NBP = (20)
     954
     955Const NS_MS = (30)
     956Const NS_STDA = (31)
     957Const NS_NTDS = (32)
     958
     959Const NS_X500 = (40)
     960Const NS_NIS = (41)
     961Const NS_NISPLUS = (42)
     962
     963Const NS_WRQ = (50)
     964
     965Const NS_NETDES = (60)
     966
     967' Resolution flags for WSAGetAddressByName().
     968Const RES_UNUSED_1 = (&h00000001)
     969Const RES_FLUSH_CACHE = (&h00000002)
     970#ifndef RES_SERVICE
     971#define RES_SERVICE
     972Const RES_SERVICE = (&h00000004)
     973#endif /* RES_SERVICE */
     974
     975' Well known value names for Service Types
     976
     977Const SERVICE_TYPE_VALUE_IPXPORTA = "IpxSocket"
     978'Const SERVICE_TYPE_VALUE_IPXPORTW = L"IpxSocket"
     979Const SERVICE_TYPE_VALUE_SAPIDA = "SapId"
     980'Const SERVICE_TYPE_VALUE_SAPIDW = L"SapId"
     981
     982Const SERVICE_TYPE_VALUE_TCPPORTA = "TcpPort"
     983'Const SERVICE_TYPE_VALUE_TCPPORTW = L"TcpPort"
     984
     985Const SERVICE_TYPE_VALUE_UDPPORTA = "UdpPort"
     986'Const SERVICE_TYPE_VALUE_UDPPORTW = L"UdpPort"
     987
     988Const SERVICE_TYPE_VALUE_OBJECTIDA = "ObjectId"
     989'Const SERVICE_TYPE_VALUE_OBJECTIDW = L"ObjectId"
     990
     991#ifdef UNICODE
     992/*
     993Const SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDW
     994Const SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTW
     995Const SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTW
     996Const SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDW
     997*/
     998#else
     999
     1000Const SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDA
     1001Const SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTA
     1002Const SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTA
     1003Const SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDA
     1004
     1005#endif
     1006
     1007#ifndef __CSADDR_DEFINED__
     1008#define __CSADDR_DEFINED__
     1009
     1010' SockAddr Information
     1011Type SOCKET_ADDRESS
     1012    lpSockaddr As LPSOCKADDR
     1013    iSockaddrLength As Long
     1014End Type
     1015TypeDef PSOCKET_ADDRESS = *SOCKET_ADDRESS
     1016TypeDef LPSOCKET_ADDRESS = *SOCKET_ADDRESS
     1017
     1018' CSAddr Information
     1019Type CSADDR_INFO
     1020    LocalAddr As SOCKET_ADDRESS
     1021    RemoteAddr As SOCKET_ADDRESS
     1022    iSocketType As Long
     1023    iProtocol As Long
     1024End Type
     1025TypeDef PCSADDR_INFO = *CSADDR_INFO
     1026TypeDef LPCSADDR_INFO = *CSADDR_INFO
     1027#endif
     1028
     1029' Address list returned via SIO_ADDRESS_LIST_QUERY
     1030Type SOCKET_ADDRESS_LIST
     1031    iAddressCount As Long
     1032    Address[ELM(1)] As SOCKET_ADDRESS
     1033End Type
     1034TypeDef LPSOCKET_ADDRESS_LIST = *SOCKET_ADDRESS_LIST
     1035
     1036' Address Family/Protocol Tuples
     1037Type AFPROTOCOLS
     1038    iAddressFamily As Long
     1039    iProtocol As Long
     1040End Type
     1041TypeDef PAFPROTOCOLS = *AFPROTOCOLS
     1042TypeDef LPAFPROTOCOLS = *AFPROTOCOLS
     1043
     1044' Client Query API Typedefs
     1045
     1046' The comparators
     1047Const Enum WSAECOMPARATOR
     1048    COMP_EQUAL = 0
     1049    COMP_NOTLESS
     1050End Enum
     1051TypeDef PWSAECOMPARATOR = *WSAECOMPARATOR
     1052TypeDef LPWSAECOMPARATOR = *WSAECOMPARATOR
     1053
     1054Type WSAVERSION
     1055    dwVersion As DWord
     1056    ecHow As WSAECOMPARATOR
     1057End Type
     1058TypeDef PWSAVERSION = *WSAVERSION
     1059TypeDef LPWSAVERSION = *WSAVERSION
     1060
     1061Type WSAQUERYSETA
     1062    dwSize As DWord
     1063    lpszServiceInstanceName As LPSTR
     1064    lpServiceClassId As *GUID
     1065    lpVersion As LPWSAVERSION
     1066    lpszComment As LPSTR
     1067    dwNameSpace As DWord
     1068    lpNSProviderId As *GUID
     1069    lpszContext As LPSTR
     1070    dwNumberOfProtocols As DWord
     1071    lpafpProtocols As LPAFPROTOCOLS
     1072    lpszQueryString As LPSTR
     1073    dwNumberOfCsAddrs As DWord
     1074    lpcsaBuffer As LPCSADDR_INFO
     1075    dwOutputFlags As DWord
     1076    lpBlob As LPBLOB
     1077End Type
     1078TypeDef PWSAQUERYSETA = *WSAQUERYSETA
     1079TypeDef LPWSAQUERYSETA = *WSAQUERYSETA
     1080
     1081Type WSAQUERYSETW
     1082    dwSize As DWord
     1083    lpszServiceInstanceName As LPWSTR
     1084    lpServiceClassId As *GUID
     1085    lpVersion As LPWSAVERSION
     1086    lpszComment As LPWSTR
     1087    dwNameSpace As DWord
     1088    lpNSProviderId As *GUID
     1089    lpszContext As LPWSTR
     1090    dwNumberOfProtocols As DWord
     1091    lpafpProtocols As LPAFPROTOCOLS
     1092    lpszQueryString As LPWSTR
     1093    dwNumberOfCsAddrs As DWord
     1094    lpcsaBuffer As LPCSADDR_INFO
     1095    dwOutputFlags As DWord
     1096    lpBlob As LPBLOB
     1097End Type
     1098TypeDef PWSAQUERYSETW = *WSAQUERYSETW
     1099TypeDef LPWSAQUERYSETW = *WSAQUERYSETW
     1100
     1101#ifdef UNICODE
     1102TypeDef WSAQUERYSET = WSAQUERYSETW
     1103TypeDef PWSAQUERYSET = PWSAQUERYSETW
     1104TypeDef LPWSAQUERYSET = LPWSAQUERYSETW
     1105#else
     1106TypeDef WSAQUERYSET = WSAQUERYSETA
     1107TypeDef PWSAQUERYSET = PWSAQUERYSETA
     1108TypeDef LPWSAQUERYSET = LPWSAQUERYSETA
     1109#endif
     1110
     1111Const LUP_DEEP = &h0001
     1112Const LUP_CONTAINERS = &h0002
     1113Const LUP_NOCONTAINERS = &h0004
     1114Const LUP_NEAREST = &h0008
     1115Const LUP_RETURN_NAME = &h0010
     1116Const LUP_RETURN_TYPE = &h0020
     1117Const LUP_RETURN_VERSION = &h0040
     1118Const LUP_RETURN_COMMENT = &h0080
     1119Const LUP_RETURN_ADDR = &h0100
     1120Const LUP_RETURN_BLOB = &h0200
     1121Const LUP_RETURN_ALIASES = &h0400
     1122Const LUP_RETURN_QUERY_STRING = &h0800
     1123Const LUP_RETURN_ALL = &h0FF0
     1124Const LUP_RES_SERVICE = &h8000
     1125
     1126Const LUP_FLUSHCACHE = &h1000
     1127Const LUP_FLUSHPREVIOUS = &h2000
     1128
     1129' Return flags
     1130Const RESULT_IS_ALIAS = &h0001
     1131Const RESULT_IS_ADDED = &h0010
     1132Const RESULT_IS_CHANGED = &h0020
     1133Const RESULT_IS_DELETED = &h0040
     1134
     1135' Service Address Registration and Deregistration Data Types.
     1136
     1137Const Enum WSAESETSERVICEOP
     1138    RNRSERVICE_REGISTER = 0
     1139    RNRSERVICE_DEREGISTER
     1140    RNRSERVICE_DELETE
     1141End Enum
     1142TypeDef PWSAESETSERVICEOP = *WSAESETSERVICEOP
     1143TypeDef LPWSAESETSERVICEOP = *WSAESETSERVICEOP
     1144
     1145' Service Installation/Removal Data Types.
     1146
     1147Type WSANSCLASSINFOA
     1148    lpszName As LPSTR
     1149    dwNameSpace As DWord
     1150    dwValueType As DWord
     1151    dwValueSize As DWord
     1152    lpValue As VoidPtr
     1153End Type
     1154TypeDef PWSANSCLASSINFOA = *WSANSCLASSINFOA
     1155TypeDef LPWSANSCLASSINFOA = *WSANSCLASSINFOA
     1156
     1157Type WSANSCLASSINFOW
     1158    lpszName As LPWSTR
     1159    dwNameSpace As DWord
     1160    dwValueType As DWord
     1161    dwValueSize As DWord
     1162    lpValue As VoidPtr
     1163End Type
     1164TypeDef PWSANSCLASSINFOW = *WSANSCLASSINFOW
     1165TypeDef LPWSANSCLASSINFOW = *WSANSCLASSINFOW
     1166
     1167#ifdef UNICODE
     1168TypeDef WSANSCLASSINFO = WSANSCLASSINFOW
     1169TypeDef PWSANSCLASSINFO = PWSANSCLASSINFOW
     1170TypeDef LPWSANSCLASSINFO = LPWSANSCLASSINFOW
     1171#else
     1172TypeDef WSANSCLASSINFO = WSANSCLASSINFOA
     1173TypeDef PWSANSCLASSINFO = PWSANSCLASSINFOA
     1174TypeDef LPWSANSCLASSINFO = LPWSANSCLASSINFOA
     1175#endif
     1176
     1177Type WSASERVICECLASSINFOA
     1178    lpServiceClassId As *GUID
     1179    lpszServiceClassName As LPSTR
     1180    dwCount As DWord
     1181    lpClassInfos As LPWSANSCLASSINFOA
     1182End Type
     1183TypeDef PWSASERVICECLASSINFOA = *WSASERVICECLASSINFOA
     1184TypeDef LPWSASERVICECLASSINFOA = *WSASERVICECLASSINFOA
     1185
     1186Type WSASERVICECLASSINFOW
     1187    lpServiceClassId As *GUID
     1188    lpszServiceClassName As LPWSTR
     1189    dwCount As DWord
     1190    lpClassInfos As LPWSANSCLASSINFOA
     1191End Type
     1192TypeDef PWSASERVICECLASSINFOW = *WSASERVICECLASSINFOW
     1193TypeDef LPWSASERVICECLASSINFOW = *WSASERVICECLASSINFOW
     1194
     1195#ifdef UNICODE
     1196TypeDef WSASERVICECLASSINFO = WSASERVICECLASSINFOW
     1197TypeDef PWSASERVICECLASSINFO = PWSASERVICECLASSINFOW
     1198TypeDef LPWSASERVICECLASSINFO = LPWSASERVICECLASSINFOW
     1199#else
     1200TypeDef WSASERVICECLASSINFO = WSASERVICECLASSINFOA
     1201TypeDef PWSASERVICECLASSINFO = PWSASERVICECLASSINFOA
     1202TypeDef LPWSASERVICECLASSINFO = LPWSASERVICECLASSINFOA
     1203#endif
     1204
     1205Type WSANAMESPACE_INFOA
     1206    NSProviderId As GUID
     1207    dwNameSpace As DWord
     1208    fActive As BOOL
     1209    dwVersion As DWord
     1210    lpszIdentifier As LPSTR
     1211End Type
     1212TypeDef PWSANAMESPACE_INFOA = *WSANAMESPACE_INFOA
     1213TypeDef LPWSANAMESPACE_INFOA = *WSANAMESPACE_INFOA
     1214
     1215Type WSANAMESPACE_INFOW
     1216    NSProviderId As GUID
     1217    dwNameSpace As DWord
     1218    fActive As BOOL
     1219    dwVersion As DWord
     1220    lpszIdentifier As LPWSTR
     1221End Type
     1222TypeDef PWSANAMESPACE_INFOW = *WSANAMESPACE_INFOW
     1223TypeDef LPWSANAMESPACE_INFOW = *WSANAMESPACE_INFOW
     1224
     1225#ifdef UNICODE
     1226TypeDef WSANAMESPACE_INFO = WSANAMESPACE_INFOW
     1227TypeDef PWSANAMESPACE_INFO = PWSANAMESPACE_INFOW
     1228TypeDef LPWSANAMESPACE_INFO = LPWSANAMESPACE_INFOW
     1229#else
     1230TypeDef WSANAMESPACE_INFO = WSANAMESPACE_INFOA
     1231TypeDef PWSANAMESPACE_INFO = PWSANAMESPACE_INFOA
     1232TypeDef LPWSANAMESPACE_INFO = LPWSANAMESPACE_INFOA
     1233#endif
     1234
     1235' Socket function prototypes
     1236
     1237#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1238Declare Function accept Lib "ws2_32" (s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long) As SOCKET
     1239#endif
     1240
     1241#ifdef INCL_WINSOCK_API_TYPEDEFS
     1242TypeDef LPFN_ACCEPT = *Function(s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long) As SOCKET
     1243#endif
     1244
     1245#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1246Declare Function bind Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, addrlen As Long) As Long
     1247#endif
     1248
     1249#ifdef INCL_WINSOCK_API_TYPEDEFS
     1250TypeDef LPFN_BIND = *Function(s As SOCKET, ByRef name As sockaddr, addrlen As Long) As Long
     1251#endif
     1252
     1253#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1254Declare Function closesocket Lib "ws2_32" (s As SOCKET) As Long
     1255#endif
     1256
     1257#ifdef INCL_WINSOCK_API_TYPEDEFS
     1258TypeDef LPFN_CLOSESOCKET = *Function(s As SOCKET) As Long
     1259#endif
     1260
     1261#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1262Declare Function connect Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long) As Long
     1263#endif
     1264
     1265#ifdef INCL_WINSOCK_API_TYPEDEFS
     1266TypeDef LPFN_CONNECT = *Function(s As SOCKET, ByRef name As sockaddr, namelen As Long) As Long
     1267#endif
     1268
     1269#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1270Declare Function ioctlsocket Lib "ws2_32" (s As SOCKET, cmd As Long, ByRef argp As DWord) As Long
     1271#endif
     1272
     1273#ifdef INCL_WINSOCK_API_TYPEDEFS
     1274TypeDef LPFN_IOCTLSOCKET = *Function(s As SOCKET, cmd As Long, ByRef argp As DWord) As Long
     1275#endif
     1276
     1277#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1278Declare Function getpeername Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long
     1279#endif
     1280
     1281#ifdef INCL_WINSOCK_API_TYPEDEFS
     1282TypeDef LPFN_GETPEERNAME = *Function(s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long
     1283#endif
     1284
     1285#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1286Declare Function getsockname Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long
     1287#endif
     1288
     1289#ifdef INCL_WINSOCK_API_TYPEDEFS
     1290TypeDef LPFN_GETSOCKNAME = *Function(s As SOCKET, ByRef name As sockaddr, ByRef namelen As Long) As Long
     1291#endif
     1292
     1293#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1294Declare Function getsockopt Lib "ws2_32" (s As SOCKET, level As Long, optname As Long, optval As *Byte, ByRef optlen As Long) As Long
     1295#endif
     1296
     1297#ifdef INCL_WINSOCK_API_TYPEDEFS
     1298TypeDef LPFN_GETSOCKOPT = *Function(s As SOCKET, level As Long, optname As Long, optval As *Byte, ByRef optlen As Long) As Long
     1299#endif
     1300
     1301#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1302Declare Function htonl Lib "ws2_32" (hostlong As DWord) As DWord
     1303#endif
     1304
     1305#ifdef INCL_WINSOCK_API_TYPEDEFS
     1306TypeDef LPFN_HTONL = *Function(hostlong As DWord) As DWord
     1307#endif
     1308
     1309#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1310Declare Function htons Lib "ws2_32" (hostshort As Word) As Word
     1311#endif
     1312
     1313#ifdef INCL_WINSOCK_API_TYPEDEFS
     1314TypeDef LPFN_HTONS = *Function(hostshort As Word) As Word
     1315#endif
     1316
     1317#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1318Declare Function inet_addr Lib "ws2_32" (cp As *Byte) As DWord
     1319#endif
     1320
     1321#ifdef INCL_WINSOCK_API_TYPEDEFS
     1322TypeDef LPFN_INET_ADDR = *Function(cp As *Byte) As DWord
     1323#endif
     1324
     1325#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1326Declare Function inet_ntoa Lib "ws2_32" (in As in_addr) As *Byte
     1327#endif
     1328
     1329#ifdef INCL_WINSOCK_API_TYPEDEFS
     1330TypeDef LPFN_INET_NTOA = *Function(in As in_addr) As *Byte
     1331#endif
     1332
     1333#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1334Declare Function listen Lib "ws2_32" (s As SOCKET, backlog As Long) As Long
     1335#endif
     1336
     1337#ifdef INCL_WINSOCK_API_TYPEDEFS
     1338TypeDef LPFN_LISTEN = *Function(s As SOCKET, backlog As Long) As Long
     1339#endif
     1340
     1341#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1342Declare Function ntohl Lib "ws2_32" (netlong As DWord) As DWord
     1343#endif
     1344
     1345#ifdef INCL_WINSOCK_API_TYPEDEFS
     1346TypeDef LPFN_NTOHL = *Function(netlong As DWord) As DWord
     1347#endif
     1348
     1349#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1350Declare Function ntohs Lib "ws2_32" (netshort As Word) As Word
     1351#endif
     1352
     1353#ifdef INCL_WINSOCK_API_TYPEDEFS
     1354TypeDef LPFN_NTOHS = *Function(netshort As Word) As Word
     1355#endif
     1356
     1357#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1358Declare Function recv Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long
     1359#endif
     1360
     1361#ifdef INCL_WINSOCK_API_TYPEDEFS
     1362TypeDef LPFN_RECV = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long
     1363#endif
     1364
     1365#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1366Declare Function recvfrom Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef from As sockaddr, ByRef fromlen As Long) As Long
     1367#endif
     1368
     1369#ifdef INCL_WINSOCK_API_TYPEDEFS
     1370TypeDef LPFN_RECVFROM = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef from As sockaddr, ByRef fromlen As Long) As Long
     1371#endif
     1372
     1373#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1374Declare Function select Lib "ws2_32" (nfds As Long, ByRef readfds As fd_set, ByRef writefds As fd_set, ByRef exceptfds As fd_set, ByRef timeout As timeval) As Long
     1375#endif
     1376
     1377#ifdef INCL_WINSOCK_API_TYPEDEFS
     1378TypeDef LPFN_SELECT = *Function(nfds As Long, ByRef readfds As fd_set, ByRef writefds As fd_set, ByRef exceptfds As fd_set, ByRef timeout As timeval) As Long
     1379#endif
     1380
     1381#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1382Declare Function send Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long
     1383#endif
     1384
     1385#ifdef INCL_WINSOCK_API_TYPEDEFS
     1386TypeDef LPFN_SEND = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long) As Long
     1387#endif
     1388
     1389#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1390Declare Function sendto Lib "ws2_32" (s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef to_ As sockaddr, tolen As Long) As Long
     1391#endif
     1392
     1393#ifdef INCL_WINSOCK_API_TYPEDEFS
     1394TypeDef LPFN_SENDTO = *Function(s As SOCKET, buf As *Byte, len As Long, flags As Long, ByRef to_ As sockaddr, tolen As Long) As Long
     1395#endif
     1396
     1397#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1398Declare Function setsockopt Lib "ws2_32" (s As SOCKET, level As Long, optname As Long, optval As *Byte, optlen As Long) As Long
     1399#endif
     1400
     1401#ifdef INCL_WINSOCK_API_TYPEDEFS
     1402TypeDef LPFN_SETSOCKOPT = *Function(s As SOCKET, level As Long, optname As Long, optval As *Byte, optlen As Long) As Long
     1403#endif
     1404
     1405#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1406Declare Function shutdown Lib "ws2_32" (s As SOCKET, how As Long) As Long
     1407#endif
     1408
     1409#ifdef INCL_WINSOCK_API_TYPEDEFS
     1410TypeDef LPFN_SHUTDOWN = *Function(s As SOCKET, how As Long) As Long
     1411#endif
     1412
     1413#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1414Declare Function socket Lib "ws2_32" (af As Long, type_ As Long, protocol As Long) As SOCKET
     1415#endif
     1416
     1417#ifdef INCL_WINSOCK_API_TYPEDEFS
     1418TypeDef LPFN_SOCKET = *Function(af As Long, type_ As Long, protocol As Long) As SOCKET
     1419#endif
     1420
     1421' Database function prototypes
     1422
     1423#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1424Declare Function gethostbyaddr Lib "ws2_32" (addr As PCSTR, len As Long, type_ As Long) As *hostent
     1425#endif
     1426
     1427#ifdef INCL_WINSOCK_API_TYPEDEFS
     1428TypeDef LPFN_GETHOSTBYADDR = *Function(addr As PCSTR, len As Long, type_ As Long) As *hostent
     1429#endif
     1430
     1431#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1432Declare Function gethostbyname Lib "ws2_32" (name As PCSTR) As *hostent
     1433#endif
     1434
     1435#ifdef INCL_WINSOCK_API_TYPEDEFS
     1436TypeDef LPFN_GETHOSTBYNAME = *Function(name As PCSTR) As *hostent
     1437#endif
     1438
     1439#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1440Declare Function gethostname Lib "ws2_32" (name As PCSTR, namelen As Long) As Long
     1441#endif
     1442
     1443#ifdef INCL_WINSOCK_API_TYPEDEFS
     1444TypeDef LPFN_GETHOSTNAME = *Function(name As PCSTR, namelen As Long) As Long
     1445#endif
     1446
     1447#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1448Declare Function getservbyport Lib "ws2_32" (port As Long, proto As PCSTR) As *servent
     1449#endif
     1450
     1451#ifdef INCL_WINSOCK_API_TYPEDEFS
     1452TypeDef LPFN_GETSERVBYPORT = *Function(port As Long, proto As PCSTR) As *servent
     1453#endif
     1454
     1455#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1456Declare Function getservbyname Lib "ws2_32" (name As PCSTR, proto As PCSTR) As *servent
     1457#endif
     1458
     1459#ifdef INCL_WINSOCK_API_TYPEDEFS
     1460TypeDef LPFN_GETSERVBYNAME = *Function(name As PCSTR, proto As PCSTR) As *servent
     1461#endif
     1462
     1463#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1464Declare Function getprotobynumber Lib "ws2_32" (number As Long) As *protoent
     1465#endif
     1466
     1467#ifdef INCL_WINSOCK_API_TYPEDEFS
     1468TypeDef LPFN_GETPROTOBYNUMBER = *Function(number As Long) As *protoent
     1469#endif
     1470
     1471#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1472Declare Function getprotobyname Lib "ws2_32" (name As PCSTR) As *protoent
     1473#endif
     1474
     1475#ifdef INCL_WINSOCK_API_TYPEDEFS
     1476TypeDef LPFN_GETPROTOBYNAME = (name As PCSTR) As *protoent
     1477#endif
     1478
     1479' Microsoft Windows Extension function prototypes
     1480
     1481#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1482Declare Function WSAStartup Lib "ws2_32" (wVersionRequested As Word, ByRef WSAData As WSADATA) As Long
     1483#endif
     1484
     1485#ifdef INCL_WINSOCK_API_TYPEDEFS
     1486TypeDef LPFN_WSASTARTUP = *Function(wVersionRequested As Word, ByRef WSAData As WSADATA) As Long
     1487#endif
     1488
     1489#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1490Declare Function WSACleanup Lib "ws2_32" () As Long
     1491#endif
     1492
     1493#ifdef INCL_WINSOCK_API_TYPEDEFS
     1494TypeDef LPFN_WSACLEANUP = *Function() As Long
     1495#endif
     1496
     1497#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1498Declare Sub WSASetLastError Lib "ws2_32" (iError As Long)
     1499#endif
     1500
     1501#ifdef INCL_WINSOCK_API_TYPEDEFS
     1502TypeDef LPFN_WSASETLASTERROR = *Sub(iError As Long)
     1503#endif
     1504
     1505#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1506Declare Function WSAGetLastError Lib "ws2_32" () As Long
     1507#endif
     1508
     1509#ifdef INCL_WINSOCK_API_TYPEDEFS
     1510TypeDef LPFN_WSAGETLASTERROR = *Function() As Long
     1511#endif
     1512
     1513#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1514Declare Function WSAIsBlocking Lib "ws2_32" () As BOOL
     1515#endif
     1516
     1517#ifdef INCL_WINSOCK_API_TYPEDEFS
     1518TypeDef LPFN_WSAISBLOCKING = *Function() As BOOL
     1519#endif
     1520
     1521#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1522Declare Function WSAUnhookBlockingHook Lib "ws2_32" () As Long
     1523#endif
     1524
     1525#ifdef INCL_WINSOCK_API_TYPEDEFS
     1526TypeDef LPFN_WSAUNHOOKBLOCKINGHOOK = *Function() As Long
     1527#endif
     1528
     1529#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1530Declare Function WSASetBlockingHook Lib "ws2_32" (lpBlockFunc As FARPROC) As FARPROC
     1531
     1532#endif
     1533
     1534#ifdef INCL_WINSOCK_API_TYPEDEFS
     1535TypeDef LPFN_WSASETBLOCKINGHOOK = *Function(lpBlockFunc As FARPROC) As FARPROC
     1536#endif
     1537
     1538#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1539Declare Function WSACancelBlockingCall Lib "ws2_32" () As Long
     1540#endif
     1541
     1542#ifdef INCL_WINSOCK_API_TYPEDEFS
     1543TypeDef LPFN_WSACANCELBLOCKINGCALL = *Function() As Long
     1544#endif
     1545
     1546#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1547Declare Function WSAAsyncGetServByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE
     1548#endif
     1549
     1550#ifdef INCL_WINSOCK_API_TYPEDEFS
     1551TypeDef LPFN_WSAASYNCGETSERVBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE
     1552#endif
     1553
     1554#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1555Declare Function WSAAsyncGetServByPort Lib "ws2_32" (hwnd As HWND, msg As DWord, port As Long, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE
     1556#endif
     1557
     1558#ifdef INCL_WINSOCK_API_TYPEDEFS
     1559TypeDef LPFN_WSAASYNCGETSERVBYPORT = *Function(hwnd As HWND, msg As DWord, port As Long, proto As PCSTR, buf As *Byte, buflen As Long) As HANDLE
     1560#endif
     1561
     1562#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1563Declare Function WSAAsyncGetProtoByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE
     1564#endif
     1565
     1566#ifdef INCL_WINSOCK_API_TYPEDEFS
     1567TypeDef LPFN_WSAASYNCGETPROTOBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE
     1568#endif
     1569
     1570#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1571Declare Function WSAAsyncGetProtoByNumber Lib "ws2_32" (hwnd As HWND, msg As DWord, number As Long, buf As *Byte, buflen As Long) As HANDLE
     1572#endif
     1573
     1574#ifdef INCL_WINSOCK_API_TYPEDEFS
     1575TypeDef LPFN_WSAASYNCGETPROTOBYNUMBER = *Function(hwnd As HWND, msg As DWord, number As Long, buf As *Byte, buflen As Long) As HANDLE
     1576#endif
     1577
     1578#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1579Declare Function WSAAsyncGetHostByName Lib "ws2_32" (hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE
     1580#endif
     1581
     1582#ifdef INCL_WINSOCK_API_TYPEDEFS
     1583TypeDef LPFN_WSAASYNCGETHOSTBYNAME = *Function(hwnd As HWND, msg As DWord, name As PCSTR, buf As *Byte, buflen As Long) As HANDLE
     1584#endif
     1585
     1586#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1587Declare Function WSAAsyncGetHostByAddr Lib "ws2_32" (hwnd As HWND, msg As DWord, addr As PCSTR, len As Long, type_ As Long, buf As *Byte, buflen As Long) As HANDLE
     1588#endif
     1589
     1590#ifdef INCL_WINSOCK_API_TYPEDEFS
     1591TypeDef LPFN_WSAASYNCGETHOSTBYADDR = *Function(hwnd As HWND, msg As DWord, addr As PCSTR, len As Long, type_ As Long, buf As *Byte, buflen As Long) As HANDLE
     1592#endif
     1593
     1594#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1595Declare Function WSACancelAsyncRequest Lib "ws2_32" (hAsyncTaskHandle As HANDLE) As Long
     1596#endif
     1597
     1598#ifdef INCL_WINSOCK_API_TYPEDEFS
     1599TypeDef LPFN_WSACANCELASYNCREQUEST = *Function(hAsyncTaskHandle As HANDLE) As Long
     1600#endif
     1601
     1602#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1603Declare Function WSAAsyncSelect Lib "ws2_32" (s As SOCKET, hwnd As HWND, msg As DWord, Event As Long) As Long
     1604#endif
     1605
     1606#ifdef INCL_WINSOCK_API_TYPEDEFS
     1607TypeDef LPFN_WSAASYNCSELECT = *Function(s As SOCKET, hwnd As HWND, msg As DWord, Event As Long) As Long
     1608#endif
     1609
     1610/* WinSock 2 API new function prototypes */
     1611
     1612#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1613Declare Function WSAAccept Lib "ws2_32" (s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long, lpfnCondition As LPCONDITIONPROC, CallbackData As ULONG_PTR) As SOCKET
     1614#endif
     1615
     1616#ifdef INCL_WINSOCK_API_TYPEDEFS
     1617TypeDef LPFN_WSAACCEPT = *Function(s As SOCKET, ByRef addr As sockaddr, ByRef addrlen As Long, lpfnCondition As LPCONDITIONPROC, CallbackData As ULONG_PTR) As SOCKET
     1618#endif
     1619
     1620#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1621Declare Function WSACloseEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL
     1622#endif
     1623
     1624#ifdef INCL_WINSOCK_API_TYPEDEFS
     1625TypeDef LPFN_WSACLOSEEVENT = *Function(hEvent As WSAEVENT) As BOOL
     1626#endif
     1627
     1628#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1629Declare Function WSAConnect Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF, ByRef SQOS As QOS, ByRef GQOS As QOS) As Long
     1630#endif
     1631
     1632#ifdef INCL_WINSOCK_API_TYPEDEFS
     1633TypeDef LPFN_WSACONNECT = *Functions As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF, ByRef SQOS As QOS, ByRef GQOS As QOS) As Long
     1634#endif
     1635
     1636#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1637Declare Function WSACreateEvent Lib "ws2_32" () As WSAEVENT
     1638#endif
     1639
     1640#ifdef INCL_WINSOCK_API_TYPEDEFS
     1641TypeDef LPFN_WSACREATEEVENT = *Function() As WSAEVENT
     1642#endif
     1643
     1644#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1645Declare Function WSADuplicateSocketA Lib "ws2_32" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA) As Long
     1646Declare Function WSADuplicateSocketW Lib "ws2_32" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOW) As Long
     1647#ifdef UNICODE
     1648Declare Function WSADuplicateSocket Lib "ws2_32" Alias "WSADuplicateSocketW" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFO) As Long
     1649#else
     1650Declare Function WSADuplicateSocket Lib "ws2_32" Alias "WSADuplicateSocketA" (s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFO) As Long
     1651#endif
     1652#endif
     1653
     1654#ifdef INCL_WINSOCK_API_TYPEDEFS
     1655TypeDef LPFN_WSADUPLICATESOCKETA = *Function(s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA) As Long
     1656TypeDef LPFN_WSADUPLICATESOCKETW = *Function(s As SOCKET, ProcessId As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOW) As Long
     1657#ifdef UNICODE
     1658TypeDef LPFN_WSADUPLICATESOCKET = LPFN_WSADUPLICATESOCKETW
     1659#else
     1660TypeDef LPFN_WSADUPLICATESOCKET = LPFN_WSADUPLICATESOCKETA
     1661#endif
     1662#endif
     1663
     1664#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1665Declare Function WSAEnumNetworkEvents Lib "ws2_32" (s As SOCKET, hEventObject As WSAEVENT, ByRef NetworkEvents As WSANETWORKEVENTS) As Long
     1666#endif
     1667
     1668#ifdef INCL_WINSOCK_API_TYPEDEFS
     1669TypeDef LPFN_WSAENUMNETWORKEVENTS = *Function(s As SOCKET, hEventObject As WSAEVENT, ByRef NetworkEvents As WSANETWORKEVENTS) As Long
     1670#endif
     1671
     1672#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1673Declare Function WSAEnumProtocolsA Lib "ws2_32" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOA, ByRef BufferLength As DWord) As Long
     1674Declare Function WSAEnumProtocolsW Lib "ws2_32" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOW, ByRef BufferLength As DWord) As Long
     1675#ifdef UNICODE
     1676Declare Function WSAEnumProtocols Lib "ws2_32" Alias "WSAEnumProtocolsW" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFO, ByRef BufferLength As DWord) As Long
     1677#else
     1678Declare Function WSAEnumProtocols Lib "ws2_32" Alias "WSAEnumProtocolsA" (Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFO, ByRef BufferLength As DWord) As Long
     1679#endif
     1680#endif
     1681
     1682#ifdef INCL_WINSOCK_API_TYPEDEFS
     1683TypeDef LPFN_WSAENUMPROTOCOLSA = *Function(Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOA, ByRef BufferLength As DWord) As Long
     1684TypeDef LPFN_WSAENUMPROTOCOLSW = *Function(Protocols As *Long, ByRef ProtocolBuffer As WSAPROTOCOL_INFOW, ByRef BufferLength As DWord) As Long
     1685#ifdef UNICODE
     1686TypeDef LPFN_WSAENUMPROTOCOLS = LPFN_WSAENUMPROTOCOLSW
     1687#else
     1688TypeDef LPFN_WSAENUMPROTOCOLS = LPFN_WSAENUMPROTOCOLSA
     1689#endif
     1690#endif
     1691
     1692#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1693Declare Function WSAEventSelect Lib "ws2_32" (s As SOCKET, hEventObject As WSAEVENT, NetworkEvents As Long) As Long
     1694#endif
     1695
     1696#ifdef INCL_WINSOCK_API_TYPEDEFS
     1697TypeDef LPFN_WSAEVENTSELECT = *Function(s As SOCKET, hEventObject As WSAEVENT, NetworkEvents As Long) As Long
     1698#endif
     1699
     1700#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1701Declare Function WSAGetOverlappedResult Lib "ws2_32" (s As SOCKET, ByRef Overlapped As WSAOVERLAPPED, ByRef cbTransfer As DWord, Wait As BOOL, ByRef Flags As DWord) As BOOL
     1702#endif
     1703
     1704#ifdef INCL_WINSOCK_API_TYPEDEFS
     1705TypeDef LPFN_WSAGETOVERLAPPEDRESULT = *Function(s As SOCKET, ByRef Overlapped As WSAOVERLAPPED, ByRef cbTransfer As DWord, Wait As BOOL, ByRef Flags As DWord) As BOOL
     1706#endif
     1707
     1708#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1709Declare Function WSAGetQOSByName Lib "ws2_32" (s As SOCKET, ByRef QOSName As WSABUF, ByRef qos As QOS) As BOOL
     1710#endif
     1711
     1712#ifdef INCL_WINSOCK_API_TYPEDEFS
     1713TypeDef LPFN_WSAGETQOSBYNAME = *Function(s As SOCKET, ByRef QOSName As WSABUF, ByRef qos As QOS) As BOOL
     1714#endif
     1715
     1716#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1717Declare Function WSAHtonl Lib "ws2_32" (s As SOCKET, hostlong As DWord, ByRef netlong As DWord) As Long
     1718#endif
     1719
     1720#ifdef INCL_WINSOCK_API_TYPEDEFS
     1721TypeDef LPFN_WSAHTONL = *Function(s As SOCKET, hostlong As DWord, ByRef netlong As DWord) As Long
     1722#endif
     1723
     1724#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1725Declare Function WSAHtons Lib "ws2_32" (s As SOCKET, hostshort As Word, ByRef netshort As Word) As Long
     1726#endif
     1727
     1728#ifdef INCL_WINSOCK_API_TYPEDEFS
     1729TypeDef LPFN_WSAHTONS = *Function(s As SOCKET, hostshort As Word, ByRef netshort As Word) As Long
     1730#endif
     1731
     1732#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1733Declare Function WSAIoctl Lib "ws2_32" (s As SOCKET, IoControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord, pvOutBuffer As VoidPtr, cbOutBuffer As DWord,
     1734    ByRef cbBytesReturned As DWord, ByRef Overlapped As WSAOVERLAPPED, pCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1735#endif
     1736
     1737#ifdef INCL_WINSOCK_API_TYPEDEFS
     1738TypeDef LPFN_WSAIOCTL = *Function(s As SOCKET, IoControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord, pvOutBuffer As VoidPtr, cbOutBuffer As DWord,
     1739    ByRef cbBytesReturned As DWord, ByRef Overlapped As WSAOVERLAPPED, pCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1740#endif
     1741
     1742#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1743Declare Function WSAJoinLeaf Lib "ws2_32" (s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF,
     1744    ByRef SQOS As QOS, ByRef GQOS AS QOS, Flags As DWord) As SOCKET
     1745#endif
     1746
     1747#ifdef INCL_WINSOCK_API_TYPEDEFS
     1748TypeDef LPFN_WSAJOINLEAF = *Function(s As SOCKET, ByRef name As sockaddr, namelen As Long, ByRef CallerData As WSABUF, ByRef CalleeData As WSABUF,
     1749    ByRef SQOS As QOS, ByRef GQOS AS QOS, Flags As DWord) As SOCKET
     1750#endif
     1751
     1752#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1753Declare Function WSANtohl Lib "ws2_32" (s As SOCKET, netlong As DWord, ByRef hostlong As DWord) As Long
     1754#endif
     1755
     1756#ifdef INCL_WINSOCK_API_TYPEDEFS
     1757TypeDef LPFN_WSANTOHL = *Function(s As SOCKET, netlong As DWord, ByRef hostlong As DWord) As Long
     1758#endif
     1759
     1760#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1761Declare Function WSANtohs Lib "ws2_32" (s As SOCKET, netshort As Word, ByRef hostshort As Word) As Long
     1762#endif
     1763
     1764#ifdef INCL_WINSOCK_API_TYPEDEFS
     1765TypeDef LPFN_WSANTOHS = *Function(s As SOCKET, netshort As Word, ByRef hostshort As Word) As Long
     1766#endif
     1767
     1768#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1769Declare Function WSARecv Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord,
     1770    ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1771#endif
     1772
     1773#ifdef INCL_WINSOCK_API_TYPEDEFS
     1774TypeDef LPFN_WSARECV = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord,
     1775    ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1776#endif
     1777
     1778#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1779Declare Function WSARecvDisconnect Lib "ws2_32" (s As SOCKET, ByRef InboundDisconnectData As WSABUF) As Long
     1780#endif
     1781
     1782#ifdef INCL_WINSOCK_API_TYPEDEFS
     1783TypeDef LPFN_WSARECVDISCONNECT = *Function(s As SOCKET, ByRef InboundDisconnectData As WSABUF) As Long
     1784#endif
     1785
     1786#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1787Declare Function WSARecvFrom Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord,
     1788    ByRef From As sockaddr, ByRef Fromlen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1789#endif
     1790
     1791#ifdef INCL_WINSOCK_API_TYPEDEFS
     1792TypeDef LPFN_WSARECVFROM = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesRecvd As DWord, ByRef Flags As DWord,
     1793    ByRef From As sockaddr, ByRef Fromlen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1794#endif
     1795
     1796#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1797Declare Function WSAResetEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL
     1798#endif
     1799
     1800#ifdef INCL_WINSOCK_API_TYPEDEFS
     1801TypeDef LPFN_WSARESETEVENT = *Function(hEvent As WSAEVENT) As BOOL
     1802#endif
     1803
     1804#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1805Declare Function WSASend Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord,
     1806    ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1807#endif
     1808
     1809#ifdef INCL_WINSOCK_API_TYPEDEFS
     1810TypeDef LPFN_WSASEND = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord,
     1811    ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1812#endif
     1813
     1814#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1815Declare Function WSASendDisconnect Lib "ws2_32" (s As SOCKET, ByRef OutboundDisconnectData As WSABUF) As Long
     1816#endif
     1817
     1818#ifdef INCL_WINSOCK_API_TYPEDEFS
     1819TypeDef LPFN_WSASENDDISCONNECT = *Function(s As SOCKET, ByRef OutboundDisconnectData As WSABUF) As Long
     1820#endif
     1821
     1822#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1823Declare Function WSASendTo Lib "ws2_32" (s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord,
     1824    ByRef To_ As sockaddr, ToLen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1825#endif
     1826
     1827#ifdef INCL_WINSOCK_API_TYPEDEFS
     1828TypeDef LPFN_WSASENDTO = *Function(s As SOCKET, ByRef Buffers As WSABUF, BufferCount As DWord, ByRef NumberOfBytesSent As DWord, ByRef Flags As DWord,
     1829    ByRef To_ As sockaddr, ToLen As Long, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     1830#endif
     1831
     1832#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1833Declare Function WSASetEvent Lib "ws2_32" (hEvent As WSAEVENT) As BOOL
     1834#endif
     1835
     1836#ifdef INCL_WINSOCK_API_TYPEDEFS
     1837TypeDef LPFN_WSASETEVENT = *Function(hEvent As WSAEVENT) As BOOL
     1838#endif
     1839
     1840#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1841Declare Function WSASocketA Lib "ws2_32" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, g As GROUP, Flags As DWord) As SOCKET
     1842Declare Function WSASocketW Lib "ws2_32" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW, g As GROUP, Flags As DWord) As SOCKET
     1843#ifdef UNICODE
     1844Declare Function WSASocket Lib "ws2_32" Alias "WSASocketW" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFO, g As GROUP, Flags As DWord) As SOCKET
     1845#else
     1846Declare Function WSASocket Lib "ws2_32" Alias "WSASocketA" (af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFO, g As GROUP, Flags As DWord) As SOCKET
     1847#endif
     1848#endif
     1849
     1850#ifdef INCL_WINSOCK_API_TYPEDEFS
     1851TypeDef LPFN_WSASOCKETA = *Function(af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA, g As GROUP, Flags As DWord) As SOCKET
     1852TypeDef LPFN_WSASOCKETW = *Function(af As Long, type_ As Long, protocol As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW, g As GROUP, Flags As DWord) As SOCKET
     1853#ifdef UNICODE
     1854TypeDef LPFN_WSASOCKET = LPFN_WSASOCKETW
     1855#else
     1856TypeDef LPFN_WSASOCKET = LPFN_WSASOCKETA
     1857#endif
     1858#endif
     1859
     1860#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1861Declare Function WSAWaitForMultipleEvents Lib "ws2_32" (cEvents As DWord, phEvents As *WSAEVENT, WaitAll As BOOL, Timeout As DWord, Alertable As BOOL) As DWord
     1862#endif
     1863
     1864#ifdef INCL_WINSOCK_API_TYPEDEFS
     1865TypeDef LPFN_WSAWAITFORMULTIPLEEVENTS = *Function(cEvents As DWord, phEvents As *WSAEVENT, WaitAll As BOOL, Timeout As DWord, Alertable As BOOL) As DWord
     1866#endif
     1867
     1868#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1869Declare Function WSAAddressToStringA Lib "ws2_32" (ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
     1870    AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long
     1871Declare Function WSAAddressToStringW Lib "ws2_32" (ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
     1872    AddressString As PWSTR, ByRef dwAddressStringLength As DWord) As Long
     1873#ifdef UNICODE
     1874Declare Function WSAAddressToString Lib "ws2_32" Alias "WSAAddressToStringW" (ByRef saAddress As SOCKADDR, AddressLength As DWord,
     1875    ByRef ProtocolInfo As WSAPROTOCOL_INFO, AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long
     1876#else
     1877Declare Function WSAAddressToString Lib "ws2_32" Alias "WSAAddressToStringA" (ByRef saAddress As SOCKADDR, AddressLength As DWord,
     1878    ByRef ProtocolInfo As WSAPROTOCOL_INFO, AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long
     1879#endif
     1880#endif
     1881
     1882#ifdef INCL_WINSOCK_API_TYPEDEFS
     1883TypeDef LPFN_WSAADDRESSTOSTRINGA = *Function(ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
     1884    AddressString As PSTR, ByRef dwAddressStringLength As DWord) As Long
     1885TypeDef LPFN_WSAADDRESSTOSTRINGW = *Function(ByRef saAddress As SOCKADDR, AddressLength As DWord, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
     1886    AddressString As PWSTR, ByRef dwAddressStringLength As DWord) As Long
     1887#ifdef UNICODE
     1888TypeDef LPFN_WSAADDRESSTOSTRING = LPFN_WSAADDRESSTOSTRINGW
     1889#else
     1890TypeDef LPFN_WSAADDRESSTOSTRING = LPFN_WSAADDRESSTOSTRINGA
     1891#endif
     1892#endif
     1893
     1894#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1895Declare Function WSAStringToAddressA Lib "ws2_32" (AddressString As PSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
     1896    ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
     1897Declare Function WSAStringToAddressW Lib "ws2_32" (AddressString As PWSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW,
     1898    ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
     1899#ifdef UNICODE
     1900Declare Function WSAStringToAddress Lib "ws2_32" Alias "WSAStringToAddressW" (AddressString As PSTR, AddressFamily As Long,
     1901    ByRef ProtocolInfo As WSAPROTOCOL_INFO, ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
     1902#else
     1903Declare Function WSAStringToAddress Lib "ws2_32" Alias "WSAStringToAddressA" (AddressString As PSTR, AddressFamily As Long,
     1904    ByRef ProtocolInfo As WSAPROTOCOL_INFO, ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
     1905#endif
     1906#endif
     1907
     1908#ifdef INCL_WINSOCK_API_TYPEDEFS
     1909TypeDef LPFN_WSASTRINGTOADDRESSA = *Function(AddressString As PSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOA,
     1910    ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
     1911TypeDef LPFN_WSASTRINGTOADDRESSW = *Function(AddressString As PWSTR, AddressFamily As Long, ByRef ProtocolInfo As WSAPROTOCOL_INFOW,
     1912    ByRef Address As SOCKADDR, ByRef AddressLength As Long) As Long
     1913#ifdef UNICODE
     1914TypeDef LPFN_WSASTRINGTOADDRESS = LPFN_WSASTRINGTOADDRESSW
     1915#else
     1916TypeDef LPFN_WSASTRINGTOADDRESS = LPFN_WSASTRINGTOADDRESSA
     1917#endif
     1918#endif
     1919
     1920' Registration and Name Resolution API functions
     1921#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1922Declare Function WSALookupServiceBeginA Lib "ws2_32" (ByRef qsRestrictions As WSAQUERYSETA, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
     1923Declare Function WSALookupServiceBeginW Lib "ws2_32" (ByRef qsRestrictions As WSAQUERYSETW, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
     1924#ifdef UNICODE
     1925Declare Function WSALookupServiceBegin Lib "ws2_32" Alias "WSALookupServiceBeginW" (ByRef qsRestrictions As WSAQUERYSET, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
     1926#else
     1927Declare Function WSALookupServiceBegin Lib "ws2_32" Alias "WSALookupServiceBeginA" (ByRef qsRestrictions As WSAQUERYSET, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
     1928#endif
     1929#endif
     1930
     1931#ifdef INCL_WINSOCK_API_TYPEDEFS
     1932TypeDef LPFN_WSALOOKUPSERVICEBEGINA = *Function(ByRef qsRestrictions As WSAQUERYSETA, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
     1933TypeDef LPFN_WSALOOKUPSERVICEBEGINW = *Function(ByRef qsRestrictions As WSAQUERYSETW, ControlFlags As DWord, ByRef hLookup As HANDLE) As Long
     1934#ifdef UNICODE
     1935TypeDef LPFN_WSALOOKUPSERVICEBEGIN = LPFN_WSALOOKUPSERVICEBEGINW
     1936#else
     1937TypeDef LPFN_WSALOOKUPSERVICEBEGIN = LPFN_WSALOOKUPSERVICEBEGINA
     1938#endif
     1939#endif
     1940
     1941#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1942Declare Function WSALookupServiceNextA Lib "ws2_32" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETA) As Long
     1943Declare Function WSALookupServiceNextW Lib "ws2_32" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETW) As Long
     1944#ifdef UNICODE
     1945Declare Function WSALookupServiceNext Lib "ws2_32" Alias "WSALookupServiceNextW" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSET) As Long
     1946#else
     1947Declare Function WSALookupServiceNext Lib "ws2_32" Alias "WSALookupServiceNextA" (hLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSET) As Long
     1948#endif
     1949#endif
     1950
     1951#ifdef INCL_WINSOCK_API_TYPEDEFS
     1952TypeDef LPFN_WSALOOKUPSERVICENEXTA = *FunctionhLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETA) As Long
     1953TypeDef LPFN_WSALOOKUPSERVICENEXTW = *FunctionhLookup As HANDLE, ControlFlags As DWord, ByRef BufferLength As DWord, ByRef qsResults As WSAQUERYSETW) As Long
     1954#ifdef UNICODE
     1955TypeDef LPFN_WSALOOKUPSERVICENEXT = LPFN_WSALOOKUPSERVICENEXTW
     1956#else
     1957TypeDef LPFN_WSALOOKUPSERVICENEXT = LPFN_WSALOOKUPSERVICENEXTA
     1958#endif
     1959#endif
     1960
     1961#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1962Declare Function WSANSPIoctl Lib "ws2_32" (hLookup As HANDLE, ControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord,
     1963    pvOutBuffer As VoidPtr, cbOutBuffer As DWord, ByRef cbBytesReturned As DWord, ByRef Completion As WSACOMPLETION) As Long
     1964#endif
     1965
     1966#ifdef INCL_WINSOCK_API_TYPEDEFS
     1967TypeDef LPFN_WSANSPIOCTL = *Function(hLookup As HANDLE, ControlCode As DWord, pvInBuffer As VoidPtr, cbInBuffer As DWord,
     1968    pvOutBuffer As VoidPtr, cbOutBuffer As DWord, ByRef cbBytesReturned As DWord, ByRef Completion As WSACOMPLETION) As Long
     1969#endif
     1970
     1971#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1972Declare Function WSALookupServiceEnd Lib "ws2_32" (hLookup As HANDLE) As Long
     1973#endif
     1974
     1975#ifdef INCL_WINSOCK_API_TYPEDEFS
     1976TypeDef LPFN_WSALOOKUPSERVICEEND = *Function(hLookup As HANDLE) As Long
     1977#endif
     1978
     1979#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     1980Declare Function WSAInstallServiceClassA Lib "ws2_32" (ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long
     1981Declare Function WSAInstallServiceClassW Lib "ws2_32" (ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long
     1982#ifdef UNICODE
     1983Declare Function WSAInstallServiceClass Lib "ws2_32" Alias "WSAInstallServiceClassW" (ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long
     1984#else
     1985Declare Function WSAInstallServiceClass Lib "ws2_32" Alias "WSAInstallServiceClassA" (ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long
     1986#endif
     1987#endif
     1988
     1989#ifdef INCL_WINSOCK_API_TYPEDEFS
     1990TypeDef LPFN_WSAINSTALLSERVICECLASSA = *Function(ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long
     1991TypeDef LPFN_WSAINSTALLSERVICECLASSW = *Function(ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long
     1992#ifdef UNICODE
     1993TypeDef LPFN_WSAINSTALLSERVICECLASS = LPFN_WSAINSTALLSERVICECLASSW
     1994#else
     1995TypeDef LPFN_WSAINSTALLSERVICECLASS = LPFN_WSAINSTALLSERVICECLASSA
     1996#endif
     1997#endif
     1998
     1999#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     2000Declare Function WSARemoveServiceClass Lib "ws2_32" (ByRef ServiceClassId As GUID) As Long
     2001#endif
     2002
     2003#ifdef INCL_WINSOCK_API_TYPEDEFS
     2004TypeDef LPFN_WSAREMOVESERVICECLASS = *Function(ByRef ServiceClassId As GUID) As Long
     2005#endif
     2006
     2007#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     2008Declare Function WSAGetServiceClassInfoA Lib "ws2_32" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long
     2009Declare Function WSAGetServiceClassInfoW Lib "ws2_32" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long
     2010#ifdef UNICODE
     2011Declare Function WSAGetServiceClassInfo Lib "ws2_32" Alias "WSAGetServiceClassInfoW" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long
     2012#else
     2013Declare Function WSAGetServiceClassInfo Lib "ws2_32" Alias "WSAGetServiceClassInfoA" (ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFO) As Long
     2014#endif
     2015#endif
     2016
     2017#ifdef INCL_WINSOCK_API_TYPEDEFS
     2018TypeDef LPFN_WSAGETSERVICECLASSINFOA = *Function(ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOA) As Long
     2019TypeDef LPFN_WSAGETSERVICECLASSINFOW = *Function(ByRef ProviderId As GUID, ByRef ServiceClassId As GUID, ByRef BufSize As DWord, ByRef ServiceClassInfo As WSASERVICECLASSINFOW) As Long
     2020#ifdef UNICODE
     2021TypeDef LPFN_WSAGETSERVICECLASSINFO = LPFN_WSAGETSERVICECLASSINFOW
     2022#else
     2023TypeDef LPFN_WSAGETSERVICECLASSINFO = LPFN_WSAGETSERVICECLASSINFOA
     2024#endif
     2025#endif
     2026
     2027#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     2028Declare Function WSAEnumNameSpaceProvidersA Lib "ws2_32" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOA) As Long
     2029Declare Function WSAEnumNameSpaceProvidersW Lib "ws2_32" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOW) As Long
     2030#ifdef UNICODE
     2031Declare Function WSAEnumNameSpaceProviders Lib "ws2_32" Alias "WSAEnumNameSpaceProvidersW" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFO) As Long
     2032#else
     2033Declare Function WSAEnumNameSpaceProviders Lib "ws2_32" Alias "WSAEnumNameSpaceProvidersA" (ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFO) As Long
     2034#endif
     2035#endif
     2036
     2037#ifdef INCL_WINSOCK_API_TYPEDEFS
     2038TypeDef LPFN_WSAENUMNAMESPACEPROVIDERSA = *Function(ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOA) As Long
     2039TypeDef LPFN_WSAENUMNAMESPACEPROVIDERSW = *Function(ByRef BufferLength As DWord, ByRef nspBuffer As WSANAMESPACE_INFOW) As Long
     2040#ifdef UNICODE
     2041TypeDef LPFN_WSAENUMNAMESPACEPROVIDERS = LPFN_WSAENUMNAMESPACEPROVIDERSW
     2042#else
     2043TypeDef LPFN_WSAENUMNAMESPACEPROVIDERS = LPFN_WSAENUMNAMESPACEPROVIDERSA
     2044#endif
     2045#endif
     2046
     2047#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     2048Declare Function WSAGetServiceClassNameByClassIdA Lib "ws2_32" (ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long
     2049Declare Function WSAGetServiceClassNameByClassIdW Lib "ws2_32" (ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long
     2050#ifdef UNICODE
     2051Declare Function WSAGetServiceClassNameByClassId Lib "ws2_32" Alias "WSAGetServiceClassNameByClassIdW" (ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long
     2052#else
     2053Declare Function WSAGetServiceClassNameByClassId Lib "ws2_32" Alias "WSAGetServiceClassNameByClassIdA" (ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long
     2054#endif
     2055#endif
     2056
     2057#ifdef INCL_WINSOCK_API_TYPEDEFS
     2058TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA = *Function(ByRef ServiceClassId As GUID, ServiceClassName As PSTR, ByRef BufferLength As DWord) As Long
     2059TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW = *Function(ByRef ServiceClassId As GUID, ServiceClassName As PWSTR, ByRef BufferLength As DWord) As Long
     2060#ifdef UNICODE
     2061TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSID = LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDW
     2062#else
     2063TypeDef LPFN_WSAGETSERVICECLASSNAMEBYCLASSID = LPFN_WSAGETSERVICECLASSNAMEBYCLASSIDA
     2064#endif
     2065#endif
     2066
     2067#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     2068Declare Function WSASetServiceA Lib "ws2_32" (ByRef qsRegInfo As WSAQUERYSETA, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
     2069Declare Function WSASetServiceW Lib "ws2_32" (ByRef qsRegInfo As WSAQUERYSETW, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
     2070#ifdef UNICODE
     2071Declare Function WSASetService Lib "ws2_32" Alias "WSASetServiceW" (ByRef qsRegInfo As WSAQUERYSET, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
     2072#else
     2073Declare Function WSASetService Lib "ws2_32" Alias "WSASetServiceA" (ByRef qsRegInfo As WSAQUERYSET, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
     2074#endif
     2075#endif
     2076
     2077#ifdef INCL_WINSOCK_API_TYPEDEFS
     2078TypeDef LPFN_WSASETSERVICEA = *Function(ByRef qsRegInfo As WSAQUERYSETA, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
     2079TypeDef LPFN_WSASETSERVICEW = *Function(ByRef qsRegInfo As WSAQUERYSETW, essoperation As WSAESETSERVICEOP, ControlFlags As DWord) As Long
     2080#ifdef UNICODE
     2081TypeDef LPFN_WSASETSERVICE = LPFN_WSASETSERVICEW
     2082#else
     2083TypeDef LPFN_WSASETSERVICE = LPFN_WSASETSERVICEA
     2084#endif
     2085#endif
     2086
     2087#ifndef NO_INCL_WINSOCK_API_PROTOTYPES
     2088Declare Function WSAProviderConfigChange Lib "ws2_32" (ByRef NotificationHandle As HANDLE, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     2089#endif
     2090
     2091#ifdef INCL_WINSOCK_API_TYPEDEFS
     2092TypeDef LPFN_WSAPROVIDERCONFIGCHANGE = *Function(ByRef NotificationHandle As HANDLE, ByRef Overlapped As WSAOVERLAPPED, lpCompletionRoutine As LPWSAOVERLAPPED_COMPLETION_ROUTINE) As Long
     2093#endif
     2094
     2095' Microsoft Windows Extended data types
     2096TypeDef SOCKADDR_IN = sockaddr_in
     2097TypeDef PSOCKADDR_IN = *sockaddr_in
     2098TypeDef LPSOCKADDR_IN = *sockaddr_in
     2099
     2100TypeDef LINGER = linger
     2101TypeDef PLINGER = *linger
     2102TypeDef LPLINGER = *linger
     2103
     2104TypeDef IN_ADDR = in_addr
     2105TypeDef PIN_ADDR = *in_addr
     2106TypeDef LPIN_ADDR = *in_addr
     2107
     2108TypeDef FD_SET = fd_set
     2109TypeDef PFD_SET = *fd_set
     2110TypeDef LPFD_SET = *fd_set
     2111
     2112TypeDef HOSTENT = hostent
     2113TypeDef PHOSTENT = *hostent
     2114TypeDef LPHOSTENT = *hostent
     2115
     2116TypeDef SERVENT = servent
     2117TypeDef PSERVENT = *servent
     2118TypeDef LPSERVENT = *servent
     2119
     2120TypeDef PROTOENT = protoent
     2121TypeDef PPROTOENT = *protoent
     2122TypeDef LPPROTOENT = *protoent
     2123
     2124TypeDef TIMEVAL = timeval
     2125TypeDef PTIMEVAL = *timeval
     2126TypeDef LPTIMEVAL = *timeval
     2127
     2128' Windows message parameter composition and decomposition macros.
     2129Const WSAMAKEASYNCREPLY(buflen, error) = MAKELONG(buflen, error)
     2130Const WSAMAKESELECTREPLY(event, error) = MAKELONG(event, error)
     2131Const WSAGETASYNCBUFLEN(lParam) = LOWORD(lParam)
     2132Const WSAGETASYNCERROR(lParam) = HIWORD(lParam)
     2133Const WSAGETSELECTEVENT(lParam) = LOWORD(lParam)
     2134Const WSAGETSELECTERROR(lParam) = HIWORD(lParam)
     2135
     2136#ifdef IPV6STRICT
     2137'#include <wsipv6ok.ab>
     2138#endif
     2139
     2140#endif
  • Include/ole2.ab

    r1 r42  
    6969
    7070#include <objbase.sbp>
    71 '#include <oleauto.h>
     71#include <oleauto.ab>
    7272
    7373' View OBJECT Error Codes
  • Include/windows/WindowHandle.sbp

    r1 r42  
    1616        hwnd = wnd.hwnd
    1717    End Sub
    18 /*
     18
    1919    Sub Operator =(hwndNew As HWND)
    2020        hwnd = hwndNew
    2121    End Sub
    22 */
     22
    2323    Function HWnd() As HWND
    2424        Return hwnd
    2525    End Function
    26    
     26
    2727    Function Operator() As HWND
    2828        Return hwnd
     
    6060        Return DrawMenuBar(hwnd)
    6161    End Function
    62    
     62
    6363    Function EnableScrollBar(SBFlags As DWord, arrows As DWord) As BOOL
    6464        Return EnableScrollBar(hwnd, SBFlags, arrows)
     
    212212        Return InvalidateRect(hwnd, ByVal 0, erace)
    213213    End Function
    214    
     214
    215215    Function Invalidate() As BOOL
    216216        Return InvalidateRect(hwnd, ByVal 0, TRUE)
     
    360360        Return SetDlgItemText(hwnd, idDlgItem, psz)
    361361    End Function
    362    
     362
    363363    Function SetCapture() As HWND
    364364        Return SetCapture(hwnd) As HWND
Note: See TracChangeset for help on using the changeset viewer.