VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_retval.py@ 62659

最後變更 在這個檔案從62659是 52260,由 vboxsync 提交於 10 年 前

crOpenGL: proper support of GetErr being called from display list, better error handling

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 2.5 KB
 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6import sys
7
8import apiutil
9
10
11apiutil.CopyrightC()
12
13print """
14/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY server_retval.py SCRIPT */
15#include "chromium.h"
16#include "cr_mem.h"
17#include "cr_net.h"
18#include "server_dispatch.h"
19#include "server.h"
20
21void crServerReturnValue( const void *payload, unsigned int payload_len )
22{
23 if (!cr_server.fProcessingPendedCommands)
24 {
25 CRMessageReadback *rb;
26 int msg_len = sizeof( *rb ) + payload_len;
27
28 /* Don't reply to client if we're loading VM snapshot*/
29 if (cr_server.bIsInLoadingState)
30 return;
31
32 if (cr_server.curClient->conn->type == CR_FILE)
33 {
34 return;
35 }
36
37 rb = (CRMessageReadback *) crAlloc( msg_len );
38
39 rb->header.type = CR_MESSAGE_READBACK;
40 CRDBGPTR_PRINTRB(cr_server.curClient->conn->u32ClientID, &cr_server.writeback_ptr);
41 CRDBGPTR_CHECKNZ(&cr_server.writeback_ptr);
42 CRDBGPTR_CHECKNZ(&cr_server.return_ptr);
43 crMemcpy( &(rb->writeback_ptr), &(cr_server.writeback_ptr), sizeof( rb->writeback_ptr ) );
44 crMemcpy( &(rb->readback_ptr), &(cr_server.return_ptr), sizeof( rb->readback_ptr ) );
45 crMemcpy( rb+1, payload, payload_len );
46 crNetSend( cr_server.curClient->conn, NULL, rb, msg_len );
47 CRDBGPTR_SETZ(&cr_server.writeback_ptr);
48 CRDBGPTR_SETZ(&cr_server.return_ptr);
49 crFree( rb );
50 return;
51 }
52#ifdef DEBUG_misha
53 WARN(("Pending command returns value"));
54#endif
55 CRDBGPTR_SETZ(&cr_server.writeback_ptr);
56 CRDBGPTR_SETZ(&cr_server.return_ptr);
57}
58"""
59
60keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
61
62for func_name in keys:
63 params = apiutil.Parameters(func_name)
64 return_type = apiutil.ReturnType(func_name)
65 if apiutil.FindSpecial( "server", func_name ):
66 continue
67 if "VBox" == apiutil.Category(func_name):
68 continue
69 if return_type != 'void':
70 print '%s SERVER_DISPATCH_APIENTRY crServerDispatch%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params))
71 print '{'
72 print '\t%s retval;' % return_type
73 print '\tretval = cr_server.head_spu->dispatch_table.%s( %s );' % (func_name, apiutil.MakeCallString(params) );
74 print '\tcrServerReturnValue( &retval, sizeof(retval) );'
75 print '\treturn retval; /* WILL PROBABLY BE IGNORED */'
76 print '}'
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette