I have an app that calls getsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, etc.). This is a Windows-specific socket option that globally determines the nature of all subsequently created sockets. According to MS's documentation, the socket parameter is unused for SO_OPENTYPE, but the current implementation in Wine does require a valid socket. I created a patch to handle SO_OPENTYPE separately in get/setsockopt. Right now, it will just get and set a global variable, but nothing else in the code actually depends on its value. It's supposed to affect whether new sockets use overlapped I/O or not, but I don't think Wine currently supports overlapped on sockets anyway. The patch consists of a small change to winsock.h to add the necessary public defines and a couple extra checks in socket.c. Changelog: Paul Rupe <prupe@nc.rr.com> Very simple support for SO_OPENTYPE in getsockopt and setsockopt. -- Paul Rupe "She smiled, in the end." p r u p e @ n c . r r . c o m begin 644 so_opentype.dff M26YD97@Z(&1L;',O=VEN<V]C:R]S;V-K970N8PH]/3T]/3T]/3T]/3T]/3T] M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T] M/3T]/3T]"E)#4R!F:6QE.B`O:&]M92]W:6YE+W=I;F4O9&QL<R]W:6YS;V-K M+W-O8VME="YC+'8*<F5T<FEE=FEN9R!R979I<VEO;B`Q+C<P"F1I9F8@+74@ M+7(Q+C<P('-O8VME="YC"BTM+2!D;&QS+W=I;G-O8VLO<V]C:V5T+F,),C`P M,2\Q,2\S,"`R,SHQ,CHQ,PDQ+C<P"BLK*R!D;&QS+W=I;G-O8VLO<V]C:V5T M+F,),C`P,2\Q,B\Q-"`P,3HP,3HQ,`I`0"`M,C`R+#8@*S(P,BPQ-"!`0`H@ M"3`*('T["B`**R\J($AO;&1S('9A;'5E(&]F(%-/7T]014Y465!%('-O8VME M="!O<'1I;VXN("!4:&ES(&ES(&5S<V5N=&EA;&QY(&$@9VQO8F%L"BL@*B!V M87)I86)L92!T:&%T(%=I;F1O=W,@=7-E<R!T;R!A9F9E8W0@:&]W(&YE=R!S M;V-K971S(&%R92!C<F5A=&5D+B`@4V5E"BL@*B`\:'1T<#HO+W-U<'!O<G0N M;6EC<F]S;V9T+F-O;2]D969A=6QT+F%S<'@_<V-I9#UK8CM%3BU54SMQ,3@Q M-C$Q/BX@(%)I9VAT"BL@*B!N;W<L(%=I;F4@9&]E<R!N;W0@9&\@86YY=&AI M;F<@=VET:"!T:&ES('9A;'5E(&]T:&5R('1H86X@9V5T(&%N9"!S970@:70@ M;VX**R`J(')E<75E<W0N"BL@*B\**W-T871I8R!I;G0@;W!E;G1Y<&4@/2`P M.PHK"B`O*B!097)M=71A=&EO;B!O9B`P+BY&1%]-05A?159%3E13("T@,2!R M97!R97-E;G1I;F<@=&AE(&]R9&5R(&EN('=H:6-H('=E('!O<W0*("`J(&UE M<W-A9V5S(&EF('1H97)E(&%R92!M=6QT:7!L92!E=F5N=',N("!5<V5D(&EN M(%=)3E-/0TM?1&]!<WEN8T5V96YT+B`@5&AE"B`@*B!P<F]B;&5M(&ES(&EF M('1H97)E(&ES(&)O=&@@82!&1%]#3TY.14-4(&5V96YT(&%N9"P@<V%Y+"!A M;B!&1%]214%$(&5V96YT"D!`("TQ,C4T+#D@*S$R-C(L,C4@0$`*($E.5"!7 M24Y!4$D@5U-?9V5T<V]C:V]P="A33T-+150@<RP@24Y4(&QE=F5L+"`*("`@ M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("!)3E0@;W!T;F%M92P@ M8VAA<B`J;W!T=F%L+"!)3E0@*F]P=&QE;BD*('L*+2`@("!I;G0@9F0@/2!? M9V5T7W-O8VM?9F0H<RD["BL@("`@:6YT(&9D.PHK"BL@("`@5%)!0T4H(G-O M8VME=#H@)3`T>"P@;&5V96P@,'@E>"P@;F%M92`P>"5X+"!P='(@)3AX+"!L M96X@)61<;B(L(',L(&QE=F5L+`HK("`@("`@("`@("AI;G0I(&]P=&YA;64L M("AI;G0I(&]P='9A;"P@*&EN="D@*F]P=&QE;BD["BL@("`@+RH@4T]?3U!% M3E194$4@9&]E<R!N;W0@<F5Q=6ER92!A('9A;&ED('-O8VME="!H86YD;&4N M("HO"BL@("`@:68@*&QE=F5L(#T](%=37U-/3%]33T-+150@)B8@;W!T;F%M M92`]/2!74U]33U]/4$5.5%E012D**R`@("!["BL@("`@("`@(&EF("@A;W!T M;&5N('Q\("IO<'1L96X@/"!S:7IE;V8H:6YT*2!\?"`A;W!T=F%L*0HK("`@ M("`@("!["BL@("`@("`@("`@("!3971,87-T17)R;W(H5U-!149!54Q4*3L* M*R`@("`@("`@("`@(')E='5R;B!33T-+151?15)23U(["BL@("`@("`@('T* M*R`@("`@("`@*BAI;G0@*BEO<'1V86P@/2!O<&5N='EP93L**R`@("`@("`@ M*F]P=&QE;B`]('-I>F5O9BAI;G0I.PHK("`@("`@("!44D%#12@B9V5T=&EN M9R!G;&]B86P@4T]?3U!%3E194$4@/2`P>"5X7&XB+"!O<&5N='EP92D["BL@ M("`@("`@(')E='5R;B`P.PHK("`@('T*(`HM("`@(%1204-%*")S;V-K970Z M("4P-'@L(&]P="`P>"5X+"!P='(@)3AX+"!L96X@)61<;B(L(',L(&QE=F5L M+"`H:6YT*2!O<'1V86PL("AI;G0I("IO<'1L96XI.PHK("`@(&9D(#T@7V=E M=%]S;V-K7V9D*',I.PH@("`@(&EF("AF9"`A/2`M,2D*("`@("!["B`):68@ M*"%C;VYV97)T7W-O8VMO<'0H)FQE=F5L+"`F;W!T;F%M92DI('L*0$`@+3(Q M-#8L,3`@*S(Q-S`L,C0@0$`*(&EN="!724Y!4$D@5U-?<V5T<V]C:V]P="A3 M3T-+150@<RP@:6YT(&QE=F5L+"!I;G0@;W!T;F%M92P@"B`@("`@("`@("`@ M("`@("`@("`@("`@("`@("`@("`@("`@8V]N<W0@8VAA<B`J;W!T=F%L+"!I M;G0@;W!T;&5N*0H@>PHM("`@(&EN="!F9"`](%]G971?<V]C:U]F9"AS*3L* M*R`@("!I;G0@9F0["BL**R`@("!44D%#12@B<V]C:V5T.B`E,#1X+"!L979E M;"`P>"5X+"!N86UE(#!X)7@L('!T<B`E.'@L(&QE;B`E9%QN(BP@<RP@;&5V M96PL"BL@("`@("`@("`@*&EN="D@;W!T;F%M92P@*&EN="D@;W!T=F%L+"!O M<'1L96XI.PHK("`@("\J(%-/7T]014Y465!%(&1O97,@;F]T(')E<75I<F4@ M82!V86QI9"!S;V-K970@:&%N9&QE+B`J+PHK("`@(&EF("AL979E;"`]/2!7 M4U]33TQ?4T]#2T54("8F(&]P=&YA;64@/3T@5U-?4T]?3U!%3E194$4I"BL@ M("`@>PHK("`@("`@("!I9B`H;W!T;&5N(#P@<VEZ96]F*&EN="D@?'P@(6]P M='9A;"D**R`@("`@("`@>PHK("`@("`@("`@("`@4V5T3&%S=$5R<F]R*%=3 M045&055,5"D["BL@("`@("`@("`@("!R971U<FX@4T]#2T547T524D]2.PHK M("`@("`@("!]"BL@("`@("`@(&]P96YT>7!E(#T@*BAI;G0@*BEO<'1V86P[ M"BL@("`@("`@(%1204-%*")S971T:6YG(&=L;V)A;"!33U]/4$5.5%E012!T M;R`P>"5X7&XB+"!O<&5N='EP92D["BL@("`@("`@(')E='5R;B`P.PHK("`@ M('T*(`HM("`@(%1204-%*")S;V-K970@)3`T>"P@;&5V("5D+"!O<'0@,'@E M>"P@<'1R("4P.'@L(&QE;B`E9%QN(BP*+2`@("`@("`@("!S+"!L979E;"P@ M;W!T;F%M92P@*&EN="D@;W!T=F%L+"!O<'1L96XI.PHK("`@(&9D(#T@7V=E M=%]S;V-K7V9D*',I.PH@("`@(&EF("AF9"`A/2`M,2D*("`@("!["B`)<W1R M=6-T"6QI;F=E<B!L:6YG97(["DEN9&5X.B!I;F-L=61E+W=I;G-O8VLN:`H] M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T] M/3T]/3T]/3T]/3T]/3T]/3T]/3T]"E)#4R!F:6QE.B`O:&]M92]W:6YE+W=I M;F4O:6YC;'5D92]W:6YS;V-K+F@L=@IR971R:65V:6YG(')E=FES:6]N(#$N M,S<*9&EF9B`M=2`M<C$N,S<@=VEN<V]C:RYH"BTM+2!I;F-L=61E+W=I;G-O M8VLN:`DR,#`Q+S$Q+S$T(#(Q.C(V.C(T"3$N,S<**RLK(&EN8VQU9&4O=VEN M<V]C:RYH"3(P,#$O,3(O,30@,#$Z,#$Z,3`*0$`@+34Y,2PV("LU.3$L,3`@ M0$`*("-D969I;F4@4T]?15)23U(@("`@("`@("`@("`@("`@("`@,'@Q,#`W M"B`C9&5F:6YE(%-/7U194$4@("`@("`@("`@("`@("`@("`@(#!X,3`P.`H@ M"BLC9&5F:6YE(%-/7T]014Y465!%("`@("`@("`@("`@("`@(#!X-S`P.`HK M(V1E9FEN92!33U]364Y#2%)/3D]54U]!3$525"`@("`@("`P>#$P"BLC9&5F M:6YE(%-/7U-93D-(4D].3U537TY/3D%,15)4("`@(#!X,C`**PH@(V1E9FEN M92!)3T-005)-7TU!4TL@("`@("`@("`@("`@("`P>#=F"B`C9&5F:6YE($E/ M0U]63TE$("`@("`@("`@("`@("`@("`@(#!X,C`P,#`P,#`*("-D969I;F4@ M24]#7T]55"`@("`@("`@("`@("`@("`@("`@,'@T,#`P,#`P,`I`0"`M-C(R M+#8@*S8R-BPQ,"!`0`H@(V1E9FEN92!74U]33U]20U9424U%3R`@("`@("`@ M("`@("`P>#$P,#8*("-D969I;F4@5U-?4T]?15)23U(@("`@("`@("`@("`@ M("`@,'@Q,#`W"B`C9&5F:6YE(%=37U-/7U194$4@("`@("`@("`@("`@("`@ M(#!X,3`P.`HK"BLC9&5F:6YE(%=37U-/7T]014Y465!%("`@("`@("`@("`@ M(#!X-S`P.`HK(V1E9FEN92!74U]33U]364Y#2%)/3D]54U]!3$525"`@("`P M>#$P"BLC9&5F:6YE(%=37U-/7U-93D-(4D].3U537TY/3D%,15)4(#!X,C`* M(`H@(V1E9FEN92!74U])3T-005)-7TU!4TL@("`@("`@("`@("`P>#=F"B`C M9&5F:6YE(%=37TE/0U]63TE$("`@("`@("`@("`@("`@(#!X,C`P,#`P,#`* ` end