File: EmPatchModuleHtal.cpp

package info (click to toggle)
pose 3.5-7
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 14,136 kB
  • ctags: 29,490
  • sloc: cpp: 93,990; ansic: 62,838; sh: 27,519; perl: 1,891; python: 1,242; makefile: 652
file content (89 lines) | stat: -rw-r--r-- 2,525 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* -*- mode: C++; tab-width: 4 -*- */
/* ===================================================================== *\
	Copyright (c) 1998-2001 Palm, Inc. or its subsidiaries.
	Copyright (c) 2001 PocketPyro, Inc.
	All rights reserved.
	  
	Portions Copyright (c) 1998-2001 Palm, Inc. or its subsidiaries.

	This file is part of the Palm OS Emulator.

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
\* ===================================================================== */

#include "EmCommon.h"
#include "EmPatchModuleHtal.h"

#include "EmSubroutine.h"
#include "Marshal.h"


class HtalLibHeadpatch
{
	public:
		static CallROMType		HtalLibSendReply	(void);
};


EmPatchModuleHtal::EmPatchModuleHtal (void) :
	EmPatchModule ("~Htal")
{
}


/***********************************************************************
 *
 * FUNCTION:	EmPatchModuleHtal::GetHeadpatch
 *
 * DESCRIPTION:	Special overide of GetHeadpatch to return the same function for any
 *				index.
 *
 * PARAMETERS:	index	trap index to locate patch for
 *				procP	patch procedure returned.
 *
 * RETURNED:	patchErrNone
 *
 ***********************************************************************/


Err EmPatchModuleHtal::GetHeadpatch (uint16 /* index */, HeadpatchProc& procP)
{
	procP = HtalLibHeadpatch::HtalLibSendReply;

	return kPatchErrNone;
}


/***********************************************************************
 *
 * FUNCTION:	HtalLibHeadpatch::HtalLibSendReply
 *
 * DESCRIPTION:	Ohhh...I'm going to Programmer Hell for this one...
 *				We call DlkDispatchRequest to install the user name in
 *				our UIInitialize patch.  DlkDispatchRequest will
 *				eventually call HtalLibSendReply to return a result
 *				code.  Well, we haven't fired up the Htal library, and
 *				wouldn't want it to send a response even if we had.
 *				Therefore, I'll subvert the whole process by setting
 *				the HTAL library refNum passed in to the Desktop Link
 *				Manager to an invalid value.  I'll look for this
 *				value in the SysTrap handling code and no-op the call
 *				by calling this stub.
 *
 * PARAMETERS:	none
 *
 * RETURNED:	nothing
 *
 ***********************************************************************/

CallROMType HtalLibHeadpatch::HtalLibSendReply (void)
{
	CALLED_SETUP ("Err", "void");

	PUT_RESULT_VAL (Err, errNone);

	return kSkipROM;
}