Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
3.7 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1989-1999 Microsoft Corporation
  3. Module Name:
  4. bindcls.cxx
  5. Abstract:
  6. This module provides implementation of the binding handle code generation
  7. classes.
  8. Notes:
  9. History:
  10. Sep-19-1993 VibhasC Created.
  11. ----------------------------------------------------------------------------*/
  12. /****************************************************************************
  13. * include files
  14. ***************************************************************************/
  15. #include "becls.hxx"
  16. #pragma hdrstop
  17. /****************************************************************************
  18. * local definitions
  19. ***************************************************************************/
  20. /****************************************************************************
  21. * local data
  22. ***************************************************************************/
  23. /****************************************************************************
  24. * externs
  25. ***************************************************************************/
  26. /****************************************************************************/
  27. PNAME
  28. CG_CONTEXT_HANDLE::GetRundownRtnName()
  29. {
  30. node_skl * pType = GetHandleType();
  31. if ( ! pRundownRoutineName )
  32. {
  33. if( pType->NodeKind() == NODE_DEF )
  34. {
  35. pRundownRoutineName = new char[256];
  36. strcpy(pRundownRoutineName, pType->GetSymName());
  37. strcat(pRundownRoutineName, "_rundown");
  38. }
  39. else
  40. pRundownRoutineName = "0";
  41. }
  42. return pRundownRoutineName;
  43. }
  44. CG_STATUS
  45. CG_CONTEXT_HANDLE::MarshallAnalysis(
  46. ANALYSIS_INFO * pAna )
  47. {
  48. pAna;
  49. return CG_OK;
  50. }
  51. CG_STATUS
  52. CG_CONTEXT_HANDLE::UnMarshallAnalysis(
  53. ANALYSIS_INFO * pAna )
  54. {
  55. pAna;
  56. return CG_OK;
  57. }
  58. CG_STATUS
  59. CG_CONTEXT_HANDLE::S_GenInitOutLocals( CCB * pCCB )
  60. {
  61. ISTREAM * pStream = pCCB->GetStream();
  62. CG_PARAM * pParam = (CG_PARAM *) pCCB->GetLastPlaceholderClass();
  63. pStream->NewLine();
  64. if ( HasNewContextFlavor() )
  65. {
  66. // For new flavors generate an initialization call that knows about flags.
  67. //
  68. // handle = NdrContextHandleInitialize( & StubMsg, & TypeFormatStr[i] );
  69. //
  70. char Buf[80];
  71. unsigned short Spaces;
  72. Spaces = (unsigned short)(strlen( pParam->GetResource()->GetResourceName() ) + 7);
  73. pStream->Write( pParam->GetResource()->GetResourceName() );
  74. pStream->Write( " = " );
  75. pStream->Write( "NdrContextHandleInitialize(" );
  76. pStream->NewLine();
  77. pStream->Spaces( Spaces );
  78. pStream->Write( "(PMIDL_STUB_MESSAGE)& "STUB_MESSAGE_VAR_NAME"," );
  79. pStream->NewLine();
  80. pStream->Spaces( Spaces );
  81. pStream->Write( "(PFORMAT_STRING) &" );
  82. pStream->Write( FORMAT_STRING_STRUCT_NAME );
  83. sprintf( Buf, ".Format[%d] );", GetFormatStringOffset() );
  84. pStream->Write( Buf );
  85. }
  86. else
  87. {
  88. // Old style optimized initialization call
  89. //
  90. // handle = NDRSContextUnmarshall( 0, DataRep );
  91. //
  92. pStream->Write( pParam->GetResource()->GetResourceName() );
  93. pStream->Write( " = " );
  94. pStream->Write( CTXT_HDL_S_UNMARSHALL_RTN_NAME );
  95. pStream->Write( "( (char *)0, " ); // pBuf
  96. pStream->Write( PRPC_MESSAGE_DATA_REP ); // Data rep
  97. pStream->Write( " ); " );
  98. }
  99. pStream->NewLine();
  100. return CG_OK;
  101. }