Ejemplo n.º 1
0
static void free_variable( const var_t *arg, const char *local_var_prefix )
{
  unsigned int type_offset = arg->typestring_offset;
  type_t *type = arg->type;

  write_parameter_conf_or_var_exprs(proxy, indent, local_var_prefix, PHASE_FREE, arg, FALSE);

  switch (typegen_detect_type(type, arg->attrs, TDT_IGNORE_STRINGS))
  {
  case TGT_ENUM:
  case TGT_BASIC:
    break;

  case TGT_STRUCT:
    if (get_struct_fc(type) != RPC_FC_STRUCT)
      print_proxy("/* FIXME: %s code for %s struct type 0x%x missing */\n", __FUNCTION__, arg->name, get_struct_fc(type) );
    break;

  case TGT_IFACE_POINTER:
  case TGT_POINTER:
  case TGT_ARRAY:
    print_proxy( "NdrClearOutParameters( &__frame->_StubMsg, ");
    fprintf(proxy, "&__MIDL_TypeFormatString.Format[%u], ", type_offset );
    fprintf(proxy, "(void *)%s );\n", arg->name );
    break;

  default:
    print_proxy("/* FIXME: %s code for %s type %d missing */\n", __FUNCTION__, arg->name, type_get_type(type) );
  }
}
Ejemplo n.º 2
0
static void free_variable( const var_t *arg, const char *local_var_prefix )
{
  unsigned int type_offset = arg->type->typestring_offset;
  expr_t *iid;
  type_t *type = arg->type;
  expr_t *size = get_size_is_expr(type, arg->name);

  if (size)
  {
    print_proxy( "__frame->_StubMsg.MaxCount = " );
    write_expr(proxy, size, 0, 1, NULL, NULL, local_var_prefix);
    fprintf(proxy, ";\n\n");
    print_proxy( "NdrClearOutParameters( &__frame->_StubMsg, ");
    fprintf(proxy, "&__MIDL_TypeFormatString.Format[%u], ", type_offset );
    fprintf(proxy, "(void*)%s );\n", arg->name );
    return;
  }

  switch (typegen_detect_type(type, arg->attrs, TDT_IGNORE_STRINGS))
  {
  case TGT_ENUM:
  case TGT_BASIC:
    break;

  case TGT_STRUCT:
    if (get_struct_fc(type) != RPC_FC_STRUCT)
      print_proxy("/* FIXME: %s code for %s struct type 0x%x missing */\n", __FUNCTION__, arg->name, get_struct_fc(type) );
    break;

  case TGT_IFACE_POINTER:
    iid = get_attrp( arg->attrs, ATTR_IIDIS );
    if( iid )
    {
      print_proxy( "__frame->_StubMsg.MaxCount = (ULONG_PTR) " );
      write_expr(proxy, iid, 1, 1, NULL, NULL, local_var_prefix);
      print_proxy( ";\n\n" );
    }
    /* fall through */
  case TGT_POINTER:
    if (get_pointer_fc(type, arg->attrs, TRUE) == RPC_FC_FP)
    {
      print_proxy( "NdrClearOutParameters( &__frame->_StubMsg, ");
      fprintf(proxy, "&__MIDL_TypeFormatString.Format[%u], ", type_offset );
      fprintf(proxy, "(void*)%s );\n", arg->name );
    }
    else
      print_proxy("/* FIXME: %s code for %s type %d missing */\n", __FUNCTION__, arg->name, type_get_type(type) );
    break;

  default:
    print_proxy("/* FIXME: %s code for %s type %d missing */\n", __FUNCTION__, arg->name, type_get_type(type) );
  }
}
Ejemplo n.º 3
0
int cant_be_null(const var_t *v)
{
    switch (typegen_detect_type(v->type, v->attrs, TDT_IGNORE_STRINGS))
    {
    case TGT_ARRAY:
    case TGT_POINTER:
        return (get_pointer_fc(v->type, v->attrs, TRUE) == RPC_FC_RP);
    case TGT_CTXT_HANDLE_POINTER:
        return TRUE;
    default:
        return 0;
    }

}