gmSCProcessServicesClass
- Mark Juras
Owned by Mark Juras
The ProcessServices Service Class
The service class ProcessServices implements the gmNI process services. A ProcessService is a method whose implementation is not implemented in the same build-component as its reference.The field ProcessServices_AuthorCode
Prototypetypedef int (*tServiceAuthorCode)(int codeStart,int codeEnd,int codeDial,char* buffer); extern tServiceAuthorCode ProcessServices_AuthorCode;
The field ProcessServices_Engine
Prototypetypedef int (*tServiceEngine)(UBYTE* code,int nCode,void* vValues); extern tServiceEngine ProcessServices_Engine;
The field ProcessServices_hServices
Prototypetypedef void* (*HandleService)(); extern HandleService* ProcessServices_hServices;
The field ProcessServices_iServices
Prototypetypedef int (*IntegerService)(); extern IntegerService* ProcessServices_iServices;
The field ProcessServices_ivServices
Prototypetypedef int* (*IVectorService)(); extern IVectorService* ProcessServices_ivServices;
The field ProcessServices_Quantity
Prototypetypedef int (*tServiceQuantity)(UBYTE* code,int icode,int* qeType,int* qeAddr,int* qeStack, void* expr,int subRoot); extern tServiceQuantity ProcessServices_Quantity;
The field ProcessServices_ReadFactor
Prototypetypedef int (*tServiceReadFactor)(int* Parents,void* xQuant,int exp,int isSet); extern tServiceReadFactor ProcessServices_ReadFactor;
The field ProcessServices_sServices
Prototypetypedef char* (*StringService)(); extern StringService* ProcessServices_sServices;
The field ProcessServices_vServices
Prototypetypedef void (*VoidService)(); VoidService* ProcessServices_vServices;
The field ProcessServices_WriteCode
Prototypetypedef void (*tServiceWriteCode)(UBYTE* code,int iRoot,int iStart,int iEnd,int showQe, void* textStream,int item); extern tServiceWriteCode ProcessServices_WriteCode;
The method ProcessServices_AddLibrary
Prototypeint ProcessServices_AddLibrary(int libRoot, char* dllName, char* codeId);
Parameter | Description |
libRoot | Specifies the root offset or the library that is being refactored by the runtime code. It may be zero, if the runtime code does not pertain to a particular library. |
dllName | Contains the name of a dll file that should be loaded and should remain loaded for the remainder of the current execution. Up to 64 Dlls may be loaded at the same time. The method uses the standard search order to locate the actual file. |
codeId | Contains a string which is used to trigger a set of generic user migration code events within the analyser. It can be NULL. |
If all goes well, the method returns a zero; else it returns a nonzero error code as follows:
Code | Meaning |
1 | The file could not be found in any of the four search locations. |
2 | The file was found but it could not be opened as a runtime dll. |
3 | The runtime Dll did not have an IntializeServices method. |
The method ProcessServices_AuthorClass
Prototypeint ProcessServices_AuthorClass(int iStart,int iEnd,char* service,char* parentName);
Parameter | Description |
iStart | Specifies the starting offset in the global code block of the class declaration code. |
iEnd | Specifies the ending offset in the global code block of the class declaration code. |
service | Receives the name of the service in null-terminated form. Its length may be zero. |
parentName | Receives the name of the parent class in null-terminated form. Its length may be zero. |
The method returns a one if a handler was found that returned a one; else it returns zero.
The method ProcessServices_AuthorClassFile
Prototypeint ProcessServices_AuthorClassFile(int classRoot,int support);
Parameter | Description |
classRoot | Specifies the root offset of the class or page slice being authored. |
support | Specifies support information. For class files it is the root offset of the parent project file. For page slices it is AUTARG_ININTERFACE or AUTARG_IMPLEMENTS depending upon what is needed. |
The method returns a one if a handler was found that returned a one -- i.e., authored something; else it returns zero.
The method ProcessServices_AuthorDeclaration
Prototypeint ProcessServices_AuthorDeclaration(int target);
Parameter | Description |
target | Specifies the root offset of the component whose declaration is to be authored. |
The method returns a one if a handler was found that returned a one -- i.e., authored the declaration; else it returns zero.
The method ProcessServices_AuthorLibraryStub
Prototypeint ProcessServices_AuthorLibraryStub(int target,int context);
Parameter | Description |
target | Specifies the root offset of the library for which additional wrapper declarations might be needed. |
context | Specifies the type of stubs being authored. A value of zero indicates normal stubs while a value of one indicates extension method stubs. |
The method returns a one if a handler was found that returned a one; else it returns zero.
The method ProcessServices_AuthorProjectFile
Prototypeint ProcessServices_AuthorProjectFile(int projectRoot,int context);
Parameter | Description | ||||||||
projectRoot | specifies the root offset of the VB6 project file for which the control file might be needed. | ||||||||
context | Specifies the context of the call:
|
The method returns a one if a handler was found that returned a one; else it returns zero.
The method ProcessServices_AuthorReference
Prototypeint ProcessServices_AuthorReference(int projRoot);
<Reference Include="ADODB"> <Name>ADODB</Name> <HintPath>\deploy\externs\Interop.ADODB.dll</HintPath> </Reference>
Parameter | Description |
projRoot | Contains the root offset of the project whose references are being authored. It is typically used within this handler to detect the presence of other references which effect how the current one is to be authored. |
The method returns a nonzero value if any of the handlers called returned a nonzero value; else it returns zero.
The method ProcessServices_BeginProperty
Prototypeint ProcessServices_BeginProperty(char* action,int ctlType,int ctlRoot);
Parameter | Description |
action | Receives a description of the action to be performed: Ignore, Skip, or Begin. |
ctlType | Specifies the root offset of the control type information. |
ctlRoot | Specifies the root offset of the actual control whose properties are being compiled. |
If a called handler specifies how the BeginProprty is to be dealt with via the action parameter, then this method returns a one; else if returns a zero.
The method ProcessServices_CallLateBinding
Prototypeint ProcessServices_CallLateBinding(char* className,char* methodName);
Parameter | Description |
className | Contains the identifier of the class instance. |
methodName | Contains the method name. |
If a called handler executes the specified method then a nonzero value is returned; else a zero is returned.
The method ProcessServices_CodeEvent
Prototypeint ProcessServices_CodeEvent(int codeScan,int target,int hostSub,int secStart,int callStart, int iRefer,int* delta);
<Refactor id="[scrrun.dll]" dllName="ScrrunMigration.dll" event="scrrun" > <Migrate id="IFileSystem.Drives" migUsercode="scrrun"/> <Migrate id="ITextStream.AtEndOfStream" refType="Method" nPram="1" cshPattern="(%1d.Peek() == -1)" vbnPattern="(%1d.Peek() = -1)" migUsercode="scrrun.read"/> <Migrate id="ITextStream.WriteBlankLines" migUsercode="scrrun.write"/>
Parameter | Description |
codeScan | Specifies which pass within the analyser has detected the code reference -- Initial or CodeReview. |
target | Specifies the root offset of the subcomponent that contained the migUsercode that triggered this method. |
hostSub | Specifies the root offsets of the user subprogram containing reference to the triggering subcomponent. |
secStart | Specifies the start of the code section within the global code block containing the reference. This is either zero or the code offset immediately following the operation that triggered this method. |
callStart | specifies the code start of statement with reference. Thus, it is the offset of the start of the reference to the subcomponent. |
iRefer | Specifies the offset of the actual referencing opcode. |
delta | returns a one if the code block was changed; else it returns a zero. |
The method returns the offset of the next code to be examined by the overall migration control service. If the code is not restructured then it is merely the offset of the first instruction beyond the reference instruction. If the code is restructured then it is the offset of the start of the next code section to be analysed. If there is no handler found to process the reference then a zero is returned.
The method ProcessServices_CompileScript
Prototypeint ProcessServices_CompileScript(int* Parents,int pass);
Parameter | Description |
Parents | Contains the number of parents controlling the current compilation and the root offsets of those parents. |
pass | Specifies the number of the compiler pass that encountered the script. |
The method returns a one if a handler was found that returned a one; else it returns zero.
The method ProcessServices_EditAspSource
Prototypeint ProcessServices_EditAspSource(int fileRoot);
Parameter | Description |
fileRoot | Contains the root offset of the code file whose source has just been loaded. |
The method returns a nonzero value if any of the handlers called returned a nonzero value; else it returns zero.
The method ProcessServices_EditProgId
Prototypeint ProcessServices_EditProgId(char* command,int context);
Parameter | Description |
command | Contains the content of the command the contains a ProgId. |
context | Specifies the context in which the command occurs. As of now its only value is constant PROGID_CREATEOBJECT. |
The method returns a one if a handler was found that returned a one; else it returns zero.
The method ProcessServices_EditStatement
Prototypeint ProcessServices_EditStatement(char* Statement,int context);
Parameter | Description | ||||||||||
Statement | Contains the actual source statement within the statement buffer that will be parsed by the compiler. | ||||||||||
context | Specifies the type of statement being read:
|
The method returns a one if a handler was found that returned a one; else it returns zero.
The method ProcessServices_EditTranslation
Prototypeint ProcessServices_EditTranslation(int target);
Parameter | Description |
target | Specifies the root offset of the component whose target language stream is to be written. |
The method returns a non-zero value, if any of the called handlers returns a nonzero value; else it returns zero.
The method ProcessServices_ExecuteCommand
Prototypeint ProcessServices_ExecuteCommand(char* command,int nCommand);
Parameter | Description |
command | Contains the actual statement as entered in the script. Handlers called that process any substatements are expected to use this parameter to contain them. |
nCommand | Specifies the size of the command buffer, not the length of the statement it Contains. |
If one of the called handlers returns a non-zero value, then the tool assumes that the script command was processed by that code, ends its search, and returns the non-zero value. If no runtime code indicates that it has processed the command, then the method returns a zero.
The method ProcessServices_FinishAnalyser
Prototypeint ProcessServices_FinishAnalyser(void);
The method ProcessServices_GetLateBinding
Prototypeint ProcessServices_GetLateBinding(char* className,char* propName, int target, char* buffer);
Parameter | Description |
className | Contains the identifier of the class instance. |
propName | Contains the name of the property whose special name is needed. |
target | Contains the root offset of the class whose interface is being authored. |
buffer | Receives the special name to be used. |
If a called handler supplies the specified name then the length of that name as stored in the buffer parameter is returned; else a zero is returned.
The method ProcessServices_GetSpecialName
Prototypeint ProcessServices_GetSpecialName(int target,char* propName, char* buffer);
Parameter | Description |
target | Specifies the root offset of the component for whom a special name is needed. |
propName | Contains the name of the property of the component whose special name is needed. |
buffer | Receives the special name to be used. |
If a called handler supplies the specified name then the length of that name as stored in the buffer parameter is returned; else a zero is returned.
The method ProcessServices_LoadIdf
Prototypeint ProcessServices_LoadIdf(int target);
Parameter | Description |
target | Specifies the root offset of the library whose description has been loaded. |
The method returns a one if a handler was found that returned a one -- i.e., modified the content of the description; else it returns zero.
The method ProcessServices_LoadLibrary
Prototypeint ProcessServices_LoadLibrary(int libRoot, char* refpath, char* codeId);
Parameter | Description |
libRoot | Specifies the offset of the library whose components are to trigger the events. |
refPath | Contains the name of the file for the runtime code. |
codeId | Contains the trigger event identifier. |
If all goes well, the method returns a zero; else it returns a nonzero error code as follows:
Code | Meaning |
2 | The file was found but it could not be opened as a runtime dll. |
3 | The runtime Dll did not have an InitializeServices method. |
The method ProcessServices_LoadRuntime
Prototypevoid ProcessServices_LoadRuntime(char* dllname,char* event,char* filename);
Parameter | Description |
dllname | optionally specifies a simple local file name of the runtime Dll to be loaded. It is looked for using the standard search order. That order is target location, local location, system location, and language location. |
event | optionally specifies the identifier of a CodeEvent event handler if the DLL being loaded implements one. This event is triggered by references in the code to subcomponents that have a migUserCode value attributed to them. |
filename | optionally specifies the full pathname of the runtime Dll to be loaded. It is used only if the dllname parameter is NULL. |
This method itself has no return value.
The method ProcessServices_RunSupportMethod
Prototypeint ProcessServices_RunSupportMethod(int target,char* methodName);
Parameter | Description |
target | Specifies the root offset of the class whose declaration is to be authored. |
methodName | Contains the name of the support method to be authored. |
The method returns a one if a handler was found that returned a one -- i.e., authored the support method; else it returns zero.
The method ProcessServices_StartAnalyser
Prototypeint ProcessServices_StartAnalyser(void);
The method ProcessServices_StartPass2
Prototypeint ProcessServices_StartPass2(int target);
Parameter | Description |
target | Specifies the root offset of the project being compiled or zero if all projects are being compiled. |
The method returns a non-zero value, if any of the called handlers returns a nonzero value; else it returns zero.
The method ProcessServices_Transform
Prototypeint ProcessServices_Transform(int subRoot,int target,int iRefer,int* qeStack);
Parameter | Description |
subRoot | Specifies the root address of the user subprogram containing the reference to the target subcomponent. |
target | Specifies the root address of the component that contained the migTransform entry that triggered this method. |
iRefer | Specifies offset in the global code block with the reference -- i.e the offset of actual reference opcode for the target component. |
qeStack | Contains an integer vector that is maintained by the utilities that do the code scanning. It contains the current number of queue entries that would be in the stack if the sequence were being executed up to the target reference. In addition it contains the offset of the start of each queue entry. This vector is needed because many code groups refer to variable codeblocks that precede the actual target reference in the code. For example in the case of a property setter both the rightSide codeblock and hostObject codeblock precede the actual reference to the target property. |
This method returns the offset of the next code to be examined by the overall migration control process. If the code is not restructured then it is merely the offset of the first instruction beyond the reference instruction. If the code is restructured then it is the offset of the start of the next code section to be analysed. If there is no handler found to process the reference then a zero is returned.
Table of Contents