DOCUMENT:Q160714 12-JUN-2001 [sna] TITLE :HOWTO: Do BIND Checking in an SLI_OPEN(). PRODUCT :Microsoft SNA Server PROD/VER:WINDOWS:2.0,2.1,2.11,3.0,4.0 OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft SNA Server, versions 2.0, 2.1, 2.11, 3.0, 4.0 ------------------------------------------------------------------------------- SUMMARY ======= A call to SLI_OPEN() is used to open an SSCP-LU as well as an LU-LU session. A developer may wish to check the incoming BIND image by taking advantage of several SLI_OPEN() fields. MORE INFORMATION ================ 1. The following are the SLI_OPEN() vcb fields specific to bind checking: - other_verb.common.lua_extension_list_offset = 0x48; // should use offsetof() - other_verb.specific.open.lua_open_extension[0].lua_routine_type = LUA_ROUTINE_TYPE_BIND; - strcpy(other_verb.specific.open.lua_open_extension[0].lua_module_name, "WINSLI32"); - strcpy(other_verb.specific.open.lua_open_extension[0].lua_procedure_name, "BindValidation"); - other_verb.specific.open.lua_open_extension[1].lua_routine_type = LUA_ROUTINE_TYPE_END; NOTE: For more information on the meaning of each field see the SNA Server LUA Programmer's Reference included on the SNA Server compact disk. 2. The following is sample bind validation callback code: typedef VOID FAR PASCAL BindValidation( LUA_VERB_RECORD FAR * ) { pVerb->common.lua_prim_rc = LUA_STATE_CHECK; } Note: For vc++ 4.0 the typedef should be: typedef VOID _STDCall BindValidation(LUA_VERB_RECORD FAR*) The BIND routine has access to the LUA VCB passed to it. The BIND routine should validate the BIND and indicate the appropriate SLI primary and secondary return code in the LUA verb record. Also, the routine may indicate the primary and secondary RU sizes supported by the SLI program by setting byte 10 and 11 in the common.lua_data_ptr field (where the BIND command is indicated). 3. The following are the compiler options for the module containing the callback: /FA -c -Zle -W3 -WX -Ge -Gy -Gz -Ox -Zd -DCONDITION_HANDLING -DSTD_CALL -Di386=1 -D_X86_ -DNT_UP -DWIN32 -DDEVL -D_DLL -D_MT -DWIN32_SUPPORT 4. The following is the code generated for the callback: PUBLIC _BindValidation@4 ; COMDAT _BindValidation@4 _TEXT SEGMENT _pVerb$ = 8 _BindValidation@4 PROC NEAR ; COMDAT // pVerb->common.lua_prim_rc = LUA_STATE_CHECK; mov eax, DWORD PTR _pVerb$[esp-4] mov WORD PTR [eax+4], 512 ; 00000200H ret 4 _BindValidation@4 ENDP _TEXT ENDS 5. The following is the code generated by SLI to call this callback: ; Line 658 // (*aSCB->bind_rtn)(sliVCB); push ebp call DWORD PTR [ebx+188] // N.B. there is no ADD ESP,4 following the call 6. The following is the client internal trace showing WINSLI detecting the user provided bind validation callback: |00000157.000000f7 OUDMD Opening User DLL Modules |00000157.000000f7 OUDMD Opening a Bind Routine |00000157.000000f7 OUDMD Opening DLL = WINSLI32 |00000157.000000f7 OUDMD Loading Routine = BindValidation 7. The following is client internal trace showing the bind validation callback: |00000157.0000015c CLUAD Calling BIND Routine |00000157.0000015c CLUAD Return from BIND routine, prc=512 |00000157.0000015c CLUAD Returned With Error From Routine |00000157.0000015c FrRUI Freeing RUI vcb = 0x14E424 |00000157.0000015c BINDP USER BIND ROUTINE FAILED 8. The following is an API trace to show the bind validation error: 000015c SLI ---------------------------------------------- 11:11:52.28 000015c SLI SLI_OPEN post 000015c SLI SESSION_FAILURE - NEG_RSP_FROM_BIND_ROUTINE 000015c SLI ---- Verb Parameter Block at address 00405150 ---- 000015c SLI 52004900 000F0000 00000039 01000000 000015c SLI 00000000 4C553220 20202020 48000000 <....LU2 H...> 000015c SLI 88E01400 00000400 C0904000 F4000000 000015c SLI 00000000 00000000 00000040 00000000 <...........@....> 000015c SLI 00000000 02000000 0157494E 534C4933 <.........WINSLI3> 000015c SLI 32004269 6E645661 6C696461 74696F6E <2.BindValidation> 000015c SLI 00000000 00000000 00000000 00000000 <................> 000015c SLI 00000000 00000000 00000000 00000000 <................> 000015c SLI 00000000 00000000 00000000 00000000 <................> 000015c SLI 00000000 00000000 00000000 00000000 <................> 000015c SLI 00000000 00000000 00000000 00000000 <................> 000015c SLI 00000000 00000000 00000000 00000000 <................> 000015c SLI 00000000 00000000 0000 <.......... > 000015c SLI ---- Data at address 004090C0 ---- 000015c SLI 86998584 Additional query words: ====================================================================== Keywords : Technology : kbAudDeveloper kbSNAServSearch kbSNAServ300 kbSNAServ200 kbSNAServ211 kbSNAServ400 kbSNAServ210 Version : WINDOWS:2.0,2.1,2.11,3.0,4.0 Issue type : kbhowto ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2001.