CA2391763A1 - System of reusable software parts and methods of use - Google Patents

System of reusable software parts and methods of use Download PDF

Info

Publication number
CA2391763A1
CA2391763A1 CA002391763A CA2391763A CA2391763A1 CA 2391763 A1 CA2391763 A1 CA 2391763A1 CA 002391763 A CA002391763 A CA 002391763A CA 2391763 A CA2391763 A CA 2391763A CA 2391763 A1 CA2391763 A1 CA 2391763A1
Authority
CA
Canada
Prior art keywords
terminal
container
event
software system
objects
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
CA002391763A
Other languages
French (fr)
Inventor
Vladimir I. Miloushev
Peter A. Nickolov
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Z-FORCE COMMUNICATIONS Inc
Original Assignee
Z-Force Corporation
Vladimir I. Miloushev
Peter A. Nickolov
Z-Force Communications, Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Z-Force Corporation, Vladimir I. Miloushev, Peter A. Nickolov, Z-Force Communications, Inc. filed Critical Z-Force Corporation
Publication of CA2391763A1 publication Critical patent/CA2391763A1/en
Abandoned legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Abstract

A system of reusable software parts for designing and constructing software components, applications and entire systems by assembly. Parts for generating events, shaping, distributing and controlling flows of events and other interactions are included. Also included are parts for handling synchronization and desynchronization of events and other interactions between parts, as well as parts for handling properties, parameterizing and serializing components, applications and systems. In addition, innovative adapter parts for interfacing parts that are not designed to work together are included. The system includes a dynamic container for software parts which supports integration of dynamically changing sets of parts into statically defined structures of parts. Other reusable parts for achieving such integration are also included.

Description

DEMANDE OU BREVET VOLUMINEUX
LA PRESENTE PARTIE DE CETTE DEMANDE OU CE BREVET COMPREND
PLUS D'UN TOME.

NOTE : Pour les tomes additionels, veuillez contacter 1e Bureau canadien des brevets JUMBO APPLICATIONS/PATENTS
THIS SECTION OF THE APPLICATION/PATENT CONTAINS MORE THAN ONE
VOLUME

NOTE: For additional volumes, please contact the Canadian Patent Office NOM DU FICHIER / FILE NAME
NOTE POUR LE TOME / VOLUME NOTE:

SYSTEM OF REUSABLE SOFTWARE PARTS AND METHODS OF USE
BACKGROUND OF THE INVENTION
(1 ) FIELD OF THE INVENTION
The present invention is related to the field of object-oriented software engineering, and, more specifically, to reusable software components.
(2) DISCUSSION OF THE BACKGROUND ART
Over the last twenty years, the object paradigm, including object-oriented analysis, design, programming and testing, has become the predominant paradigm for building software systems. A wide variety of methods, tools and techniques have been developed to support various aspects of object-oriented software construction, from formal methods for analysis and design, through a number of object-oriented languages, component object models and object-oriented databases, to a number of CASE systems and other tools that aim to automate one or more aspects of the development process.
With the maturation of the object paradigm, the focus has shifted from methods for programming objects as abstract data types to methods for designing and h~uilding systems of interacting objects. As a result, methods and means for expressing and building structures of objects have become increasingly important. Object composition has emerged and is rapidly gaining acceptance as a general and efficient way to express structural relationships between objects. New analysis and design methods based on object composition have developed and most older methods have been extended to accommodate composition.
Composition methods The focus of object composition is to provide methods, tools and systems that . make it easy to create new objects by combining already existing objects.
An excellent background explanation of analysis and design methodology based on object composition is contained in Real-time Object-Oriented Modeling (ROOM) by Bran Selic et al., John Wiley & Sons, New York, in which Selic describes a method and a system for building certain specialized types of software systems using object composition.

Another method for object composition is described in HOOD : Hierarchical Object-Oriented Design by Peter J. Robinson, Prentice-Hall, Hertfordshire, UK, 1992, and "Creating Architectures with Building Blocks" by Frank J. van der Linden and Jurgen K. Muller, IEEE Software, 12:6, November 1995, pp. 51-60.
Another method ,of building software components and systems by composition is described in a commonly assigned international patent application entitled "Apparatus, System and Method for Designing and Constructing Software Components and Systems as Assemblies of Independent Parts", serial number PCT/US96/19675, filed December 13, 1996 and published June 26, 1997, which is l0 incorporated herein by reference and referred to herein throughout as the "'675 application."
Yet another method that unifies many pre-existing methods for design and analysis of object-oriented systems and has specific provisions for object composition is described in the OMG Unified Modeling Language Specification, version 1.3, June 1999, led by the Object Management Group, Inc., 492 Old Connecticut Path, Framingham, MA 01701.
Composition-based development Composition - building new objects out of existing objects - is the natural way in which most technical systems are made. For example, mechanical systems are built by assembling together various mechanical parts and electronic systems are built by assembling and connecting chips on printed circuit boards. But today, despite its many benefits, the use of composition to build software systems is quite limited, because supporting software design by composition has proven to be extremely difficult. Instead, inferior approaches to composition, which were limited and often hard-to-use, were taken because they were easier to support. Approaches such as single and multiple inheritance, aggregation, etc., have been widely used, resulting in fragile base classes, lack of reusability, overwhelming complexity, high rate of defects and failures.
Early composition-based systems include HOOD (see earlier reference), ObjecTime Developer by ObjecTime Limited (acquired by Rational Software Corp.), Parts Workbench by Digitalk, and Parts for Java by ObjectShare, Inc. (acquired by Starbase Corp.). Each of these systems was targeted to solve a small subset of problems.
None of them provided a solution applicable to a broad range of software application types without impeding severely their performance. Specifically, use of these systems was primarily in (a) graphical user interfaces for database applications and (b) high-end telecommunication equipment.
One system that supports composition for a broad range of applications without performance impediments is the system described in the commonly assigned '675 application, with which it is possible to create new, custom functionality entirely by composition and without new program code. This system was commercialized in several products, including CIassMagic and DriverMagic, and has been used to create a variety of software components and applications ranging from graphical user interface property sheets, through Microsoft COM components, to various communications and device drivers.
Since 1996, other composition approaches have been attempted in research projects such as Espresso SCEDE by Faison Computing, Inc., and in commercial products such as Parts for Java by ParcPlace-Digitalk (later ObjectShare, Inc.), and Rational Rose ReaITime by Rational Software Corp. None of these has been widely accepted or proven to be able to create commercial systems in a broad range of application areas. The only system known to the inventors that allows effective practicing of object composition in a wide area of commercial applications is the system described in the '675 application. The system and method described in the '675 application and its commercial and other implementations are referred to hereinafter as the "'675 system."
Dynamically changing sets of objects Despite the apparent superiority of the system described in the '675 application, it, like all other composition-based systems described above failed to address adequately the important case in which part of the composed structure of objects needs to change dynamically, in response to some stimulus.
3 Except in trivial cases, most working, commercially viable software components and applications require at least one element that requires dynamic changes.
Examples include the ability to dynamically create and destroy a number of sub-windows in a given window of a graphical user interface, and the ability to dynamically create and destroy a connection object in a communications protocol stack when a connection is established and dropped.
Although most of the above-described composition-based systems do have the ability to modify structure dynamically, they do this through some amount of custom code and a violation of the composition view of the software system being built - in both cases essentially undermining the composition approach and at least partially sacrificing its advantages.
In fact, one of the most common objections to the composition-based software design approach is that the structure of software applications is generally dynamic and changes all the time, and so the ability to compose statically new components is of very limited use. Furthermore, the implementation of the functionality required to handle dynamic structures is quite complex, requires high professional qualifications and is frequently a source of hard-to-find software defects. As a result, the systematic and effective practice of software design and development by composition is seriously limited whenever the underlying system does not provide a consistent, efficient, universal and easy-to-use support for dynamically changeable structures of objects.
Reusable objects Even if support for static composition and dynamic structures of objects is available, the use of composition is still difficult without a significant number of readily available and easily reusable objects from which new functionality can be composed.
Without such a library of reusable objects the composition systems mentioned above including the system described in the '675 application is useful primarily for decomposing systems and applications during design, and in fact, all these systems have been used mostly in this way. With decomposition, the system designer uses a
4 composition-based system to express the required functionality in terms of subsystems and large-scale (thousands of lines of code) components, from which those systems are to be composed. This approach inevitably leads to defining subsystems and components in a way that makes them quite specific to the particular application. Individual components defined in such custom way then have to be custom implemented, which is typically achieved by either writing manually or generating unique code that expresses the specific functionality of the component being developed.
Because of this absence of a substantial set of reusable component objects from which new functionality can be easily composed, composition-based systems are essentially used in only two capacities: (a) as design automation aids, and (b) as integration tools or environments, with which individual components and subsystems designed for composition but developed in the traditional way can be put together.
quickly.
In order to practice composition to the full extent implied by the very name of this method and in a way that is similar to the way composition is used in all other technical disciplines, there is a need for a set of well-defined, readily available and easily reusable components, which is sufficiently robust to implement new and unanticipated application functionality, so that most, if not all of this new functionality can be built by composing these pre-existing objects into new, application-specific structures.
The issue of software reusability has been addressed extensively over the last thirty years by a wide variety of approaches, technologies, and products.
While the complete set of attempted approaches is virtually impossible to determine, most people skilled in the art to which this invention pertains will recognize the following few forms as the only ones which have survived the trial of practice. These include function libraries, object-oriented application frameworks and template libraries, and finally, reusable components used in conjunction with component object models like Microsoft COM, CORBA and Java Beans.
5 Function libraries have been extremely successful in providing reusable functionality related to algorithms, computational problems and utility functions, such as string manipulation, image processing, and similar to them. However, attempts to use function libraries to package reusable functionality that has to maintain a significant state between library calls, or that needs to use a substantial number of application-specific services in order to function, typically lead to exploding complexity of the library interface and increased difficulties of use, as well as application-dependent implementations. An excellent example of the inadequacy of the functional library approach to reusable functionality can be found in Microsoft l0 Windows 98 Driver Development Kit, in particular, in libraries related to kernel streaming and USB driver support. These libraries, which provide less than half of the required functionality of both kernel streaming and USB drivers, do so at the expense of defining hundreds of API calls, most of which are required in order to utilize the reusable functionality offered by the library. As a result, attempts to actually use these libraries require very substantial expertise, and produce code that is unnecessarily complex, very difficult to debug, and alri~ost impossible to separate from the library being used.
Application-specific object-oriented frameworks proliferated during the early to mid-nineties in an attempt to provide a solution to the exploding complexity of GUI-based applications in desktop operating systems like Microsoft Windows and Mac OS. These frameworks provide substantial support for functionality that is common among typical windows-based applications, such as menus, dialog boxes, status bars, common user interface controls, etc. They were, in fact, quite successful in lowering the entry barrier to building such applications and migrating a lot of useful functionality from DOS to Windows. Further use, however, showed that application-specific frameworks tend to be very inflexible when it comes to the architecture of the application and make it exceedingly difficult to build both new types of applications and applications that are substantially more complex than what was envisioned by the framework designers. It is not accidental that during the peak time of object-oriented framework acceptance, the major new Windows application that
6 emerged - Visio from Shapeware, Inc., (now Microsoft Visio), was built entirely without the use of such frameworks.
Component object models, such as Microsoft COM and ActiveX, Java Beans and, to a lesser extent, CORBA, were intended to provide a substantially higher degree of reusability. These technologies provide the ability to develop binary components that can be shipped and used successfully without the need to know their internal implementations. Components defined in this way typically implement input interfaces, have some kind of a property mechanism and provide rudimentary mechanisms for binding outgoing interfaces, such as COM connectable objects and the Java event delegation model.
And, indeed, component object models are considerably more successful in providing foundations for software reuse. Today, hundreds of components are available from tens of different companies and can be used by millions of developers fairly easily.
Nevertheless, these component object technologies suffer from a fundamental flaw which limits drastically their usability. The cost at which these technologies provide support for component boundaries, including incoming and outgoing interfaces and properties, is so high (in terms of both run-time overhead and development complexity) that what ends up being packaged or implemented as a component is most often a whole application subsystem consisting of tens of thousands of lines of code.
This kind of components can be reused very successfully in similar applications which need all or most of the functionality that these components provide.
Such components are, however, very hard to reuse in new types of applications, new operating environments, or when the functionality that needs to be implemented is not anticipated by the component designer. The main reason for their limited reusability comes from the very fact that component boundaries are expensive and, therefore, developers are forced to use them sparingly. This results in components that combine many different functions, which are related to each other only in the 3o context of a specific class of applications.
7 As we have seen above, the type of reuse promoted by most non-trivial functional libraries and practically all application frameworks and existing component object models makes it relatively easy to implement variations of existing types of applications but makes it exceedingly difficult and expensive to innovate in both creating new types of applications, moving to new hardware and operating environments, such as high-speed routers and other intelligent Internet equipment, and even to add new types of capabilities to existing applications.
What is needed is a reuse paradigm that focuses on reusability in new and often unanticipated circumstances, allowing software designers to innovate and move to new markets without the tremendous expense of building software from scratch.
The system described in the '675 application provides a component object model that implements component boundaries, including incoming and outgoing interfaces and property mechanisms, in a way that can be supported at negligible development cost and runtime overhead. This fact, combined with the ability to compose easily structures of interconnected objects, and build new objects that are assembled entirely from pre-existing ones, creates the necessary foundations for this type of reuse paradigm. Moreover, the '675 system, as well as most components built in conjunction with it, are easily portable to new .operating systems, execution environments and hardware architectures.
SUMMARY OF THE INVENTION
Advantages of the Invention 1. It is therefore a first advantage of the present invention to provide a set of easily reusable components that implement most of the fundamental functionality needed in a wide variety of software applications and systems.
2. It is a second advantage of the present invention to provide a set of reusable components that can be parameterized extensively without modifying their implementation or requiring source code, thus achieving the ability to modify and specialize their behavior to suit many different specific purposes as required.
3. Yet another advantage of the present invention is to provide a set of reusable components that can be combined easily into different composition structures, in
8
9 PCT/US00/22694 new and unanticipated ways, so that even entirely new application requirements and functionality can be met by combining mostly, if not only, pre-existing components.
4. One other advantage of the present invention is to provide a set of reusable components that implements fundamental software mechanisms in a way that makes these mechanisms readily available to system developers, without requiring substantial understanding of their implementation.
5. Yet another advantage of the present invention is that it provides a set of reusable parts such that each of these parts implements one well-defined mechanism or function in a way that allows this function to be combined with other functions in unanticipated ways.
6. Still another advantage of the present invention is that it provides a set of reusable parts defined so that most of these parts can be implemented in a way that is independent from any specific application, so that the parts can be reused easily in new and widely different application areas and domains.
7. One other advantage of the present invention is that it provides a set of reusable parts most of which can be implemented with no dependencies on any particular operating system, execution environment or hardware architecture, so that this set of parts and any systems built using it can be easily ported to new operating systems, environments and hardware.
8. Yet another advantage of the present invention is that it provides a set of reusable parts that encapsulate large number of interactions with hardware and operating system environments, so that components and systems built using these parts have no inherent dependencies on the execution environment and can be moved to new operating systems, environments and hardware with no modification.
9. Yet another advantage of the present invention is that it provides reusable parts that can initiate outgoing interactions in response to events that come from the outside of the designed system, thereby providing a uniform way for interfacing the functionality of the designed system with outside software or hardware.
10.Still another advantage of the present invention is that it provides reusable parts that can be inserted on a given connection between other parts without modifying the semantics of this connection, and generate notifications whenever an interaction happens between those other parts, so that yet other parts can receive that notification and take appropriate actions.
1 1.Another advantage of the present invention is that it provides reusable parts that convert one interface, logical or physical contract, or a set of incoming events, into another, thereby making it easy to combine components that cannot be connected directly or would not work if connected directly.
l0 12.Yet another advantage of the present invention is that it provides reusable parts that can be used to connect one part to many other parts even when the first part is not designed to interact with more than one other part, and distribute the interactions between the parts so connected, so that various non-trivial structures of parts can be easily composed.
13. Still another advantage of the present invention is that it provides reusable parts that can be connected to those outputs of other parts which have no meaningful use within a specific design, so that outgoing interactions through those outputs do not cause malfunction or disruption of the operation of the system and to provide a specific, pre-defined response to such outgoing operations.
14.Another advantage of the present invention is that it provides reusable parts that accept a flow of events or incoming interactions and produce an outgoing flow based on the history of the incoming interactions and a set of desired characteristics of the output flow, so that an existing flow of events can be transformed into a desirable one.
15.One other advantage of the present invention is that it provides reusable parts that can be inserted on a given connection between other parts without affecting the semantics of that connection, and provide observable indications of the interactions that transpire between those other parts.
16.Yet another advantage of the preset invention is that it provides reusable parts that store incoming events and forward them to their outputs in response to specific other events or in a given thread of execution, thereby providing an easy way to desynchronize and decouple interactions between other parts.
17.Another advantage of the present invention is that it provides reusable parts that convert incoming calls or synchronous requests into pairs of asynchronous interactions consisting of requests and replies, so that components that expect that their outgoing requests will be handled synchronously can be combined easily with components that process incoming requests asynchronously.
18.Sill another advantage of the present invention is that it provides reusable parts that make it possible to disable temporarily the flow of events on a given connection and accumulate incoming events in this state until the flow is enabled again, so that other parts are not forced to accept and handle incoming events in states in which it is not desirable to do so.
19.One other advantage of the present invention is that it provides reusable parts that allow other parts to process incoming flows of events one event at a time by accumulating or otherwise holding interactions or requests that arrive while the first interaction is in progress, so that those other parts are not forced to accept and process incoming interactions concurrently.
20.One other advantage of the present invention is that it provides reusable parts that expose the properties of other components and structures of components in the form of an interface that can be connected to yet another component, so that that other component can access, enumerate and modify those properties.
21.One other advantage of the present invention is that it provides reusable parts that can serve as containers for variable sets of properties and their values, and expose those sets through an interface that can be connected to other components so that those components can inspect and modify those property sets.
22.One other advantage of the present invention is that it provides reusable parts that can obtain variable sets of data values from outside storage and set those values as properties on structures of other components, so that those structures
11 of components can be parameterized to operate in a variety of pre-defined ways or in accordance with previously saved persistent state.
23.One other advantage of the present invention is that it provides reusable parts that can enumerate persistent properties of other components, structures of components, and entire applications, and store the identifiers and values of those properties on external storage, so that the persistent state of those components, structures of components and applications can be preserved for future restoration.
24.One other advantage of the present invention is that it provides reusable parts that convert a connectable interface for accessing properties into a set of events, and vice-versa, so that components that initiate operations on properties do not have to be dependent on the specific definition of this interface.
25.One other advantage of the present invention is that it provides reusable parts that set values of specific properties in response to incoming events so that event flows can be converted to data operations.
26.Still another advantage of the present invention is to provide a container for a dynamic set of software objects that presents that set as a single object.
27.Another advantage of the present invention is to provide the dynamic container in a way that the single object which represents the dynamic set can be easily used in statically composed structures of objects.
28.Still another advantage of the present invention is the provision of the dynamic container in such a way that when the contained objects have certain terminals and properties, the single object has the same terminals and properties.
29.Yet another advantage of the present invention is that the dynamic container further provides the ability to create and destroy instances of objects, access their properties, connect and disconnect them, and so on, in a uniform way defined by the container itself and not requiring knowledge of the specific class of the contained objects.
12 30.One other advantage of the present invention is that each object instance of the set of objects in the dynamic container can be individually selected and addressed for any purpose by a unique identifier assigned by the container.
31 .Another advantage of the present invention is that each object instance of the set of objects in the dynamic container can have a unique identifier associated with it, the identifier being assigned by the software system outside of the container, so that each object instance can be individually selected and addressed for any purpose by the unique identifier.
32.Yet another advantage of the present invention is that the set of software objects in the dynamic container can be enumerated at any time so that software can determine what is the set of objects contained~at that time.
33.One other advantage of the present invention is that a single implementation of the dynamic container is sufficient to handle any case where dynamic structures of objects are necessary.
34. Another advantage of the present invention is the properties and terminals of the single object can be manipulated even when the dynamic container contains no objects (the container is empty).
35.Yet another advantage of the present invention is that the dynamic container can be parameterized (configured) with a name of a class of which instances are created, such that the software that initiates the creation of new object instances in the container can perform the initiation without knowledge of the class name.
36.One other advantage of the present invention is that the dynamic container can, upon its own creation or another designated event, automatically create a desirable set of instances, freeing the outside system from the need to control the initial set of object instances.
37.Another advantage of the present invention is that an instance of the dynamic container can contain other instances of the dynamic container.
38.One other advantage of the present invention is that it provides reusable parts that cause other parts to be created on a pre-determined event, so that the newly created parts can handle that event and others related to it.
13 39.Yet another advantage of the present invention is that it provides reusable parts that control a dynamic container for part instances and initiate the creation, destruction, parameterization and other preparations for normal operation of new part instances in the container, whenever such new instances are needed, so that other parts will be able to use them without the need to control their life cycle, or even be aware that these parts are created dynamically.
40.Another advantage of the present invention is that it provides reusable parts that determine what part instances need to be created and maintained in a dynamic set of instances, so that there will be a proper set of these instances needed for the operation of a system or component.
41 .Still another advantage of the present invention is that it provides reusable parts that register part instances under a predetermined identifier, so that these instances can be accessed by a publicly known identifier, or included in other structures of parts by reference.
42.One other advantage of the present invention is that it provides reusable parts that make one or more classes of parts available in executable code memory, relocated as may be required, and ready for instantiation whenever such parts are needed, and remove them when no longer needed, so that these parts don't have to be in that memory when not needed.
43.Yet another advantage of the present invention is that it provides reusable parts that convert a set of events into a factory interface for creating and destroying objects in a dynamic set of objects (possibly, part instances), so that components that initiate such creation and destruction do not have to be dependent on the specific definition of the factory interface.
44. Another advantage of the present invention is that it provides reusable parts that filter a set of operations on a factory interface for creating and destroying objects to either create dynamically new part instances or obtain identifiers to already existing part instances, so that a new instance is created only when its services are first needed, is made available to any part that requires such services, and can be destroyed when its services are no longer needed.
14 45.Another advantage of the present invention is that it defines reusable interfaces and events that make it easy to build reusable software parts and construct software systems by composition using such parts.
To address the shortcomings of the background art, the present invention therefore provides:
A computer-implemented method in a computer system for designing a software system in which system at least a first object is created arbitrarily earlier than a second object and the second object is automatically connected to at least the first l0 object, the method comprising the steps of:
creating the first object;
creating a first container object capable of holding at least one other object of arbitrary object class;
defining at least a first template connection between the first object and the first container object;
creating the second object;
connecting the second object to the first object using the first template connection in which template the first container object is replaced with the second object.
This method may alternatively be practiced whereiri the step of creating the second object is performed by the first container object; or wherein the step of connecting the second object to the first object is performed by the first container object; or wherein the step of creating the second object is performed by the first container object and the step of connecting the second object to the first object is performed by the first container object; or wherein connections between all objects are established between connection points on the objects; or wherein the first template connection is defined in a data structure. The invention also provides a system created using any one of the above-listed methods.
Additionally, the invention provides a method for describing connections between a plurality of objects in a software system in which at least a first object of the plurality is created arbitrarily later than the remainder of the plurality, the method comprising the steps of:
defining at least a second object of the remainder;
defining a first container object which will be used as a placeholder for defining connections between the first object and the remainder;
defining at least a first connection between the second object and the first object by using the first container object in place of the first object.
Additionally, the invention provides a method for describing connections between a first plurality of objects in a software system and a second plurality of objects in l0 the software system, the second plurality being created arbitrarily later than the first plurality, the method comprising the steps of:
defining at least a first object of the first plurality;
defining a first container object which will be used as a placeholder for defining connections between the first object and each object of the second plurality;
defining at least a first connection to be created between the first object and each object of the second plurality as a connection between the first object and the first container object.
Additionally, the invention provides, in a software system having a plurality of objects, a container object comprising:
a first memory for keeping reference to at least a first object of arbitrary object class;
a section of program code causing the first memory to be modified so that it will contain a first reference to a second object;
a section of program code accessing a data structure and determining that at least a first connection needs to be established between the second object and at least a third object;
a section of program code causing the first connection to be established.
The container object may further comprise a section of program code causing the second object to be created.

Additionally, the invention provides, in a software system having a plurality of objects, a container object comprising:
a memory for keeping at least one reference to a contained object of arbitrary class;
a connection point for receiving requests to modify the set of contained objects;
at least one virtual connection point that accepts at least a first connection to be established to the contained object, the acceptance occurring before the contained object is added to the contained object; and a section of program code that establishes the first connection when the contained object is added to the container object.
In addition, the invention provides, in a software system having a plurality of objects, a container object comprising:
~ a first memory for keeping at least one reference to a contained object of arbitrary class;
a connection point for receiving requests to modify the set of contained objects;
at least one virtual property that accepts the value to be set in a first property on the contained object, the virtual property being capable of accepting values of a plurality of data types;
a section of program code that sets the first property on the contained object to the accepted value when the contained object is added to the contained object.
In a software system, the software system having a plurality of objects, a container object comprising:
a first memory for keeping a first plurality of contained objects of arbitrary classes;

a second memory for keeping a second plurality of unique identifiers, each identifier of the second plurality associated with exactly one object of the first plurality;
at least a first property, the first property being a second property of a first object of the first plurality and the first property being identified by a combined identifier produced by combining the associated identifier of the first object and the identifier of the second property.
Moreover, each property immediately above may comprise a terminal, and in either embodiment, the second memory may be removed and contained objects may be identified by identifiers assigned by the container.
The invention further provides a container object class in a software system, the software system having a first plurality of objects, each object of the first plurality belonging to an object class, the container object class comprising:
means for holding a second plurality of contained objects, the means being applicable to contained objects of any class;
means for changing the set of the contained objects, the means being applicable to contained objects of any class;
means for presenting the plurality of contained objects as a single object, the means being applicable to contained objects of any class.
2o It should be noted that the single object may comprise an instance of the container object class, and the container object may comprise an instance of the container object class.
The invention further provides, in a software system, the software system having a plurality of objects, each object of the plurality of objects belonging to an object class, the software system having means for building at least one structure of connected objects and means of describing the structure of connected objects, a container object class comprising:
means for holding a plurality of contained objects, the means being applicable to contained objects of any class;

means for changing the set of the contained objects programmatically, the means being applicable to contained objects of any class;
means for presenting the plurality of contained objects as a single object in the structure of connected objects, the means being applicable to contained objects of any class.
Also, the container object may comprise an instance of the container object class.
The invention further provides, in a software system having at least a first object and a second object, the first object having at least one first connection point, the second object having at least one second connection point, the first connection point l0 being used to establish a first connection between the first connection point of the first object and the second connection point of the second object, and the software system having means of requesting the establishment of a connection between connection points, a container object comprising:
means for adding and removing the first object from the container;
means for defining a third connection point on the container object;
means for transforming a requests for establishing of a connection between the second connection point and the third connection point into a request for establishing a connection between the second connection point and the first connection point.
The invention further provides that the system can include means of identifying the first connection point using a first identifier, the container object having the additional means to identify the third connection point using the first identifier. Also, the software system can include means of identifying the first connection point using a first identifier, the container object having the additional means to identify the first object using a second identifier and the container object having the additional means to identify the third connection point using a combination of the first identifier and the second identifier.
The invention further provides a container object in a software system, the software system having at least one first object and the container object, the first object having at least one first property, the software system having means of requesting operations over the first property, the container comprising:
means for adding and removing the first object from the container;
means for defining a second property on the container object;
means for transforming a request for operations over the second property into a request for operations over the first property.
The software system may also include means of identifying the first property using a first identifier, the container object having the additional means to identify the second property using the first identifier; or means of identifying the first property l0 using a first identifier, the container object having the additional means to identify the first object using a second identifier and the container object having the additional means to identify the second property using a combination of the first identifier and the second identifier. The specified means of the container may also be implemented independently of the class of the first object.
The invention further provides a container object in a software system, the software system having a plurality of objects, the software system having means for requesting operations over an object, the container object comprising:
means for holding a plurality of contained objects;
means for changing the set of the contained objects programmatically;
means for identifying each object of the contained objects by a separate, unique identifier for each object;
means of handling requests for operations over any object of the contained objects wherein the identifier is used to determine which object of the contained objects should handle the request.
Alternatively, the container may include additional means of automatically assigning the unique identifier to each object added to the container. Also, the unique identifier may be assigned outside of the container, and the container may have the additional means of associating the unique identifier with each the contained object.

The invention further provides a method for caching and propagating property values to a dynamic set of objects in a software system, the software system having a plurality of objects, each of the objects having a plurality of properties, each the property having a value and an identifier, the method comprising the steps of:
accepting a first request to modify the value of a first property on behalf of the dynamic set of objects as if the dynamic set of objects were one object;
storing the value and identifier of the first property in a first data storage;
retrieving the value and identifier of the first property from the first data storage;
issuing a request to modify the value of the first property on a first object of the dynamic set of objects, using the value and identifier retrieved from the first data storage.
The invention further provides a method for caching and propagating outgoing connections of a dynamic set of objects in a software system, the software system having a plurality of objects, the software system having means for establishing connections between the objects, the connections providing means for a first connected object to make outgoing calls to a second connected object, the method comprising the steps of:
accepting the request to establish a first outgoing connection between the dynamic set of objects and a first object, as if the dynamic set of objects were a single object;
storing a first data value necessary to effect the first connection in a first data storage;
retrieving the first data value from the first data storage;
issuing a request to establish a second connection between a second object of the dynamic set and the first object, using the first data value retrieved from the first data storage.
Additionally, the invention provides a container object within a software system that utilizes either or both of the two methods for caching decribed immediately above.

The invention further provides a container object in a software system, the software system having a plurality of objects, the software system having means for building at least one structure of connected objects, the software system having a first means of describing the structure, the container object being a first object in the structure, the first object having a first connection to at least a second object in the structure, the first connection being described by the first means, the container comprising:
means for holding a plurality of contained objects;
means for changing the set of the contained objects programmatically;
means for connecting each of the contained objects to the second object.
Alternatively, the above-described container object may include the additional means of establishing all connections between the container and other objects in the structure, the all connections being described by the first means, the additional means causing the establishing of each of the all connections between each of the contained objects and the other objects in the structure.
The invention further provides a container object in a software system, the software system having a plurality of objects, the software system having means of building at least one structure of connected objects, the software system having a first means of describing the structure, the software system providing a second means of enumerating all connections described by the first means, the container being a first object in the structure, the container being connected to at least a second object in the structure, the container comprising:
means for holding a plurality of contained objects;
means for changing the set of the contained objects programmatically;
means for finding a first described connection between the container and the second object;
means for establishing the first connection between a third object contained in the container and the second object.
Alternatively, the container may establish connections between a first connection 3o point of the third object and a second connection point of the second object.

The invention further provides a container object in a software system, the software system having a plurality of objects, the container having a first connection to at least one object, the first connection being described in a first data structure, the container comprising:
means for holding a plurality of contained objects;
means for changing the set of the contained objects programmatically;
means for determining a first set of connections to be established for each object added to the set of contained objects based on the set of connections described in the first data structure;
l0 means for establishing the first set of connections.
Alternatively, the container may further comprise means for dissolving the first set of connections, or may further comprise:
means for remembering a second set of outgoing connections from the container to other objects means for excluding the second set of connections from the first set of connections means for establishing the second set of outgoing connections for each object added to the set of contained objects.
Alternatively, the container wherein may further comprise:
means for remembering properties set on the container;
means for setting remembered properties on each new object added to the set of contained objects;
means for propagating properties set on the container to all objects in the set of contained objects;
The invention further provides a container object in a software system, the software system containing a plurality of objects, the software system having a first means to establish connections between connection points of objects of the plurality, the first means providing the ability to establish more than one connection~to a first connection point of a first object, the container object having a second connection point connected to the first connection point of the first object, the container comprising:
means for holding a plurality of contained objects;
means for changing the set of the contained objects programmatically;
means for establishing a separate connection between a connection point on each object of the plurality of contained objects and the first connection point of the first object.
Alternatively, the container may further comprise means for remembering properties set on the container.
The invention further provides a part for distributing events among a plurality of parts, the part comprising:
a multiple cardinality input, a multiple cardinality output, means for recording references to parts that are connected to the output means for forwarding events received on the input to each of the connected objects to the output.
The invention further provides a part for distributing events and requests between a plurality of other parts, the part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to a first connected part;
a third terminal for sending calls out to a second connected part;
means for choosing whether to send the received call through the second terminal or through the third terminal.
The invention further provides a part for distributing events and requests between a plurality of other parts, the part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to a first connected part;
a third terminal for sending calls out to a second connected part;

means for choosing whether to first send the received call through the second terminal and then through the third terminal or to first send the received call through the third terminal and then through the second terminal.
The invention further provides a part for distributing events and requests between a plurality of other parts, the part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to a first connected part;
a third terminal for sending calls out to a second connected part;
means for sending a first received call as a first call to the second terminal l0 and then, based on value returned from the first call, choose whether or not to send the first received call as a second call to the third terminal.
The invention still further provides a method for desynchronizing events and requests in a software system, the method comprising the steps of:
storing the event in a memory;
receiving a pulse signal;
retrieving the event from the memory and continuing to process the event in the execution context of the pulse signal.
The invention still further provides a part in a software system, the part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to a first connected part;
a third terminal for receiving a pulse call;
a memory for storing call information received from the first terminal;
a section of program code that is executed when the part receives the pulse calls, the section retrieving the call information from the memory and sending a call out to the second terminal.
Alternatively, in the part described immediately above, the memory can hold call information for a plurality of calls, or the memory can comprise a queue, or the memory can comprise a stack.

The invention still further provides a part in a software system, the part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to first connected part;
a memory for storing call information received from the first terminal;
a means for obtaining execution context;
a section of program code that is executed in the execution context, the section retrieving the call information from the memory and sending a call out to the second terminal.
l0 Alternatively, in the part described immediately above, the means for obtaining execution context may comprise a thread of execution in a multithreaded system, or the means for obtaining execution context may comprise a timer callback, or the means for obtaining execution context may comprise a subordinate part. Also in the alternative, the means for obtaining execution context may comprise a subordinate part, the subordinate part having a primary function of providing execution context for other parts.
The invention further provides a part in a software system, the part comprising:
a first subordinate part for storing incoming data; and a second subordinate part for generating execution context.
Alternatively, the part may further comprise a connection between the first subordinate part and the second subordinate part.
The invention further provides a part in a software system, the part comprising:
a first terminal for receiving an incoming request;
a second terminal for sending out an outgoing request;
a third terminal for receiving a request completion indication;
a synchronization object for blocking the thread in which the incoming request was received until the request completion indication is received.
Alternatively, the second terminal and the third terminal may comprise one terminal.
The invention further provides a part in a software system, the part comprising:

an input terminal for receiving calls of a first type;
an output terminal for sending calls of a second type;
means for converting calls of the first type to calls of the second type.
The invention further provides a part in a software system, the part comprising:
an input terminal for receiving calls of a first type and sending calls of the first type;
an output terminal for receiving calls of a second type and sending calls of the second type;
means for converting calls of the first type to calls of the second type;
l0 means for converting calls of the second type to calls of the first type.
Alternatively, any of the parts described herein may be further characterized such that: the first type and the second type differ by physical mechanism, or the first type and the second type differ by logical contract.
The invention further provides a part in a software system, the part comprising:
a first terminal for receiving a first request and sending a second request;
a second terminal for sending the first request;
a third terminal for receiving the second request.
Alternatively, the part described immediately above may be further characterized such that:
2o the first terminal is a bidirectional terminal;
the second terminal is an output terminal;
the third terminal is an input terminal.
The invention further provides a part in a software system, the part comprising:
a first terminal for receiving calls;
a second terminal for sending out calls received on the first terminal;
a third terminal for sending out calls whenever a call is received on the first terminal.
In the alternative, the part described above may be further characterized such that the part further comprises a first property for defining a criterion for selecting for which calls received on the first terminal the part will send out calls through the third terminal, or such that the part further comprises a second property for configuring what call the part will send out the third terminal, or such that the part further comprises a third property for configuring what call the part will send out the third terminal before sending out a call received on the first terminal to the second terminal, or such that the part further comprises a third property for configuring what call the part will send out the third terminal after sending out a call received on the first terminal to the second terminal, or such that the part further comprises a third property for configuring whether a call out through the third terminal should be made before or after sending out a call received on the first terminal to the second terminal.
The invention further provides a part in a software system, the part comprising:
a first terminal for receiving calls;
a second terminal for sending out calls received on the first terminal;
a third terminal for sending out calls whenever a call sent out the second terminal returns a pre-determined value.
Alternatively, the part described above may be further characterized such that the part further comprises a property for configuring the pre-determined value, or such that the pre-determined value indicates that the second call has failed, or such that the pre-determined value indicates that the second call has succeeded.
The invention further provides a part in a software system, the part comprising:
a first terminal for receiving calls;
a second terminal for sending out calls received on the first terminal;
a first property for configuring a first value;
a third terminal for sending out notification calls whenever a call sent out the second terminal returns a second value that matches the first value.
Alternatively, the part described above may further comprise a second property for configuring whether the part will send out the notification calls if the second value matches the first value or if the second value differs from the first value. .
The invention further provides a part in a software system, the part comprising:
a terminal for receiving calls of arbitrary logical contract;
a property for defining a return value.

Alternatively, he part described above may further comprise a property for configuring the logical contract for calls received on the terminal. Also, the part may be further characterized such that the terminal is an input terminal, or such that the terminal is a bi-directional terminal and the part does not make calls out the terminal.
The invention further provides a part in a software system, the part comprising:
a terminal for receiving a first call and a reference to a first memory;
a property for defining a return value;
a section of program code for freeing the first memory.
Alternatively, the part described above may be further characterized such that the part further comprises means for determining whether the section of program code should be executed for the first call, or such that the part further comprises means for determining whether the section of program code should be executed for the first call based on a value contained in the first memory.
The invention further provides a part in a software system, the part comprising:
a first terminal for receiving a first call;
a second terminal for sending out the first call;
means for extracting data from the first call;
means for formatting the extracted data as a first text;
means for sending out the first text.
Alternatively, the part described above may be further characterized such that the means for sending out the first text is a third terminal, or the means for sending out the first text is a section of program code that invokes a function for displaying the first text on a console.
The invention further provides a first structure of connected parts in a software system, the first structure comprising:
a factory part for determining when a new part should be created;
a container part for holding a first plurality of parts of arbitrary part class;
a connection between the factory part and the container part.
In the alternative, the structure described above may be further charcterized such that:

the factory part has a first terminal;
the container part has a second terminal;
the connection is established between the first terminal and the second terminal.
Also, the structure may further comprise a demultiplexing part having a first terminal for receiving calls, a second terminal for sending out calls and means for selecting a part connected to the second terminal, or may further comprise a plurality of connections, each connection established between the second terminal of the demultiplexing part and a terminal of each part in the first plurality. Also, the connection demultiplexing part and the factory part may comprise one part.
In the alternative, the invention further provides a composite part in a software system, the composite part comprising the structure described above. In the alternative, the structure may further comprise an enumerator part for defining the set of parts in the first plurality. The structure may further comprise a connection between the enumerator part and the factory part. Also, the structure may be further characterized such that the enumerator uses a data container for defining the parts in the first plurality. Also, the enumerator may comprise means for enumerating a set of peripheral devices connected to a computer system, or may further comprise a first property for configuring a limitation on the type of peripheral devices to be enumerated.
Alternatively, the structure may comprise a parameterizer part for retrieving the value for at least one property to be set on each part of the first plurality.
Also, the parameterizer part may retrieve the value from a data container, or the parameterizer part may use a persistent identifier to select the value among a set of values, or the structure may further comprise a serializer part for saving the value of at least on property of each part in the first plurality, or the structure may further comprise a trigger part for initiating the saving of the value, or the structure may further comprise a parameterizer part for retrieving the value for a first property to be set on each part of the first plurality and for saving the value of the first property. Also, in the alternative, the structure may be further characterized such that the factory part determines whether to create a new part in the first plurality or to use an existing part in the first plurality based a persistent identifier provided to the factory part, or such that the structure further comprises a loader part for bringing in memory a class for a part to be created, or such that the structure further comprises:
a connection between the factory part and the loader part;
a connection between the loader part and the container part.
[structure: factory: genus] A part in a software system, the part comprising:
a first terminal for receiving calls;
a second terminal for sending out calls received on the first terminal;
a third terminal for sending out requests to create new parts;
means for selecting calls received on the first terminal for which the part sends out requests on the third terminal.
The invention further provides a method for designing access to a hardware component in a component-based software system, the method comprising the steps of:
designating a first software component for receiving interrupts from the hardware component;
designating a at least a second software component for accessing input and output ports of the hardware component;
designating a third software component for handling interrupts received by the first software component;
designating a fourth software component for manipulating the hardware component;
connecting the first software component to the third software component;
connecting the second software component to the fourth software component.
In the alternative, the method described above may further comprise the step of connecting the third software component aiid the fourth software component, or may be further characterized such that the third software component and the fourth software component are one component.

The invention further provides a part in a software system, the part comprising:
a first terminal for sending out calls;
a section of program code for receiving control when an interrupt occurs and sending out a call through the first terminal.
Alternatively, the part described above may further comprise a property for configuring which hardware interrupt vector among a plurality of hardware interrupt vectors the part should receive, or may further comprise a section of program code for registering the part to receive control when the interrupt occurs.
The invention further provides a part in a software system, the part comprising:
l0 a terminal for receiving requests to access at least one port of a hardware component;
a property defining the base address of the port;
a section of code that accesses the port when a request is received on the first terminal.
Alternatively, the part described above may comprise a memory-mapped port, or an input-output port, or the requests may include a read request and a write request.
The invention further provides a structure of connected parts in a software system, the structure comprising:
an interrupt source part for receiving interrupt from a hardware component;
at least one port accessor part for accessing ports of the hardware component;
at least one controller part for controlling the hardware component.
In the alternative, the the structure described above may be further characterized such that the controller part accesses the hardware component exclusively through the interrupt source part and the port accessor part, or such that the structure further comprises:
a connection between the interrupt source part and one of the controller parts;

a connection between one of the port accessor parts and one of the controller parts.
Alternatively, the invention further provides a composite part in a software system, the composite part containing any structure described above The invention further provides a method for designing software system in which system at least a first object is created arbitrarily earlier than a second object and the second object is automatically connected to at least the first object, the method comprising the steps of:
creating the first object;
creating a first container object capable of holding at least one other object of arbitrary object class;
defining at least a first template connection between the first object and the first container object;
creating the second object;
connecting the second object to the first object using the first template connection in which template the first container object is replaced with the second object BRIEF DESCRIPTION OF THE DRAWINGS
The aforementioned features and advantages of the invention as well as additional features and advantages thereof will be more clearly understood hereinafter as a result of a detailed description of a preferred embodiment of the invention when taken in conjunction with the following drawings in which:
Figure 1 illustrates an event source by thread, DM EST
Figure 2 illustrates an event source, thread-based, DM EVS
Figure 3 illustrates an event source with DriverMagic pump, DM ESP
Figure 4 illustrates an event source by Windows message, DM-ESW
Figure 5 illustrates a timer event source, DM EVT
Figure 6 illustrates a event source on interrupt, DM IRQ
Figure 7 illustrates a notifier, DM NFY

Figure 8 illustrates an advanced event notifier, DM NFY2 Figure 9 illustrates a notifier on status, DM NFYS
Figure 10 illustrates the internal structure of the DM NFYS notifier Figure 1 1 illustrates a bi-directional notifier, DM NFYB
Figure 12 illustrates the internal structure of the DM NFYB notifier Figure 13 illustrates a poly-to-drain adapter, DM P2D
Figure 14 illustrates a drain-to-poly adapter, DM D2P
Figure 15 illustrates a poly-to-drain adapter that provides the operation bus as event bus, DM NP2D
Figure 16 illustrates a drain-to-poly adapter that uses the event bus as operation bus, Figure 17 illustrates a bi-directional drain-to-poly adapter, DM BP2D
Figure 18 illustrates an interface-to-interface adapter, DM D2M
Figure 19 illustrates an event set-to-event set adapter, DM D1021RP
Figure 20 illustrates a usage of the DM-D1021RP adapter Figure 21 illustrates another event set-to-event set adapter, DM A2K
Figure 22 illustrates a usage of the DM A2K adapter Figure 23 illustrates an interface-to-event set adapter, DM IES
Figure 24 illustrates a usage of the DM-IES adapter Figure 25 illustrates a stateful adapter, DM_PLT
Figure 26 illustrates the internal structure of the DM-PLT adapter Figure 27 illustrates an event recoder adapter, DM ERC
Figure 28 illustrates a status recoder adapter, DM STX
Figure 29 illustrates a usage of the DM_STX adapter Figure 30 illustrates another usage of the DM STX adapter Figure 31 illustrates an asynchronous completer, DM ACT
Figure 32 illustrates a string formatter, DM-SFMT
Figure 33 illustrates an event bus distributor, DM EVB
Figure 34 illustrates a notation used to reprsent the DM_EVB event bus in diagrams Figure 35 illustrates a usage of the DM_EVB event bus Figure 36 illustrates a distributor for service, DM DSV
Figure 37 illustrates cascading of distributors Figure 38 illustrates an event replicator distributor, DM RPL
Figure 39 illustrates an event sequencer distributor, DM SEQ
Figure 40 illustrates an event sequencer distributor with thread, DM SEAT
Figure 41 illustrates the internal structure of the DM SEAT distributor Figure 42 illustrates a life-cycle sequencer, DM LFS
Figure 43 illustrates an event-controlled multiplexer distributor, DM MUX
Figure 44 illustrates a property-controlled switch distributor, DM SWP
Figure 45 illustrates a bi-directional property-controlled switch distributor, DM SWPB
Figure 46 illustrates a connection demultiplexer distributor, ZP CDM
Figure 47 illustrates a bi-directional connection demultiplexer distributor, ZP CDMB
Figure 48 illustrates a connection multiplexer-demultiplexer distributor, ZP
CMX
Figure 49 illustrates a usage of ZP CMX for connecting multiple clients to a server Figure 50 illustrates another usage of ZP CMX with dynamic structure of parts Figure 51 illustrates an event splitter filter distributor, DM SPL
Figure 52 illustrates a bi-directional event splitter filter, DM BFL
Figure 53 illustrates the internal structure of the DM-BFL filter Figure 54 illustrates a filter by integer value distributor, DM IFLT
Figure 55 illustrates a bi-directional filter by integer value, DM IFLTB
Figure 56 illustrates the internal structure of the DM-IFLTB filter Figure 57 illustrates a usage of the DM_IFLT filter Figure 58 illustrates a string filter distributor, DM SFLT
Figure 59 illustrates a string filter by four, DM SFLT4 Figure 60 illustrates a filter for Windows kernel mode input-output request packet (IRP) events, DM IRPFLT
Figure 61 illustrates a bi-directional splitter distributor, DM-BSP
Figure 62 illustrates a usage of the DM-BSP bi-directional slitter, for connecting two parts with unidirectional terminals to another part with a bi-directional terminal Figure 63 illustrates a usage of the DM-BSP bi-directional splitter, for connecting a part with two uni-directional terminals to a part with a bi-directional terminal Figure 64 illustrates an interface splitter distributor, DM DIS
Figure 65 illustrates an idle generator by event distributor, DM IEV
Figure 66 illustrates a unidirectional drain stopper terminator, DM STP
Figure 67 illustrates a bi-directional drain stopper terminator, DM BST
Figure 68 illustrates a unidirectional polymorphic stopper terminator, DM PST
Figure 69 illustrates a b-directional polymorphic stopper terminator, DM PBS
l0 Figure 70 illustrates the internal structure of the DM BST terminator Figure 71 illustrates the internal structure of the DM PST terminator Figure 72 illustrates the internal structure of the DM PBS terminator Figure 73 illustrates the universal stopper terminator, DM UST
Figure 74 illustrates the drain stopper terminator, DM DST
Figure 75 illustrates the internal structure of the DM DST terminator Figure 76 illustrates an event consolidator, DM ECS
Figure 77 illustrates a bi-directional event consolidator, DM ECSB
Figure 78 illustrates an indicator, DM IND
Figure 79 illustrates a call tracer indicator, DM CTR
Figure 80 illustrates a bus dumper indicator, DM BSD
Figure 81 illustrates a fundamental desynchronizer, DM FDSY
Figure 82 illustrates an event desynchronizer, DM DSY
Figure 83 illustrates a desynchronizer for requests, DM DSYR
Figure 84 illustrates the internal structure of the DM-DSYR desynchronizer Figure 85 illustrates an event desynchronizer with external control (feed), DM
DWI
Figure 86 illustrates an event desynchronizer with consolidateable external control, Figure 87 illustrates the internal structure of the DM DWI2 desynchronizer Figure 88 illustrates desynchronizers with own thread, DM DWT and DM DOT
Figure 89 illustrates the internal structure of the DM-DWT desynchronizer Figure 90 illustrates the internal structure of the DM_DOT desynchronizer Figure 91 illustrates a usage of the DM-DWT desynchronizer Figure 92 illustrates a usage of two DM-DWT desynchronizers to keep separate the order of events from two event sources Figure 93 illustrates a usage of the DM DOT desynchronizers Figure 94 illustrates desynchronizers with external thread (on DriverMagic pump), DM DWP and DM DOP
Figure 95 illustrates the internal structure of the DM-DWP desynchronizer Figure 96 illustrates the internal structure of the DM DOP desynchronizer Figure 97 illustrates desynchronizers on Windows messages, DM DWW and DM DOW
Figure 98 illustrates the internal structure of the DM-DWW desynchronizer Figure 99 illustrates the internal structure of the DM DOW desynchronizer Figure 100 illustrates a desynchronizer for requests with own thread, DM RDWT
Figure 101 illustrates the internal structure of the DM_RDWT desynchronizer Figure 102 illustrates a bi-directional resynchronizer, DM RSB
Figure 103 illustrates a resynchronizer, DM RSY
Figure 104 illustrates the internal structure of the DM-RSY
resynchronizer Figure 105 illustrates a usage of the DM_RSY resynchronizer Figure 106 illustrates a usage of the DM-RSB resynchronizer Figure 107 illustrates a cascaded usage of resynchronizers Figure 108 illustrates a synchronous event buffer, DM SEB

Figure 109 illustrates the internal structure of the DM
SEB buffer Figure 1 10 illustrates an event buffer with postpone capability, DM SEBP
Figure 1 1 1 illustrates the internal structure of the DM SEBP buffer Figure 1 12 illustrates a usage of the DM SEBP buffer Figure 1 13 illustrates an asymmetrical bi-directional event buffer, DM ASB
Figure 1 14 illustrates the internal structure of the DM ASB buffer Figure 1 15 illustrates an asymmetrical buffer for requests, DM ASBR2 Figure 1 16 illustrates the internal structure of the DM ASBR2 buffer Figure 1 17 illustrates the internal structure of the DM ASBR buffer Figure 1 18 illustrates an event serializer, DM ESL

Figure 1 19 illustrates the internal structure of the DM
ESL event serializer Figure 120 illustrates a request serializer, DM RSL

Figure 121 illustrates the internal structure of the DM-RSL
request serializer Figure 122 illustrates an IRP event popper, DM EPP
Figure 123 illustrates the internal structure of the DM-EPP event popper Figure 124 illustrates a property exposer, DM PEX
Figure 125 illustrates a virtual property container, DM VPC
Figure 126 illustrates a hierarchical repository, DM REP
Figure 127 Illustrates the binary structure of the DM_REP serialized image Figure 128 illustrates a parameterizer from registry, DM-PRM
.Figure 129 illustrates a serializer to registry, DM SER
Figure 130 illustrates the internal structure of the DM SER serializer Figure 131 illustrates an activation/deactivation adaptor, DM SERADP
Figure 132 illustrates an event to property interface converter, DM E2P
Figure 133 illustrates a property to event adapter, DM P2E
Figure 134 illustrates a property setter adapter, DM_PSET
Figure 135 illustrates an eight property setters adapter, DM PSET8 Figure 136 illustrates a graphical representation of a dynamic container for parts Figure 137 illustrates types of connections between contained objects and objects outside of the container that the preferred embodiment can support Figure 138 illustrates types of connections between contained objects and objects outside of the container that the preferred embodiment does not support Figure 139 illustrates an example of a device driver architecture designed using a part array. The array is used to contain a dynamic set of part instances, one per each individual device that is serviced by the driver Figure 140 illustrates a Windows WDM Plug-and-Play device driver factory, DM FAC
Figure 141 illustrates a Windows NT device driver factory, DM FAC
Figure 142 illustrates a VxD device driver factory, DM VXFAC
Figure 143 illustrates a device enumerator on registry, DM-REN
Figure 144 illustrates a PCI device enumerator, DM-PEN
Figure 145 illustrates a PCMCIA device enumerator, DM-PCEN
Figure 146 illustrates a singleton registrar, DM SGR
Figure 147 illustrates a device stacker, DM-DSTK
l0 Figure 148 illustrates a create/bind factory interface adapter, DM CBFAC
Figure 149 illustrates a usage of the DM CBFAC factory interface adapter Figure 150 illustrates an event to factory adapter, ZP-E2FAC
DETAILED DESCRIPTION OF THE INVENTION
The following definitions and references will assist the reader in comprehending the enclosed description of a preferred embodiment of the present invention.
The preferred embodiment is a software component object (part) that implements a dynamic container for other parts (hereinafter the Part Array or Array). The part is preferably used in conjunction with the method and system described in the '675 application.
The terms CIassMagic and DriverMagic, used throughout this document, refer to commercially available products incorporating the inventive System for Constructing Software Components and Systems as Assemblies of Independent Parts in general, and to certain implementations of that System. Moreover, an implementation of the System is described in the following product manuals:
~ "Reference - C Language Binding - CIassMagic~" Object Composition Engine", Object Dynamics Corporation, August 1998, which is incorporated herein in its entirety by reference;
~ "User Manual - User Manual, Tutorial and Part Library Reference -DriverMagic Rapid Driver Development Kit", Object Dynamics Corporation, 3o August 1998, which is incorporated herein in its entirety by reference;

~ "Advanced Part Library - Reference Manual", version 1.32, Object Dynamics Corporation, July 1999, which is incorporated herein in its entirety by reference;
~ "WDM Driver Part Library - Reference Manual", version 1.12, Object Dynamics Corporation, July 1999, which is incorporated herein in its entirety by reference;
~ "Windows NT Driver Part Library - Reference Manual", version 1.05, Object Dynamics Corporation, April 1999, which is incorporated herein in its entirety by reference.
Appendix 1 describes preferred interfaces used by the parts described herein.
Appendix 2 describes the preferred events used by the parts described herein.
1. Events One inventive aspect of the present invention is the ability to represent many of the interactions between different parts in a software system in a common, preferably polymorphic, way called event objects, or events.
Events provide a simple method for associating a data structure or a block of data, such as a received buffer or a network frame, with an object that identifies this structure, its contents, or an operation requested on it. Event objects can also identify the required distribution discipline for handling the event, ownership of the event object itself and the data structure associated with it, and other attributes that may simplify the processing of the event or its delivery to various parts of the system. Of particular significance is the fact that event objects defined as described above can be used to express notifications and requests that can be distributed and processed in an asynchronous fashion.
The word "event" is used herein most often in reference to either an event object or the act of passing of such object into or out of a part instance. Such passing preferably is done by invoking the "raise" operation defined by the I DRAIN
interface, with an event object as the operation data bus. The I DRAIN
interface is a standard interface as interfaces are described in the '675 application. It has only one operation, "raise", and is intended for use with event objects. A large portion of the parts described in this application are designed to operate on events.
Also in this sense, "sending an event" refers to a part invoking its output I
DRAIN
terminal and "receiving an event" refers to a part's I-DRAIN input terminal being invoked.
1.1. Event Objects l0 An event object is a memory object used to carry context data for requests and for notifications. An event object may also be created and destroyed in the context of a hardware interrupt and is the designated carrier for transferring data from interrupt sources into the normal flow of execution in systems based on the '675 system.
An event object preferably consists of a data buffer (referred to-as the event context data or event data) and the following "event fields":
~ event ID - an integer value that identifies the notification or the request.
~ size - the size (in bytes) of the event data buffer.
~ attributes - an integer bit-mask value that defines event attributes. Half of the bits in this field are standard attributes, which define whether the event is intended as a notification or as an asynchronous request and other characteristics related to the use of the event's memory buffer. The other half is reserved as event-specific and is defined differently for each different event (or group of events).
. status - this field is used with asynchronous requests and indicates the completion status of the request (see the Asynchronous Requests section below).
The data buffer pointer identifies the event object. Note that the "event fields" do not necessarily reside in the event data buffer, but are accessible by any part that has a pointer to the event data buffer.

The event objects are used as the operation data of the I_DRAIN interface's single operation - raise. This interface is intended for use with events and there are many parts described in this application that operate on events.
The following two sections describe the use of events for notifications and for asynchronous requests.
1.2. Notifications Notifications are "signals" that are generated by parts as an indication of a state change or the occurrence of an external event. The "recipient" of a notification is not expected to perform any specific action and is always expected to return an OK
l0 status, except if for some reason it refuses to assume responsibility for the ownership of the event object.
The events objects used to carry notifications are referred to as "self-owned"
events because the ownership of the event object travels with .it, that is, a part that receives a notification either frees it when it is no longer needed or forwards it to one of its outputs.
1.3. Asynchronous Requests Using event objects as asynchronous requests provides a uniform way for implementing an essential mechanism of communication between parts:
~ the normal interface operations through which parts interact are in essence function calls and are synchronous, that is, control is not returned to the part that requests the operation until it is completed and the completion status is conveyed to it as a return status from the call.
the asynchronous requests (as the name implies) are asynchronous; control is returned immediately to the part that issues the request, regardless of whether the request is actually completed or not. The requester is notified of the completion by a "callback", which takes a form of invoking an incoming operation on one of its terminals, typically, but not necessarily, the same terminal through which the original request was issued. The "callback"
operation is preferably invoked with a pointer to the original event object that contained the request itself. The "status" field of the event object conveys the completion status.
Many parts are designed to work with asynchronous requests. Note, however that most events originated by parts are not asynchronous requests - they are notifications or synchronous requests. The "event recoder" (DM ERC herein), in combination with other parts may be used to transform notifications into asynchronous requests.
The following special usage rules preferably apply to events that are used as asynchronous requests:
l0 1. Requests are used on a symmetrical bi-directional I DRAIN connection.
2. Requests may be completed either synchronously or asynchronously.
3. The originator of a request (the request 'owner') creates and owns the event object. No one except the 'owner' may destroy it or make any assumptions about its origin.
4. A special data field may be reserved in the request data buffer, referred to as "owner context" - this field is private to the owner of the request and may not be overwritten by recipients of the request.
5. A part that receives a request (through an I-DRAIN.raise operation) may:
a) Complete the request by returning any status except ST PENDING
(synchronous completion);
b) Retain a pointer to the event object and return ST-PENDING. This may be done only if the 'attr' field of the request has the CMEVT A ASYNC CPLT bit set. In this case, using the retained pointer to execute I-DRAIN.raise on the back channel of the terminal through which the original request was received completes the request. The part should store the completion status in the "status" event field and set the CMEVT A COMPLETED bit in the "attributes" field before completing the request in this manner.
6. A part that receives a request may re-use the request's data buffer to issue one or more requests through one of its I-DRAIN terminals, as long as this does not violate the rules specified above (i.e., the event object is not destroyed or the owner context overwritten and the request is eventually completed as specified above).
Since in most cases parts intended to process asynchronous requests may expect to receive any number of them and have to execute them on a first-come-first-served basis, such parts are typically assembled using desynchronizers which preferably provide a queue for the pending requests and take care of setting the "status"
field in the completed requests.
1.4. The notion of event as invocation of an interface operation It is important to note that in many important cases, the act of invoking a given l0 operation on an object interface, such as a v-table interface, can be considered an event to the large degree similar to events described above. This is especially true in the case of interfaces which are defined as bus-based interfaces; in such interfaces, data arguments provided to the operation, as well as, data returned by it, is exchanged by means of a data structure called bus. Typically, all operations of the same bus-based interface are defined to accept one and the same bus structure.
Combining an identifier of the operation being requested with the bus data structure is logically equivalent to defining an event object of the type described above. And, indeed, some of the inventive reusable parts described in this application use this mechanism to convert an arbitrary interface into a set of events or vice-versa.
The importance of this similarity between events and operations in bus-based interfaces becomes apparent when one considers that it allows the application of many of the parts, design patterns and mechanisms for handling, distributing, desynchronizing and otherwise processing flows of events, to any bus-based interface. In this manner, an outgoing interaction on a part that requires a specific bus-based interface can be distributed to multiple parts, desynchronized and processed in a different thread of execution, or even converted to an event object. In all such cases, the outgoing operation can be passed through an arbitrarily complex structure of parts that shape and direct the flow of events and delivered to one or more parts that actually implement the required operation of that interface, all through the use of reusable software parts.
2. Event Flow Parts Another inventive aspect of the present invention is the ability to use reusable parts to facilitate, control and direct flows of events in a particular application or system. The existence of such parts, herein called "event flow parts", provides numerous benefits. For example, it makes it possible to design and implement a wide variety of application-specific event flow structures simply by combining instances of reusable parts. In another example, one can implement advanced event flow l0 characteristics, such as distribution disciplines, one-to-many and many-to-one relationships, intelligent event distribution based on state, data contained in. the event, or status returned by a specific part, and many others, again, by interconnecting instances of reusable parts.
This section describes a number of inventive reusable event flow parts, which preferably form a basis for building most event flow structures in software systems and applications built using object composition.
2.1. Event Sources Event sources are parts that generate outgoing events spontaneously, as opposed to in response to receiving another event on an input. Usually, event sources generate output events in response to things that happen outside of the scope of the structure of parts in which they are connected.
Event sources preferably have a bidirectional terminal, through which they generate, or "fire", outgoing events and receive control events, preferably "enable"
and "disable". In addition, event sources preferably define properties through which their operation can be parameterized.
When assembled in a structure with other parts, an event source preferably remains inactive until it receives the first "enable" event from one of these parts.
After becoming enabled, the event source may (but not necessarily would) generate one or more outgoing events, which are used by other parts to perform their 3o operations. At some point in time or another, a part other than the source may generate a "disable" event. On receiving this event, the event source becomes disabled and does not generate outgoing events until enabled again. While practical in many cases, the ability to enable and disable the event source from outside is not required for the advantageous operation of this type of reusable parts.
Event sources vary primarily in the specific mechanism or cause which triggers the generation of outgoing events. For example, an interrupt event source, such as the DM-IRQ part described herein, receives hardware interrupts from a peripheral device and generates events for each received interrupt. In another example, a timer event source, such as the DM-EVT part described herein, creates an operating system timer object, and generates outgoing events when that timer expires or fires periodically.
Another type of the inventive event source is a part that controls an operating system or hardware-defined thread of execution and generates outgoing events in the execution context (e.g., stack, priority, security context, etc.), of that thread, so that other parts and structures of parts can operate within that context. An example of such thread event source is the DM EST part described herein.
As one skilled in the art to which the present invention pertains can easily see, many other types of the inventive event source parts can be defined and may be desirable in different classes of applications or different operating environments. For example, the DM_ESW event source described herein is an event source that is somewhat similar to a thread event source but generates outgoing events in the execution context associated with a specific operating system window object, as this term is defined by the Microsoft Windows family of operating systems. Another example, the DM_EVS event source described herein provides outgoing events in a context of a specific thread which it owns and then only upon completion of an "overlapped" operating system call or upon the signaling of a synchronization object, as those terms are defined in the Microsoft Windows family of operating systems.
In many cases, it may be beneficial to define different event sources, such as timer and thread, so that they have similar boundaries and interfaces, and may be interchanged in the design as required. However, this is a convenience and not necessarily a requirement.
Reusable event source parts have many advantages, among them the ability to insulate the rest of the application from an important class of operating system or hardware-dependent interactions, in which the outside environment invokes the application being designed. Another advantage of using these parts is to separate the creation and management of execution contexts, such as threads, as well as the definition of their characteristics, from the parts and structures of parts that operate in these contexts.
l0 2.2. Notifiers Notifiers are parts that can be inserted on a connection between two other parts without affecting the semantics of the interactions between those parts.
Notifiers monitor those interactions and generate an outgoing event whenever an interaction that satisfies a specific condition occurs.
Notifiers preferably have three terminals: "in", "out" and "nfy". The "in" and "out" terminals are used to connect the notifier to the parts whose interaction is to be monitored. The notifier generates outgoing events through the "nfy"
terminal.
Notifiers preferably define properties through which the notification conditions can be specified or modified, as well as properties that define the characteristics of the outgoing notification event.
When assembled in a structure of parts, a notifier accepts calls through its "in"
terminal, forwards them without modifications to the "out" terminal, and checks if the specified condition is satisfied by that interaction. If the condition is true, the notifier creates an event object as parameterized and sends it out through its "nfy"
terminal. Conditions monitored by notifiers preferably include the passing of an event object with specific characteristics, such as identifier, attributes, etc., return of a specific status code from the "out" terminal, or the value of a specific field in the data bus satisfying a specific expression. In addition, notifiers may generate the outgoing notification before, after or both before and after forwarding the incoming event or interaction to the "out" terminal.

An example of a notifier which monitors for a specific event identifier is the inventive DM-NFY part described herein. Another example of a notifier which monitors the return status of the interaction is the inventive DM_NFYS part described herein.
Another type of notifier is the idle generator. Unlike other types of notifiers, idle generators produce series of outgoing events, preferably until one of these events returns a pre-defined completion status. An example of this type is the inventive DM IEV part described herein.
As will be understood by those skilled in the art to which the present invention l0 pertains, many other types of the inventive notifier parts can be defined and may be desirable in different classes of applications or in different operating environments.
Reusable notifier parts have many advantages, among them the ability to cause the execution of one or more auxiliary functions when a certain interaction takes place, without either of the parts participating in that interaction being responsible for causing the execution, or even having to be aware that the execution takes place. In this manner, the inventive notifier parts described herein provide a universal mechanism for extending the functionality of a given structure of parts in a backward-compatible way, as well as for synchronizing the state of two or more parts or structures of parts in a way that does not introduce undue coupling between them.
2.3. Adapters Adapters are parts the primary function of which is to convert one interface, set of events or logical contract, into another. Adapters make it possible to combine the functionality of two parts that are not designed to work directly together.
Adapters preferably have two terminals, "in" and "out". The "in" terminal is used to receive incoming operations or events that belong to one of the interfaces;
in response to these operations or events, the adapter issues outgoing operations or events, that comply with the second interface through its "out" terminal.

Adapters preferably define properties through which their operation can be modified as needed by the specific interface translation that a given adapter implements.
Since the primary purpose of an adapter is to convert one interface into another, the number of possible and potentially useful adapter parts is virtually unlimited. One advantageous type of inventive adapters is an adapter that converts operations of any bus-based v-table interface into events. Examples of such adapters are the inventive parts DM P2D and DM NP2D described herein, as well as the DM D2P, DM_ND2P and DM-BD2P, which provide the opposite and combined conversions.
Another type of inventive adapters converts one set of events complying to a given protocol into another set, protocol or interface. Examples include the inventive parts DM A2K, DM-D1021RP, and DM-IES described herein. Yet another advantageous type of inventive adapters include adapters that modify selected characteristics of events that pass through them; an example of this type of adapter is the inventive part DM-ERC described herein. One other advantageous type of inventive adapter is an adapter that modifies the return status of an operation, such as the inventive part DM STX described herein.
Still another type of inventive adapter is the asynchronous completers. An asynchronous completer guarantees that certain requests received on its "in"
terminal will always complete asynchronously, even when the part connected to its "out"
terminal completes those requests in a synchronous manner. An example of an asynchronous completer is the inventive part DM ACT described herein.
Yet another type of inventive adapter is the string formatters that can modify a text string, such as a name or URL path, or any other data value, in a passing event or data bus, according to parameterization that defines a specific transformation expression. An example of this type of adapter is the inventive part DM SFMT-described herein.
Another, particularly important type of inventive adapter is the stateful adapters that maintain substantial state in between interactions and preferably implement state machines that provide complex conversions between widely differing protocols and interfaces. An example of this type of adapter is the inventive part DM
PLT
described herein.
2.4. Distributors Distributors are parts the main purpose of which is to forward, or distribute, interactions initiated by one part to zero or more other parts. Distributors make it easy to implement structures of parts which require interactions that cannot be represented directly by simple one-to-one connections between terminals; such interactions include one-to-many, many-to-one and many-to-many relationships.
Most types of distributors preferably have three terminals: "in", "out1 " and l0 "out2". They receive incoming interactions on their "in" terminal and forward them to "out1 ", "out2" or both "outl " and "out2", according to a specific distribution discipline. This group includes the following types of distributors: la) distributors for service, (b) event replicators, (c) sequencers, (d) filters, (e) bidirectional splitters, and (f) interface splitters.
Some other types of distributors preferably have an additional control terminal or property used to modify the distribution discipline they apply. This group includes the following types of distributors: (a) multiplexers controlled by event and (b) switches controlled by property value.
Yet other types of distributors preferably have two terminals: an "in"
terminal through which they receive interactions, and a multiple cardinality "out"
terminal.
These types of distributors preferably distribute interactions received on their "in"
terminal among different connections established on their "out" terminal. This group includes connection multiplexers and connection demultiplexers.
Other types of distributors preferably have one multiple cardinality, bi-directional terminal, to which other parts are connected. These types of distributors, called buses, accept incoming interactions on any of the connections to that terminal, and distribute them among the same set of connections.
As will be understood by those skilled in the art to which the present invention pertains, many other types of the inventive distributor parts can be defined and may be desirable in different classes of applications or in different operating environments.

The section below describes the preferred distribution disciplines for a variety of distributor types.
Buses are distributors that implement many-to-many connections. They accept events from any of the parts connected to them, and forward them to all other parts, preferably excluding the one that originated that event. An example of a bus distributor is the inventive part DM_EVB described herein.
Distributors for service attempt to submit the incoming interaction to both outputs, in sequence, until a certain condition, preferably related to the status returned from one or both of those outputs, is met. When assembled in structures of parts, distributors for service can be used for a variety of purposes, including, for example: (a) to sequence one and the same operation between multiple parts, (b) to submit the operation to several parts until one of them agrees to execute it, and (c) to submit an operation to one part and then, based on the status returned by it, to conditionally submit the same operation to another part. An example of a distributor for service is the inventive part DM_DSV described herein.
Event replicators are distributors that make a copy of an incoming event or operation bus and submit this copy to its "out2" output either before or after forwarding the original event or operation to "out1 ". An example of an event replicator is the inventive part DM_RPL described herein.
Sequencers are a type of distributor that sequence an incoming operation between their outputs until a certain return status is received, and preferably have the ability to sequence a different operation in reverse order. One advantageous use of sequencers is to enable a structure of parts, with the ability to disable back any already enabled part in case one of the parts fails the enable request. This guarantees that the state of all these parts will be coherent: either enabled or disabled. Examples of sequencers are the inventive parts DM_SEO., DM SEAT and DM-LFS described herein.
Multiplexers, also known as switches, are a type of distributor that maintain state and forward incoming interactions to one of their outputs depending on that state.
This controlling state can be changed preferably by an event received on a control terminal of the multiplexes, or by setting a specific value in a property of the multiplexes. Examples of multiplexers are the inventive parts DM MUX, ZP SWP
and ZP SWPB described herein.
Connection multiplexers and demultiplexers are a type of distributor that forward incoming interactions to one of the many possible connections on their "out"
terminal and vice-versa. Connection demultiplexers may preferably implement a variety of distribution disciplines, including, for example, (a) by data value in the incoming bus which identifies the outgoing connection and Ib) by state controlled in a manner similar to regular multiplexers described above. Connection multiplexers may preferably store an identification of the connection from which the incoming interaction arrives into a specified data field in the bus before forwarding the interaction to the output. Examples of connection multiplexers and demultiplexers are the inventive parts DM CDM, DM CDMB and ZP CMX described herein.
Filters are a type of distributors that forward incoming interactions to "out1 " or "out2" based on a data value contained in the bus or on characteristics of the event object or the incoming operation. The conditions and/or expression that a filter evaluates to decide which output to use are preferably specified through properties defined by the filter. Examples of filters are the inventive parts DM SPL, DM-BFL, DM IFLT, DM IFLTB, DM SFLT, DM SFLT4 and DM IRPFLT described herein.
Bi-directional splitters are a type of distributor that preferably have three terminals: an input "in", an output "out" and a bidirectional terminal "bi".
These distributors forward operations received on their "in" terminal to their "bi"
terminal, and forward operations received on their "bi" terminal to their "out"
terminal. In this manner, bi-directional splitters distribute the flow of interactions through a single, "bi", terminal into two separate unidirectional flows that can be forwarded to two separate parts. An example of a bi-directional splitter is the inventive part DM_BSP
described herein.
Interface splitters are a type of distributor that forward different operations of one and the same input interface to different outputs. In this manner, interface splitters allow a set of operations defined by a single interface to be implemented by a plurality of parts. An example of an interface splitter is the inventive part DM DIS
described herein.
2.5. Terminators Terminators are parts that can be connected to those outputs of other parts which have no meaningful use within a specific design, so that outgoing interactions through those outputs do not cause malfunction or disruption of the operation of the system and preferably provide a specific, pre-defined response to such outgoing operations.
Terminators preferably have one terminal, "in", implemented either as an input 1o terminal or as a bi-directional terminal. In addition, terminators preferably define a property through which the desired return status can be parameterized.
Upon receiving an incoming event, a terminator preferably examines the event attributes, determines if the event object is to be destroyed and the associated data structure is to be freed, and returns the specified return status.
Examples of terminators include the inventive parts DM STP, DM BST, DM PST, DM PBS, DM UST and DM DST described herein.
2.6. Event Consolidators Event consolidators are parts that provide "reference counting" behavior on a pair of complementary events, for example, "open" and "close".
An event consolidator allows the first "open" event to pass through, and consumes and counts any additional "open" events it receives. In addition, it counts and consumes any "close" events until their number reaches the number of "open"
events. The last "close" event is passed through.
Examples of event consolidators include the inventive parts DM ECS and DM ECSB described herein.
2.7. Indicators Indicators are parts that can be inserted on a given connection between other parts without affecting the semantics of that connection, and provide observable indications of the interactions that transpire between those other parts, preferably in the form of human-readable output or debug notifications. The format of the output is preferably specified in properties defined by the indicator.
Examples of indicators include the inventive parts DM IND, DM CTR and DM BSD described herein.
3. Synchronization Parts 3.1. Desynchronizers Desynchronizers are parts that decouple the flow of control from the data flow. A
simple desynchronizer preferably has input and output terminals that work on the same logical contract, and a queue.
Whenever it receives an input operation, the desynchronizer preferably collects the data arguments into a descriptor, or control block, enqueues the descriptor and returns immediately to the caller. On a separate driving event, such as a timer, a thread or a system idle event, the desynchronizer reads a descriptor from the head of the queue and invokes the respective operation on its output.
We define two categories of simple desynchronizers, with and without external drive, based on how (and when) they receive the driving events.
Desynchronizers with external drive define a separate terminal through which another part, preferably an event source, may feed the events. The others arrange to receive the events internally, using operating-system services such as timer callbacks or messages, or even hardware interrupts.
Desynchronizers can be inserted in most connections where the data flow is unidirectional. The other parties in the connection do not have to support explicitly asynchronous connections - they remain unaware of the fact that the connections have been made asynchronous.
Examples of desynchronizers include the inventive parts DM_FDSY, DM-DSY, DM DSYR, DM DWI, DM DWI2, DM DWT, DM DOT, DM DWP, DM DOP, DM DWW, DM DOW, and DM RDWT described herein.
3.2. Resynchronizers Resynchronizers are parts that split a contract with bi-directional data flow into two - requests and replies. They are preferably used to keep their clients blocked on an operation while allowing the ultimate server connected to their output to perform operations in an event-driven manner for many clients. The resynchronizer is responsible for blocking the incoming calls, for example using operating system provided facilities in multi-threaded environments, until a reply for each respective call arrives.
Typical uses for resynchronizers include, for example, cases when the client part is a wrapper for a legacy component that implements lengthy operations, which involve issuing many outgoing calls. Using the resynchronizer, one can prevent such a part from blocking the system or the server without having to make changes ~in l0 either of them.
Examples of resynchronizers include the inventive parts DM RSY and DM RSYB
described herein.
3.3. Event Buffers Event buffers are parts that forward incoming events and interactions and also have memory to store one or more events or other incoming interactions whenever they cannot be forwarded immediately. These parts make it possible to disable the flow of interaction between other parts temporarily without losing events that occur while the flow is disabled. Once the flow is re-enabled, the stored events and preferably any new incoming events are forwarded as usual.
Event buffers preferably have three terminals: an input "in", an output "out"
and a control input "ctl". Incoming events arrive on the "in" terminal. If the buffer is enabled, it simply forwards the incoming event to the "out" terminal. If the buffer is disabled, is stores the incoming event. The buffer is preferably enabled and disabled through the "ctl" terminal. Any events that are stored while the buffer is disabled are preferably forwarded to the "out" terminal whenever the buffer is re-enabled, or on another appropriate event.
One type of event buffers has a queue or other means for storing incoming events when the event buffer is disabled and then forwarding them out in the same order in which they arrived. Examples of this type of event buffers are the inventive parts 3o DM SEB, DM ASB, DM ASBR and DM ASBR2 described herein.

Another type of event buffers also has the ability to temporarily store, or "postpone", particular events that are rejected by parts connected to their "out"
terminal while the buffer is enabled, and attempt to forward them again at a later time. These buffers preferably forward any incoming events through their "out"
terminal, and preferably interpret certain return statuses as an indication that the recipient is rejecting the event at that time. The buffers preferably store rejected events until they receive a "flush" event on their "ctl" terminal and attempt to resubmit them at that time. An example of this type of event buffers is the inventive part DM SEBP described herein.
l0 Event buffers preferably have properties for configuring the maximum number of stored events, the criteria for enabling and disabling the flow, and other purposes.
One skilled in the art to which the present invention pertains can easily see many other types of advantageous event buffers, including, but not limited to, buffers without a control input or different control mechanism, buffers with different storage mechanisms, buffers with different conditions for buffering incoming events, and so on.
Event buffers make it possible to disable temporarily the flow of events on a given connection and accumulate certain or all incoming events, so that other parts or structures of parts are not forced to process these events when it is not desirable to do so.
3.4. Event Serializers Event serializers are parts that forward incoming interactions one by one and have means to hold further incoming interactions until any pending interaction completes.
Event serializers preferably have an input terminal "in" for receiving incoming events or interactions, an output terminal "out" for forwarding previously received events, and a state for tracking whether an interaction that has been forwarded to "out" has not yet completed. If no interaction is pending, the serializer forwards an incoming interaction directly; while an interaction is pending, the serializer holds all other incoming events or interactions, for example, by storing them in memory or by blocking the calling thread, until the pending interaction completes.

Examples of event serializers include the inventive parts DM ESL, DM RSL and DM-EPP described herein. One skilled in the art to which the present invention pertains can easily see many other types of event serializers, for example, ones that use different mechanisms for storing held interactions, and ones that use critical sections or other synchronization objects to hold the calling thread.
Since event serializers pass incoming interactions one at a time, parts connected to their output do not have to accept or handle multiple interactions concurrently.
4. Property Space Support Parts Another inventive aspect of the present invention is a set of reusable parts that inspect, store and manipulate properties of other parts and structures of parts through interfaces. These parts make it possible to construct functionality needed to access properties by interconnecting existing parts rather than writing code.
It also makes it possible to set up the properties of a given part, component or even whole application to pre-configured values read from storage, as well as to preserve and restore the persistent state of that part, component or application.
4.1. Property Exposers Property exposers are parts that provide access to properties of other parts through a terminal. They make it possible to construct functionality that manipulates those properties by interconnecting parts.
Property exposers preferably have an input terminal "prop", that exposes an interface or a set of events for requesting property operations, such as get, set, check, enumerate, etc.
A property exposer preferably implements the functionality required by the interface exposed through the "prop" terminal using means defined by the underlying component or object model, such as the '675 system.
One type of property exposer provides access to the property space of an assembly in which the instance of the property exposer is created. An example of this type of property exposer is the inventive part DM_PEX described herein.
Other advantageous property exposers will be apparent to those skilled in the art to which the present invention pertains. By way of example, a property exposer may be configured with information sufficient to identify a specific part instance, the properties of which it is to expose.
4.2. Property Containers Property containers are parts that have storage for one or more properties and their respective values and make these properties available for access through an interface. They allow other parts to store and examine various sets of properties.
Property containers preferably support arbitrary sets of properties and preferably include means for configuring those sets of properties. These means include, without limitation, properties on the property container itself, interfaces for defining the set of properties, data descriptors, etc.
One type of property container allows definition of the set of stored properties through a terminal. This type of property container preferably has two terminals: a property factory "fac" for creating and destroying properties in the container, and a property access terminal "prp" for accessing property values and enumerating the current set of properties in the container. An example of this type of property container is the inventive part DM VPC described herein.
One skilled in the art to which the present invention pertains will recognize that other advantageous types of property containers are possible and easy to define. For example, a property container may provide access to the contained set of properties through any mechanism used to access properties of parts. Note that the inventive part DM ARR described herein can also be used in this capacity.
4.3. Parameterizers Parameterizers are parts that have means for obtaining a set of property identifiers and values from storage and requesting property set operations requests using those identifiers and values on their output terminal. When combined preferably with a property exposer or other similar part, parameterizers can be used to configure a part or a structure of parts to operate in some desired way or to restore a previously saved persistent state.
One type of parameterizer has an input terminal "in" for receiving, and an output terminal "out", for forwarding requests for property operations, as well as means for obtaining a set of property identifiers and values from outside storage, such as registry, file or other media.
This type of parameterizer can process a property set request received on its "in"
terminal with a specific property identifier by treating the value received with that request as a key that can be used to identify a location in the outside storage, e.g., file name, memory location, registry key, etc. Upon receiving such trigger request, the parameterizer accesses that location to obtain one or more property identifiers and their corresponding values from the storage, and emits property set operations on its "out" terminal, with those identifiers and values. An example of this type of parameterizer is the inventive part DM_PRM described herein.
4.4. Serializers Serializers are parts that obtain a set of properties that are designated as persistent and-save them and their values into a storage. Serializers, in conjunction with property exposers, make it possible to save an arbitrarily defined set of properties into external storage, so that these properties can be restored later, preferably through the use of a parameterizer. The set of properties to be stored is defined by the part or structure of parts whose properties are being serialized.
One type of serializes has an input terminal on which it accepts a request to commence serialization, and an output terminal, through which it collects the set of properties to be serialized. This type of serializes preferably uses persistent storage to save the collected properties and values; such persistent storage is preferably a file or a non-volatile memory. An example of this type of serializes is the inventive part DM SER described herein.
4.5. Property Interface Adapters Property interface adapters are parts that convert some interface into a property interface or vice-versa.
Property interface adapters preferably have two terminals: "in" and "out". A
property interface is preferably the I A_PROP interface described herein.
One type of property interface adapter converts one or more events into respective property operations and vice-versa. Property interface adapters make it easy to use events to manipulate properties. Examples of this type of property interface adapter include the inventive parts DM P2E and DM E2P described herein.
One other type of property interface adapter preferably has one or more properties for providing information that is missing from the incoming request but needs to be provided on the output request or vice-versa. Example of this type of property interface adapter include the inventive parts DM PSET and DM_PSETB.
Yet another type of property interface adapters may add advanced functionality.
Examples include filtering out enumerated properties by some template, replacing the identifiers of properties through a translation table, converting property types to achieve type compatibility, and many others.
5. Dynamic Container for Parts Dynamic containers for parts (hereinafter often referred as "part array"
without implication on how the parts are stored or accessed in the container) are parts that preferably have memory for one or more contained parts or references to those parts, and are capable of presenting the set of contained parts as a single part, the container itself. This allows structures of parts to contain dynamically changing subsets of those parts while still being able to describe the structure in a static way.
An example of a dynamic container for parts is the inventive part DM ARR
described herein.
6. Dynamic Structure Support Parts Dynamic structure support parts make it easy to build functionality for manipulating a dynamically determined set of part instances. They are reusable parts that make it easy to assemble structures of parts that contain such a dynamically determined set of instances.
6.1. Factories Factories are parts that initiate the creation and other preparations for normal operation of dynamically created instances of parts.
Factories preferably have at least two terminals: an "in" input for receiving events or other interactions on which the factory will initiate a creation of one or more new instances, and a "fact" output for requesting that a new instance is created or otherwise added into a container connected to the "fact" output.
Factories preferably have another terminal, "out" for forwarding the requests received on "in". Factories may have additional terminals, such as terminals for parameterizing newly created instances, terminals for enumerating a set of instances to be created, for providing requests to one or more of the dynamic instances, and others. Factories preferably can be configured with an identifier of a part class from which the new instances will be created.
6.2. Enumerators Enumerators are parts that determine what part instances need to be created in a dynamic set of part instances. Enumerators preferably have an "in" terminal for providing information about the dynamic set of parts to be created and means for determining what that set is.
Enumerators may also have an additional terminal, such as a terminal for providing a set of properties to be configured on the dynamically created instances.
Examples of enumerators include the inventive parts DM_REN, DM-PEN and DM PCEN described herein.
6.3. Registrars Registrars are parts that register part instances with some registry.
Registrars preferably have a property for specifying an identifier with which a part instance will be registered. One type of registrar registers the instance of the assembly in which it is contained so that this instance can be used by reference in other assemblies. An example of this type of registrar is the inventive part DM_SGR
described herein.
Registrars of another type preferably have two properties: "id" for specifying an identifier to register, and "interface" for specifying means for accessing a part instance. Such means may include function pointer, identifier of object through which a part instance can be accessed, etc. An example of this type of registrar is the inventive part DM-DSTK described herein.

6.4. Loaders Loaders are parts that cause part classes to become available for creation of instances when such instances are needed.
One type of loader preferably has two terminals: an "in" terminal of type I A_FACT for receiving instance creation requests and an "out" terminal for forwarding requests received on "in". Loaders of this type monitor creation requests received on "in" and, when necessary, load the appropriate module that contains at least the part class an instance of which is being requested, before forwarding the creation request to "out".
An example of this type of loader is the inventive part DM-LDR described herein.
Other advantageous types of loaders may use different mechanisms to determine when a part class needs to be loaded, or may perform different operation to cause the part class to become usable or better to use. Such operations may include relocation in memory, bringing the part class code into faster memory, etc.
Such and other variations of loaders will be apparent to those skilled in the art to which the present invention pertains.
6.5. Factory Interface Adapters Factory interface adapters are parts that convert some interface into a factory interface or vice-versa. A factory interface is preferably an interface similar to the I A FACT interface described herein.
Factory interface adapters have at least two terminals: an "in" terminal for receiving requests or events and an "out" terminal for sending outgoing events or requests. Preferably, at least one of the terminals supports the factory interface.
One type of factory interface adapter is a part that makes it convenient to use events to initiate factory interface operations. This type of adapter preferably has its "in" terminal for receiving events and its "out" terminal for requesting factory operations; it may also have properties for configuring what events cause what factory operations and additional information that is needed to perform the factory operation, such as a class identifier. An example of this type of factory interface adapter is the inventive part ZP-E2FAC described herein.

Another type of factory interface adapter has both the "in" and "out" terminal supporting the factory interface and providing advanced functionality on the factory requests. An example of such an adapter is the inventive part DM CBFAC
described herein.
Event Flow Parts Details Event sources DM EST - Event Source by Thread Fig. 1 illustrates the boundary of the inventive DM_EST part.
DM EST is an event source that generates both singular and periodic events for a l0 part connected to its evs terminal. DM_EST is armed and disarmed via input operations on its evs terminal and generates events by invoking the fire output operation on the same terminal. A user-defined context is passed to DM-EST
when armed and is passed back in the fire operation call when the time out period expires.
DM EST allows itself to be armed only once. If DM EST has not been armed to generate periodic events, it may be re-armed successfully as soon as the event is generated; this includes being re-armed while in the context of the fire operation call.
DM EST may be disarmed at any time. Once disarmed, DM-EST will never invoke the fire operation on evs until it is re-armed. The context passed to DM EST
when disarming it must match the context that was passed with the arm operation.
DM EST may be parameterized with default values to use when generating events and flags that control the use of the defaults and whether or not DM_EST
automatically arms itself when activated. These properties can significantly simplify the use of DM EST in that it is possible to simply connect to and activate DM-EST to obtain a source of events.
1. Boundary 1.1. Terminals Terminal "evs" with direction "Bidir" and contract In: I EVS Out: I_EVS_R.
Note:
Synchronous, v-table, cardinality 1 Used to arm and disarm the event source on the input and also to send the event on the output when the time period expires.

1.2. Events and notifications DM-EST has no incoming or outgoing events. The "event" generated by DM EST
is a fire operation call defined in I-EVS-R; it is not an event or notification passed via an I DRAIN interface.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "force defaults" of type "UINT32". Note: Boolean. If TRUE, the time and continuous properties override the values passed in the I-EVS bus. Default is FALSE.
Property "auto arm" of type "UINT32". Note: Boolean. If TRUE, DM-EST will automatically arm itself on activation. DM-EST will return CMST-REFUSE on any evs.arm calls. The force defaults property must be set to TRUE for this property to be valid. If not, DM EST will fail its activation. Default is FALSE.
Property "thread-priority" of type "UINT32". Note: Thread priority of DM-EST's worker thread. Default is THREAD PRIORITY NORMAL.
Property "time" of type "SINT32". Note: Default time period in milliseconds.
Valid range is 1 - Ox7fffffff. When this time period expires (after DM EST is armed), DM EST will fire an event (by calling evs.firel. Default is -1.
Property "continuous" of type "UINT32". Note: Boolean. If TRUE and DM_EST is armed, generate periodic events until disarmed. Default is TRUE.
2. Encapsulated interactions DM EST uses the following NT Kernel Mode APIs to control event objects and its worker thread:
~ KelnitializeEventl) ~ KeSetEventl) ~ KeCIearEvent() ~ PsCreateSystemThreadl) ~ PsTerminateSystemThread() ~ KeDelayExecutionThreadl) ~ KeWaitForSingleObjectl) ~ KeWaitForMuItiple0bjectsl) DM-EST uses the following Windows 95 Kernel Mode APIs to control event objects and its worker thread:
~ HeapAllocatel) ~ HeapFreel) ~ SignaIID() ~ BIockOnID() ~ Get System Time/) ~ Time Slice Sleepl) ~ VWIN32-CreateRingOThread() ~ Set Thread Win32 Pri() ~ Set Async Time Outl) ~ Create Semaphorel) ~ Destroy Semaphorel) ~ Signal_Semaphore No Switch() ~ Wait Semaphore() 3. Responsibilities 1 . When armed with a time period, generate timer events by calling evs.fire.
2. Generate either one-shot timer events that require arming for each or periodic timer events that require a single arm operation.
3. Allow the re-arming/disarming of the event source while in the context of a evs.fire call.
4. Allow disarming of single or periodic timer events. No events are to be sent out evs.fire at any time while DM EST is disarmed (even if periodic timer events are pending).
4. Theory of operation 4.1. Mechanisms Using a separate thread for armldisarm requests DM EST uses a separate thread to arm/disarm the event source. The thread waits for an arm or disarm request and acts appropriately. DM-EST uses events to synchronize the execution and termination of the thread. Each instance of DM
EST
maintains its own thread.
Arming the event source When an arm request arrives (within the execution context of a part using DM_EST) the thread created by DM_EST is awakened and begins waiting for the specified time period to expire using KeDelayExecutionThread(1. When the time period has expired the thread will fire an event through the evs terminal.
The event source may be re-armed while in the execution context of a fire event.
Upon return from the fire event, the thread will re-arm the event source with the parameters passed with the arm request.
Note that arm requests fail with CMST_REFUSE if DM EST was parameterized to generate periodic events (continuous property is TRUE).
Disarming the event source When a disarm request arrives (within the execution context of a part using DM EST), the thread will disarm the event source (if armedl. The event source will not fire again until it is re-armed.
The event source may be disarmed while in the execution context of a fire event.
Upon return from the fire event, the thread will disarm the event source canceling any previous arm requests. The event source will not fire again until it is re-armed.
Deactivation/Destruction of DM EST
When the event source is destroyed, DM-EST waits for the worker thread to terminate. DM EST will then free its resources and will not fire again until it is created, activated and armed.
DM EST may be deactivated while in the execution context of a fire event.
4.2. Use Cases Using the event source as a one-shot timer 1 . DM EST and Part A are created.
2. Part A connects its evs terminal to DM EST's evs terminal.
3. Both parts are activated.
4. Part A arms DM EST passing a time period and a context.

5. At some later point, the time period expires.
6. DM_EST's worker thread calls Part A's fire operation through its evs terminal passing the status CMST OK and the context associated with the event (passed with the arm request).
7. Part A does one of the following:
a. re-arms the event source - the event source is armed and will fire again when appropriate b. continues execution - the event source is disarmed and will not fire again until Part A re-arms it at a later time Using the event source as a periodic timer 1. DM EST and Part A are created.
2. Part A connects its evs terminal to DM EST's evs terminal.
3. DM EST is parameterized with the following:
a. force defaults is TRUE
b. auto arm is FALSE
c. time is set to some time interval for each event d. continuous is TRUE
4. Both parts are activated.
5. Part A arms DM EST passing a context.
6. At some later point, the time period expires.
7. DM EST's worker thread calls Part A's fire operation through its evs terminal passing the status CMST OK and the context associated with the event~(passed with the arm request).
8. Part A does one of the following:
c. disarms the event source - the event source is disarmed and will not fire again until Part A re-arms it at a later time d. continues execution - the event source will re-arm itself and will fire again at a later time 9. If the fire delay property is not zero, DM EST sleeps for fire delay 3o milliseconds before arming itself again for the next fire event.

lO.Steps 6-8 are executed many times as long as the event source remains armed.

Auto-arming the event source 1. DM EST and Part A are created.

2. Part A connects its evs terminal to DM EST's evs terminal.

3. DM EST is parameterized with the following:

a. force defaults is TRUE

b. auto arm is TRUE

c. time is set to some time interval for each event l0 d. continuous is TRUE

4. Both parts are activated.

5. At some later point, the time period expires.

6. DM EST's worker thread calls Part A's fire operation through its evs terminal passing the status CMST OK.

7. Part A does one of the following:

a. disarms the event source - the event source is disarmed and will not fire again until Part A re-arms it at a later time b. continues execution - the event source will re-arm itself and will fire again at a later time 8. Steps 5-7 are executed many times as long as the event source remains armed.

Disarm event source to terminate firing 1. DM EST and Part A are created.

2. Part A connects its evs terminal to DM EST's evs terminal.

3. Both parts are activated.

4. Part A arms DM EST passing a time period and a context.

5. At some later point before the time period expires Part A disarms the event source.
6. The event source is disarmed and will not fire again until it is re-armed.

Deactivation/Destruction of DM EST while the event source is armed 1. DM EST and Part A are created.
2. Part A connects its evs terminal to DM EST's evs terminal.
3. Both parts are activated.
4. Part A arms DM-EST passing a time period and a context.
5. At some later point before the time period has expired, DM EST is deactivated (not necessarily by Part A1.
6. DM_EST signals the worker thread to stop waiting for the specified time period to expire.
7. DM EST waits for its worker thread to terminate and releases all its resources.
8. DM EST is destroyed.
DM EVS - Event Source (thread-basedl Fig. 2 illustrates the boundary of the inventive DM EVS part.
DM EVS is a generator of single and periodical events. DM EVS uses a conjoint (bi-directional) interfaces I-EVS, output: I EVS-R for the purpose of arming, disarming and firing events. Parts connected to the evs terminal must implement the I EVS R interface in order to receive events from the event source.
The event source uses a separate thread to handle the arm and disarm requests.
Each instance of the event source maintains its own thread. When the event source fires, it is always within the execution context of this thread.
The event source is armed by invoking the arm operation on its evs terminal.
DM EVS can be armed with a Win32 synchronization object and/or a timeout period (e.g. a timer can be specified by passing a NULL object handle and a timeout period). When the synchronization object moves into a signaled state or the timeout period expires, the event source will invoke the fire operation through the evs terminal 11 EVS R). A status is passed with the fire event that describes why the event source fired.

A 32-bit context value must be passed with the arm request in order to identify the fire event. When the fire operation is invoked on the part connected to the evs terminal, this context is passed with the event.
The event source may be armed, disarmed or deactivated at any time (including within the execution context of a fire event). Once the event source is disarmed, it will not fire again until it is re-armed at a later time.
The event source may only be armed once. If the event source is armed more then once, DM_EVS returns CMST_NO-ROOM. The event source may be re-armed after it was disarmed or after the event source fired.
1o This part is available only Win32 User Mode environment.
5. Boundary 5.1. Terminals Terminal "evs" with direction "Bidir" and contract In: I EVS
Out:l EVS R. Note: v-table, single cardinality, synchronous This terminal is used to arm and disarm the event source. DM EVS also uses evs to send an event when a synchronization object is signaled or a timeout occurs.
5.2. Events and notifications None.
5.3. Special events, frames, commands or verbs None.
5.4. Properties Property "sync-lifecycle" of type "BOOL". Note: If TRUE DM-EVS waits for its worker thread to terminate on deactivation. Default is TRUE.
Property "sync tout" of type "SINT32". Note: This is the timeout period used when DM EVS is waiting for its worker thread to terminate; used only if sync_lifecycle is TRUE. Specified in milliseconds. Default is 1000 11 second).
6. Responsibilities 1. Support event generation (firing) when a synchronization object gets signaled or a timeout period expires upon arrival.
2. Support disarming the event source once it is armed.

3. Support re-arming the event source in the execution context of a fire event.
7. Theory of operation 7.1. Main data structures None.
7.2. Mechanisms Using a separate thread for armldisarm reguests DM EVS uses a separate thread to arm/disarm the event source. The thread waits for an arm or disarm request and acts appropriately. Each instance of DM_EVS
maintains its own thread.
l0 Arming the event source: within client execution context When an arm request arrives (within the execution context of a part using DM EVS) the thread created by DM-EVS is awakened and begins waiting on the synchronization object that was specified with the arm request. When either the timeout is reached or the synchronization object is signaled, the thread will fire an event through the evs terminal.
Arming the event source: within "fire" execution context The event source may be armed while in the execution context of a fire event.
Upon return from the fire event, the thread will re-arm the event source with the parameters passed with the arm request.
Disarming the event source: within client execution context When a disarm request arrives (within the execution context of a part using DM EVS), the thread will disarm the event source (if armed). The event source will not fire again until it is re-armed.
Disarming the event source: within ' fire execution context The event source may be disarmed while in the execution context of a fire event.
Upon return from the fire event, the thread will disarm the event source canceling any previous arm requests. The event source will not fire again until it is re-armed.

Deactivation of DM EVS: within client execution context When the event source is deactivated, if the sync lifecycle property is TRUE, DM EVS will wait for the worker thread to terminate. DM-EVS will then free its resources and will not fire again until it is re-activated and re-armed.
If DM EVS is deactivated while armed, DM EVS will fire an event with the status CMST CLEANUP in addition to the steps mentioned above.
Deactivation of DM EVS: within "fire" execution context The event source can be deactivated while in the execution context of a fire event. This should be avoided; the event source can not properly cleanup its l0 resources in this case. The event source will print a message to the debug console and signal the worker thread to destroy iteself.
7.3. Use Cases Arming: synchronization object signaled 1. DM EVS and Part A are created.
2. Part A connects its evs terminal to DM-EVS's evs terminal.
3. Both parts are activated.
4. Part A creates an event synchronization object.
5. Part A arms DM EVS passing the event object, a timeout period and a context associated with the event object.
6. At some later point, the event object becomes signaled.
7. DM EVS's worker thread calls Part A's fire operation through its evs terminal passing the status CMST OK and the context associated with the event object (passed with the arm requestl.
8. Part A does one of the following:
a. re-arms the event source - the event source is armed and will fire again when appropriate b. continues execution - the event source is disarmed and will not fire again until Part A re-arms it Arming: synchronization object already in signaled state 1 . DM EVS and Part A are created.

2. Part A connects its evs terminal to DM EVS's evs terminal.
3. Both parts are activated.
4. Part A creates an event synchronization object.
5. The event synchronization object enters a signaled state.
6. Part A arms DM EVS passing the event object, a timeout period and a context associated with the event object.
7. Immediately, DM_EVS's worker thread calls Part A's fire operation through its evs terminal passing the status CMST OK and the context associated with the event object (passed with the arm request).
8. Part A does one of the following:
c. re-arms the event source - the event source is armed and will fire again when appropriate d. continues execution - the event source is disarmed and will not fire again until Part A re-arms it Arming: NULL synchronization object 1. DM EVS and Part A are created.
2. Part A connects its evs terminal to DM EVS's evs terminal.
3. Both parts are activated.
4. Part A arms DM EVS passing a NULL object, a timeout period and a context associated with the NULL object.
5. At some later point, the timeout period expires.
6. DM EVS's worker thread calls Part A's fire operation through its evs terminal passing the status CMST TIMEOUT and the context associated with the NULL object (passed with the arm request) 7. Part A does one of the following:
e. re-arms the event source - the event source is armed and will fire again when appropriate f. continues execution - the event source is disarmed and will not 3o fire again until Part A re-arms it Arming: timeout period on s ynchronization object expired 8. DM EVS and Part A are created.
9. Part A connects its evs terminal to DM EVS's evs terminal.
10. Both parts are activated.
1 1 . Part A creates an event synchronization object.
12. Part A arms DM EVS passing the event object, a timeout period and a context associated with the event object.
13.At some later point, the timeout period expires (the synchronization object never was signaled).
14. DM EVS's worker thread calls Part A's fire operation through its evs terminal passing the status CMST TIMEOUT and the context associated with the synchronization object (passed with the arm request).
15. Part A does one of the following:
g. re-arms the event source - the event source is armed and will fire again when appropriate h. continues execution - the event source is disarmed and will not fire again until Part A re-arms it Arm event source: sync. object owner thread terminates 1. DM EVS and Part A are created.
2. Part A connects its evs terminal to DM EVS's evs terminal.
3. Both parts are activated.
4. Part A creates a thread that creates a mutex synchronization object.
5. Part A's thread arms DM EVS passing the mutex object, a timeout period and a context associated with the mutex object.
6. At some later point, the thread that owns the mutex terminates.
7. DM EVS's worker thread calls Part A's fire operation through its evs terminal passing the status CMST CANCELED and the context associated with the synchronization object (passed with the arm request).

Disarm event source to terminate firing 7. DM EVS and Part A are created.
8. Part A connects its evs terminal to DM EVS's evs terminal.
9. Both parts are activated.
10. Part A creates an event synchronization object.
1 1. Part A arms DM EVS passing the event object, a timeout period and a context associated with the event object.
12.At some later point before the event object is signaled and before the timeout period has expired, Part A disarms the event source.
l3.The event source is disarmed and will not fire again until it is re-armed.
Deactivation of DM EVS while the event source is armed 9. DM EVS and Part A are created.
10. Part A connects its evs terminal to DM EVS's evs terminal.
1 1 . Both parts are activated.
12. Part A creates an event synchronization object.
13. Part A arms DM_EVS passing the event object, a timeout period and a context associated with the event object.
14.At some later point before the event object is signaled and before the timeout has expired, DM-EVS is deactivated (not necessarily by Part A).
15. DM-EVS signals the worker thread to stop waiting on the event object.
16. DM EVS's worker thread calls Part A's fire operation through its evs terminal passing the status CMST CLEANUP and the context associated with the event object (passed with the arm request).
17.1f the deactivation was in the execution context of a fire event, DM EVS prints a message to the debug console and becomes deactivated without any cleanup.
18.1f the deactivation was in any other execution context:

a. If the sync lifecycle property is TRUE, DM-EVS waits for its worker thread to terminate.
b. DM EVS releases all its resources and becomes deactivated.
DM ESP - Eve»i Source by DriverMagic Pump Fig. 3 illustrates the boundary of the inventive DM-ESP part.
DM ESP is an event source that generates both singular and continuous events by using the DriverMagic pump (queue). DM-ESP can be armed and disarmed from any thread or restricted execution context (i.e. dispatch, interrupts). It can be armed to fire a single event per arming (single shot mode), or to keep firing until disarmed (continuous model.
DM ESP may be manually armed and disarmed, including from within the handler of the event it fired. Alternatively, DM-ESP can be parameterized to arm itself automatically upon activation, using the mode specified in its properties;
typically, auto arming is used with continuous mode.
DM ESP can be armed only once; it must be disarmed before it can be armed again. When arming DM-ESP, the caller can provide a context value; DM ESP
passes this context value with every event it fires. To disarm DM ESP, the caller must pass the same context value.
8. Boundary 8.1. Terminals Terminal "evs" with direction "Bidir" and contract In: I EVS Out: I EVS R.
Note:
Synchronous, v-table, cardinality 1 Used to arm and disarm the event source on the input and also to send the event on the output.
8.2. Events and notifications DM-ESP has no incoming or outgoing events. The "event" generated by DM-ESP
is a fire operation call defined in I-EVS-R; it is not an event or notification passed via an I DRAIN interface.
8.3. Special events, frames, commands or verbs None.

8.4. Properties Property "force defaults" of type "UINT32". Note: Boolean. If TRUE, the continuous property overrides the value passed in the I EVS bus. Default is FALSE.
Property "auto arm" of type "UINT32". Note: Boolean. If TRUE, DM-ESP will automatically arm itself on activation. DM-ESP will return CMST_REFUSE on any evs.arm or evs.disarm calls. The force defaults property must be set to TRUE
for this property to be valid. If not, DM-ESP will fail its activation. Default is FALSE.
Property "continuous" of type "UINT32". Note: Boolean. If TRUE and DM_ESP is armed, generate continuous events until disarmed. Default is TRUE.
9. Encapsulated interactions DM ESP uses the DriverMagic pump as a source of events.
10. Specification 11. Responsibilities 1. Generate either one-shot events that require arming for each or continuous events that require a single arm operation.
2. When armed, post a fire message to self. When the fire message is dispatched to DM-ESP, fire an event through evs.fire. If in continuous mode, re-post a fire message to self before returning from the message handler.
2o 3. Allow the re-arming/disarming of the event source while in the context of an evs.fire call.
4. Allow disarming of single or continuous events. No events are to be sent out evs.fire at any time while DM_ESP is disarmed (even if one or more fire messages are pending).
12. Theory of operation 12.1. State machine None.

12.2. Mechanisms Arming the event source When an arm request arrives (within the execution context of a part using DM ESP) DM ESP posts a fire message to itself. The DriverMagic pump enqueues this message and dispatches it at a later time. When the fire message handler is called, DM ESP fires an event through the evs terminal. If armed in continuous mode, DM ESP re-posts a fire message to itself before returning from the message handler.
The event source may be re-armed while in the execution context of a fire event.
l0 Upon return from the fire event, DM-ESP re-arms the event source with the parameters passed with the arm request.
Note that arm requests fail with CMST_REFUSE if DM-ESP is already armed.
When DM ESP is used in continuous mode and is armed once, DM ESP is considered armed at all times until explicitly disarmed.
Disarming the event source When a disarm request arrives (within the execution context of a part using DM ESP), the event source becomes disarmed. The event source will not fire again until it is re-armed.
The event source may be disarmed while in the execution context of a fire event.
Upon return from the fire event, DM_ESP disarms the event source canceling any previous arm requests. The event source will not fire again until it is re-armed.
Deactivation/Destruction of DM ESP
When the event source is deactivated or destroyed, DM-ESP disarms itself (if needed). DM ESP will not fire again until it is created, activated and armed.
DM ESP may be deactivated while in the execution context of a fire event.
12.3. Use Cases Using DM ESP for a one-shot event source 1. DM ESP and Part A are created.
2. Part A connects its evs terminal to DM ESP's evs terminal.
3o 3. Both parts are activated.

4. Part A arms DM-ESP passing a context. DM_ESP posts a fire message to itself.
5. At some later point, the fire message is dispatched and its message handler is called.
6. DM ESP calls Part A's fire operation through its evs terminal passing the status CMST OK and the context associated with the event (passed with the arm request).
7. Part A does one of the following:
a. re-arms the event source - the event source is armed and will fire again when appropriate b. continues execution - the event source is disarmed and will not fire again until Part A re-arms it at a later time Using DM ESP for a continuous source of events 1. DM ESP and Part A are created.
2. Part A connects its evs terminal to DM ESP's evs terminal.
3. DM ESP is parameterized with the following:
a. force defaults is TRUE
b. auto arm is FALSE
c. continuous is TRUE
4. Both parts are activated.
5. Part A arms DM_ESP passing a context.
6. DM ESP posts a fire message to itself.
7. At some later point, the fire message is dispatched and its message handler is called.
8. DM ESP calls Part A's fire operation through its evs terminal passing the status CMST OK and the context associated with the event (passed with the arm request).
9. Part A does one of the following:
a. disarms the event source - the event source is disarmed and will not fire again until Part A re-arms it at a later time b. continues execution - the event source will re-arm itself and, will fire again at a later time . Steps 6-9 are executed many times as long as the event source remains armed.

5 Auto-arming the event source 1. DM ESP and Part A are created.

2. Part A connects its evs terminal to DM ESP's evs terminal.

3. DM ESP is parameterized with the following:

a. force defaults is TRUE

t0 b. auto arm is TRUE

c. continuous is TRUE

4. Both parts are activated.

5. DM ESP posts a fire message to itself.

6. At some later point, the fire message is dispatched and its message handler is called.

7. DM ESP calls Part A's fire operation through its evs terminal passing the status CMST OK.

8. Part A does one of the following:

a. disarms the event source - the event source is disarmed and will not fire again until Part A re-arms it at a later time b. continues execution - the event source will re-arm itself and will fire again at a later time 9. Steps 5-7 are executed many times as long as the event source remains armed.

Disarm event source to terminate firing 1. DM ESP and Part A are created.

2. Part A connects its evs terminal to DM ESP's evs terminal.

3. Both parts are activated.

4. Part A arms DM-ESP passing a context. DM-ESP posts a fire message to itself.

5. At some later point before the fire message handler is called, Part A
disarms the event source.
6. The event source is disarmed and will not fire again until it is re-armed.
DeactivationlDestruction of DM ESP while the event, source is armed 1. DM ESP and Part A are created.
2. Part A connects its evs terminal to DM-ESP's evs terminal.
3. Both parts are activated.
4. Part A arms DM ESP passing a context. DM-ESP posts a fire message to itself.
5. At some later point before the fire message handler is called, DM ESP is deactivated (not necessarily by Part A).
6. DM ESP is destroyed.
13. Notes 1. The events "fired" by DM-ESP are always in the execution context of the DriverMagic pump thread.
2. DM ESP's fire message handler is unguarded - the evs.fire operation is never called within DM-ESP's guard.
DM ESW - Event Source by Windows Message Fig. 4 illustrates the boundary of the inventive DM-ESW part.
DM ESW is an event source that can generate events in the context of the thread in which DM ESW was created. DM ESW can be armed and disarmed from any thread. It can be armed to fire a single event per arming (single shot mode), or to keep firing until disarmed (continuous mode). DM-ESW can delay the firing by a specified time interval from the arming; in continuous mode, subsequent firings are also delayed by the specified time interval.
DM ESW may be manually armed and disarmed, including from within the handler of the event it fired. Alternatively, DM ESW can be parameterized to arm itself automatically upon activation, using the mode and time interval specified in its properties; typically, auto arming is used with continuous mode.

DM ESW can be armed only once; it must be disarmed before it can be armed again. When arming DM_ESW, the caller can provide a context value; DM_ESW
passes this context value with every event it fires. To disarm DM-ESW, the caller must pass the same context value.
To ensure that it fires events in the thread that created it, each instance of DM ESW uses its own Win32 window to which it posts messages; it fires the events from within the window message handler. Win32 guarantees that the messages are received in the thread that created the window (which is the thread that created DM ESW).
Note that for DM ESW to operate properly, there are two requirements coming from Win32:
a. the thread that created DM ESW should be doing a message loop (i.e., call Win32 GetMessage or PeekMessage) - otherwise DM ESW will not be able to fire its events b. DM ESW should be destroyed in the same thread that created it;
otherwise Win32 will not destroy the window and will leak a small amount resources.
DM ESW is available only in the Win32 environment.
14. Boundary 14.1. Terminals Terminal "evs" with direction "Bidir" and contract In: I_EVS Out: I_EVS-R.
Note:
Synchronous, v-table, cardinality 1 Used to arm and disarm the event source on the input and also to send the event on the output when the time period expires.
14.2. Events and notifications DM ESW has no incoming or outgoing events. The "event" generated by DM ESW is a fire operation call defined in I-EVS R; it is not an event or notification passed via an I_DRAIN interface.
14.3. Special events, frames, commands or verbs None.

14.4. Properties Property "force defaults" of type "UINT32". Note: Boolean. If TRUE, the time and continuous properties override the values passed in the I_EVS bus. Default is FALSE.
Property "auto arm" of type "UINT32". Note: Boolean. If TRUE, DM-ESW will automatically arm itself on activation. DM-ESW will return CMST REFUSE on any evs.arm calls. Default is FALSE.
Property "time" of type "SINT32". Note: Default time period in milliseconds.
Valid range is -1 - Ox7fffffff: -1: DM ESW fires event immediately. In continuous mode it continuously fires events in a busy loop (in its window's message handler) until it is disarmed. 0: DM ESW fires event immediately. In continuous mode it fires events by continuously posting messages to its event window until it is disarmed. all other values: when the time period expires (after DM_ESW is armed), DM ESW will fire an event (by calling evs.fire). In continuous mode DM_ESW keeps firing events with this period until disarmed. Default is -1.
Property "continuous" of type "UINT32". Note: Boolean. If TRUE and DM-ESW is armed, generate periodic events until disarmed. If FALSE, DM_ESW needs to be re-armed after each firing. Default is TRUE.
15. Encapsulated interactions DM ESW uses the following Win32 APIs to control its event window and timers:
~ RegisterClass() ~ UnregisterClassl) ~ CreateWindowl) ~ DestroyWindowl) ~ SetTimer() ~ KiIITimerl) ~ PostMessagel) 16. Specification 17. Responsibilities 1 . Register window class for event window only on first instance constrution of DM_ESW. Unregister window class on destruction of last instance.
2. On construction, create a window in the context of the current thread for event dispatching. On destruction destroy the window.
3. When armed, either post a WM_USER message to the event window or arm a Win32 timer for the specified time period.
4. When the WM_USER or WM TIMER message is received by the event window message handler, fire an event through evs.fire (within the same thread that created DM ESW).
5. If time = -1 and armed in continous mode, after firing, enter a busy loop and fire events through evs.fire until disarmed.
6. If time = 0 and armed in continous mode, after firing, re-post a WM USER message to the event window.
7. If time > 0 and armed in continous mode, after firing, arm a Win32 timer associated with the event window for the specified amount of time.
8. Allow the re-arming/disarming of the event source while in the context of a evs.fire call.
9. Allow disarming of single or periodic timer events. No events are to be sent out evs.fire at any time while DM-ESW is disarmed.
18. Theory of operation 18.1. Mechanisms Generating events using a separate window DM ESW uses a window to generate events to its client. Each instance of DM ESW maintains its own window.
On construction, DM ESW creates a window in the current thread. When DM ESW is armed it either posts a WM USER message to the window or arms a Win32 timer (associated with the window). When the WM-USER message is received or the timer expires, the message handler fires an event. If armed in continuous mode, the message handler will either post a new WM-USER message to the window, arm a Win32 timer or repeatedly fire events until disarmed. ~ See the next mechanism for more information.
DM-ESW destroys the window on destruction. DM-ESW must be destroyed within the same thread that created it, otherwise unpredictable results may occur (a Win32 limitation).
Arming the event source When an arm request arrives (within the execution context of a part using DM-ESW), DM-ESW either posts a WM-USER message to its event window or arms a Win32 timer (associated with the window). When the WM-USER message is received or the timer expires, the message handler fires an event. If in continuous mode, depending on the time property the window's message handler does one of the following:
time is -1: DM ESW enters a busy loop and continuously fires events through the evs terminal until it is disarmed. During this time, no window messages for the current thread will be processed until DM ESW is disarmed.
~ time is 0: DM-ESW re-posts a WM-USER message to its window.
When the WM USER message is received, DM-ESW fires an event through the evs terminal as described above. This continues until DM-ESW is disarmed.
time is > 0: DM ESW arms a Win32 timer with the specified time period and returns. When the time period expires, the message handler receives a WM TIMER message and DM ESW fires an event through the evs terminal.
The event source may be re-armed or disarmed while in the execution context of a fire event.
Note: Arm requests fail with CMST-REFUSE if DM-ESW was parameterized to auto arm itself on activation (auto arm property is TRUE).

Disarming the event source When a disarm request arrives (within the execution context of a part using DM ESW1, the event source is disarmed (if armed). The event source will not fire again until it is re-armed. The event source may be disarmed while in the execution context of a fire event.
DeactivationlDestruction of DM ESW
When the event source is destroyed, DM-ESW destroys its event window.
DM ESW then frees its resources and will not fire again until it is created, activated and armed.
DM ESW may be deactivated while in the execution context of a fire event.
18.2. Use Cases Using the event source as a one-shot timer 1 . DM ESW and Part A are created.
2. Part A connects its evs terminal to DM ESW's evs terminal.
3. Both parts are activated. ' 4. Part A arms DM ESW passing a time period > 0 and a context.
5. Part A begins running a message dispatch loop for its windows.
6. At some later point, the time period expires.
7. DM ESW's message handler receives a WM TIMER message and calls Part A's fire operation through its evs terminal passing the status CMST TIMEOUT and the context associated with the event (passed with the arm request).
8. Part A does one of the following:
a. re-arms the event source - the event source is armed and will fire again when appropriate b. continues execution - the event source is disarmed and will not fire again until Part A re-arms it at a later time Using the event source as a periodic timer 1 . DM ESW and Part A are created.
2. Part A connects its evs terminal to DM_ESW's evs terminal.

3. DM_ESW is parameterized with the following:
a. force defaults is TRUE
b. auto arm is FALSE
c. time is set to some time interval for each event d. continuous is TRUE
4. Both parts are activated.
5. Part A arms DM-ESW passing a context.
6. Part A begins running a message dispatch loop for its windows.
7. At some later point, the time period expires.
8. DM-ESW's message handler receives a WM TIMER message and calls Part A's fire operation through its evs terminal passing the status CMST TIMEOUT and the context associated with the event (passed with the arm request).
9. Part A does one of the following:
a. disarms the event source - the event source is disarmed and will not fire again until Part A re-arms it at a later time b. continues execution - the event source will re-arm itself and will fire again at a later time 10. Steps 6-8 are executed many times as long as the event source remains armed.
Auto-arming the event source 9. DM ESW and Part A are created.
lO.Part A connects its evs terminal to DM ESW's evs terminal.
11.DM-ESW is parameterized with the following:
a. force defaults is TRUE
b. auto arm is TRUE
c. time is set to some time interval for each event d. continuous is TRUE
12. Both parts are activated.
13.Part A begins running a message dispatch loop for its windows.

14.At some later point, the time period expires.
15.DM_ESW's message handler receives a WM TIMER message and calls Part A's fire operation through its evs terminal passing the status CMST TIMEOUT.
16. Part A does one of the following:
a. disarms the event source - the event source is disarmed and will not fire again until Part A re-arms it at a later time b. continues execution - the event source will re-arm itself and will fire again at a later time ' l0 17. Steps 6-7 are executed many times as long as the event source remains armed.
Disarm event source to terminate filing 1. DM ESW and Part A are created.
2. Part A connects its evs terminal to DM ESW's evs terminal.
3. Both parts are activated.
4. Part A arms DM_ESW passing a time period and a context.
5. Part A begins running a message dispatch loop for its windows.
6. At some later point before the time period expires Part A disarms the event source.
7. The event source is disarmed and will not fire again until it is re-armed. ' Deactivation/Destruction of DM ESW while the event source is armed 1. DM ESW and Part A are created.
2. Part A connects its evs terminal to DM ESW's evs terminal.
3. Both parts are activated.
4. Part A arms DM_ESW passing a time period and a context.
5. Part A begins running a message dispatch loop for its windows.
6. At some later point before the time period has expired, DM ESW is deactivated (not necessarily by Part A1.
7. DM_ESW is destroyed.

8. DM-ESW destroys the event window and completes destruction.
19. Notes 1. In order for DM-ESW to work correctly, the application that contains the part must provide a message dispatch loop as defined by Windows. This allows the messages for an application to be dispatched to the appropriate window. Please see the Win32 documentation for more information.
2. As Win32 requires that windows be destroyed in the same thread in which they were created, DM-ESW also must be destroyed in the l0 same thread in which it was created. Failure to do so will typically fail to destroy the window.
3. When DM-ESW is used in continuous mode to fire events in a busy loop (time = -1 ), an attempt to disarm and re-arm the event source while in the context of a fire event has no effect on the event source. DM_ESW will continue to fire events in a busy loop. This is the intended behavior.
DM EVT - Timer Event Source Fig. 5 illustrates the boundary of the inventive DM EVT part.
DM-EVT is a timer event source that generates both singular and periodic timer events for a part connected to its evs terminal. DM EVT is armed and disarmed via input operations on its evs terminal and generates timer events by invoking the fire output operation on the same terminal. A user defined context is passed to DM
EVT
when armed and is passed back in the fire operation call when the time out period expires.
DM_EVT allows itself to be armed only once. If DM EVT has not been armed to generate periodic timer events, it may be re-armed successfully as soon as the timer event is generated; this includes being re-armed while in the context of the fire operation call.

DM_EVT may be disarmed at any time. Once disarmed, DM EVT will never invoke the fire operation on evs until it is re-armed. The context passed to DM EVT
when disarming it must match the context that was passed with the arm operation.
DM_EVT may be parameterized with default values to use when generating events and flags that control the use of the defaults and whether or not DM
EVT
automatically arms itself when activated. These properties can significantly simplify the use of DM-EVT in that it is possible to simply connect to and activate DM
EVT
to obtain a source of events.
DM-EVT is boundary compatible with the DM_EVS part.
l0 This part is only available in Windows NT/95/98 Kernel Mode environments.
20. Boundary 20.1. Terminals Terminal "evs" with direction "Bidir" and contract In: I EVS Out: I EVS R.
Note:
Used to arm and disarm the event source on the input and to send the timer event on the output when the time period expires.
20.2. Events and notifications DM_EVT has no incoming or outgoing events. The timer "event" generated by DM_EVT is a fire operation call defined in I-EVS_R; it is not an event or notification passed via an I DRAIN interface.
20.3. Special events, frames, commands or verbs None.
20.4. Properties Property "force defaults" of type "UINT32". Note: Boolean. If non-zero, the time and continuous properties override the values passed in the I EVS bus. Default is FALSE.
Property "auto arm" of type "UINT32". Note: Boolean. If non-zero, DM EVT will automatically arm itself on activation. DM EVT will return CMST REFUSE when on any call evs.arm call. The force defaults property must be set to TRUE for this property to be valid. If not, DM-EVT will fail its activation. Default is FALSE.

Property "time" of type "SINT32". Note: Default time period in milliseconds.
Valid range is 1 - Ox7fffffff. Default is 500.
Property "continuous" of type "UINT32". Note: Boolean. If non-zero and DM EVT
is armed, generate periodic events until disarmed. Default is FALSE.
21. Encapsulated interactions 21.1. Windows NT Kernel Mode DM-EVT uses KelnitializeTimerExl) and KelnitializeDpcl) to initialize a timer object and a deferred procedure. DM_EVT utilizes the kernel-mode services KeSetTimerEx() and KeCanceITimer() to generate and cancel timer events.
DM-EVT does not create any threads.
21.2. Windows 95/98 Kernel Mode DM-EVT utilizes the VMM services Set Async Time Out() and Cancel Time-Outl) to generate and cancel timer events.
DM EVT does not create any threads.
22. Specification
23. Responsibilities 5. When armed with a time period, generate timer events by calling evs.fire.
6. Generate either one-shot timer events that require arming for each or periodic timer events that require a single arm operation.
7. Allow the re-arming of the timer event source while in the context of a evs.fire call.
8. Allow disarming of single or periodic timer events. No events are to be sent out evs.fire at any time while DM EVT is disarmed (even if periodic timer events are pending).
24. Theory of operation 24.1. State machine None.

24.2. Data structures used in Windows 95/98 Kernel Mode environment Because the embedded timer event handler is invoked in an interrupt context, it cannot access DM_EVT's self. To accommodate this restriction, a structure is allocated that can be shared between DM-EVT's operations and the timer event handler utilizing an interrupt level critical section for synchronization.
This structure is allocated on each arm and is freed either by a disarm call or by the message handler in DM-EVT's de-synchronization mechanism (see the following section).
Access to this structure is shared between operations in DM EVT and the embedded timer event handler, requiring an interrupt level critical section to 1o synchronize access to it.
No specific data structures are used in Windows NT Kernel Mode implementation.
24.3. Mechanisms used in Windows NT Kernel Mode environment Timer Initialization At creation time DM-EVT initializes a kernel-mode timer object and a deferred procedure call structure (KDPC). DM_EVT initializes the KDPC with the timer callback function and first callback parameter a pointer to self. The KDPC structure is passed as a parameter when DM_EVT set the timer object.
Generating timer events DM_EVT passes a time period and the deferred procedure structure to KeSetTimerEx(). When the time period expires, the deferred procedure is invoked which posts a VM-EVT TIMER message to DM-EVT to de-synchronize the timer object event.
Arming and disarming DM-EVT is armed and disarmed via the evs operation calls arm and disarm, respectively. When called on evs.arm, DM EVT sets the time period with KeSetTimerEx() and returns. The timer event set by KeSetTimerExl) can be periodic or single event, depend on the parameters passed.
When called on evs.disarm, DM EVT disarmd the timer by calling KeCanceITimer().

De-synchronization The VM-EVT TIMER message handler checks the context against the one stored in the self (changed after each disarm operation) and, if it matches, invokes the evs.fire operation, otherwise it returns CMST OK.
24.4. Mechanisms used in Windows 95/98 Kernel Mode environment Generating timer events DM_EVT passes a time period to and registers a callback procedure with the VMM service Set Async Time Out)). When the time period expires, the callback procedure is invoked, which posts a message to DM-EVT to de-synchronize the l0 VMM timer event (called during interruptl. The method that receives the posted message invokes the evs.fire operation synchronously, if DM EVT's state allows (e.g., the timer was not disarmed before message was de-queued).
Arming and disarming DM-EVT is armed and disarmed via the evs operation calls arm and disarm, respectively. When called on evs.arm, DM_EVT creates a critical section and allocates a context for the embedded timer and registers it with Set Async Time Out(). DM_EVT also passes Set Async Time Out() a callback and a time period. The pointer to the context is saved in the self.
When called on evs.disarm, DM EVT checks the embedded timer context and, if a timer event is pending, calls Cancel Time Out() and frees the context. If a timer event is not pending, the critical section is destroyed and the pointer to the context in the self is set to NULL.
De-synchronization When the callback procedure registered with Set Async Time OutU is invoked, the state in the received context is checked to determine if a periodic timer is specified, at which a new event is registered. A VM-EVT FIRE message is then posted to DM-EVT.
The VM-EVT_FIRE message handler checks the context pointer against the one stored in the self (by the arm operation) and, if it matches, invokes the evs.fire operation. If there are no pending timer events, DM EVT will free the context and move into a disarmed state.
Managing the context for the embedded timer The event handler for the embedded system timer executes in an interrupt context, therefore, it cannot access the self. A context that can be shared between DM-EVT's normal operation handlers and the timer event handler is allocated by the evs.arm operation and freed either by the evs.disarm operation or, if already referenced by a posted message, by the handler that receives the message.
Reference counters are maintained inside the structure to store the necessary state to determine when the context should be freed (more than one message with the same context may be queued). Additionally, a critical section object is stored in the context and is always accessed before any other field is touched. The critical section is used for synchronization of access to this context.
DM lRQ - Interrupt Event Source Fig. 6 illustrates the boundary of the inventive DM-IRQ part.
DM-IRO. is an interrupt event source that generates events when a hardware interrupt occurs. DM-IRQ is enabled and disabled via input operations on its out terminal and generates interrupt events by invoking preview and/or submit output operation on the same terminal.
DM-IRQ may be enabled and disabled only at PASSIVE-LEVEL. Once enabled, DM-IRO. will invoke preview and submit operations on its out terminal whenever interrupts occur. Disabling the DM-IRQ will stop generation of output operations through the out terminal. If the auto enable property is set, enabling of the DM-IRQ
is executed internally at activation time.
A user-defined context is passed back to DM-IRQ upon successful return from preview call. This context is used for the subsequent submit call, if the client returns with status CMST SUBMIT. DM IRQ maintain statistics counters for the number of generated interrupts, the number of submit commands issued through the out terminal and the number of "missed" submits.

Note: The preview operation is executed at interrupt context. The corresponding operation handler must be unguarded. The submit operation is executed at DISPATCH LEVEL.
Note DM-IRQ may only be used in the NT Kernel Mode environment.
25. Boundary 25.1. Terminals Terminal "out" with direction "bi-dir" and contract in: I IRQ (vtable) out: I
IRQ R
(vtable). Note: Used to enable and disable the event source on the input and to send the interrupt event on the output when the interrupt occurs.
l0 25.2. Events and notifications None.
25.3. Special events, frames, commands or verbs None.
25.4. Properties Property "bus" of type "DWORD". Note: number of the bus on which the device is placed (Mandatory) Property "bus type" of type "DWORD". Note: Type of the bus (BUS TYPE xxx):
BUS TYPE-INTERNAL (1 ) BUS TYPE-ISA 12) BUS TYPE-EISA (3) BUS TYPE-MICRCHANNEL (4) BUS TYPE TURBOCHANNEL (5) BUS TYPE-PCI
(ti) The default value is BUS TYPE PCI
Property "level" of type "DWORD". Note: IRO, level (IRaL) (Mandatory) Property "vector" of type "DWORD". Note: IRQ vector (Mandatory) Property "irq-mode" of type "DWORD". Note: IRQ-MODE-LEVEL/O) - level-sensitive interrupt. IRQ-MODE-LATCHED11) - edge-sensitive The default value is IRQ MODE LEVEL.
Property "shared" of type "DWORD". Note: Boolean TRUE if the interrupt can be shared. FALSE - IQR must claim exclusive use of this interrupt. The default value is TRUE.

Property "auto enable" of type "DWORD". Note: Boolean. If non-zero, IRQ will automatically enable itself on activation. IRQ will return REFUSE on any enable call.
The default value is FALSE.
Property "cnt-received" of type "DWORD
read-only". Note: Count the number of received interrupts since DM IRQ was enabled.
Property "cnt submitted" of type "DWORD
read-only". Note: Count the number of submitted interrupts since DM IRQ was enabled.
l0 Property "cnt-missed" of type "DWORD
read-only". Note: Count the number of interrupts for which DM IRQ was not able to execute submit call.
26. Encapsulated interactions - HaIGetInterruptVector - returns a mapped system interrupt vector, interrupt level, and processor affinity mask that device drivers must pass to IoConnectlnterrupt.
- IoConnectlnterrupt - registers an ISR to be called when the interrupt occurs.
- IoDisconnectlnterrupt - unregisters the Interrupt Service Routine (ISR) - KelnsertQueueDpc - queues a DPC for execution when the IRaL of a processor drops below DISPATCH LEVEL
- KeRemove0.ueueDpc - removes a given DPC object from the system DPC queue.
- InterlockedCompareExchange - an atomic compare and exchange operation.
27. Specification
28. Responsibilities 1. Provide sufficient properties to identify the interrupt uniquely 2. Allocate and connect interrupt on enable or on activate if the property auto enable is set.
3. Implement the actual interrupt handler.
4. Process incoming interrupts as follows:
a. call preview b. depending on the returned status, create a DPC and queue it c. inform the operating system that this interrupt is recognized d. maintain the statistic counters 5. On disable, clean up properly. Cancel all outstanding DPCs.
6. Maintain a stack with free DPC structures. They are used for scheduling deferred procedure calls from which context is called submit operations.
7. Check the current IRQ level on all incoming enable and disable calls and refuse the operation if the level is not PASSIVE LEVEL
8. Guarantee that the submit comes out on IRO.L equal to DISPATCH LEVEL
9. Guarantee that the preview comes out in interrupt context.
10. Guarantee that there will not be any preview or submit calls after the disable operations returns or after it is deactivated.
29. Theory of operation 29.1. State machine None.
29.2. Main data structures A stack of 32 KDPC structures used for issuing the deferred procedure calls.
29.3. Mechanisms Servicing the interrupt When the interrupt occurs, DM_IRQ generates a preview call through its out terminal. If the preview returns status CMST SUBMIT, DM IRa schedules a DPC
which sends out a submit call with the returned from preview context.
Enabling and disabling interrupts DM-IRa expects client to call enable and disable at PASSIVE LEVEL. The same applies for activation and deactivation with property auto enable set to TRUE.
On enable it allocates an interrupt and connects an interrupt handler to it. On disable it disconnects itself from the interrupt and releases all pending DPCs. There will be no outgoing calls after disabling the interrupts.
Allocating memory for the DM lRQ instance The memory allocated for the DM-IRQ instance is from the non-paged memory pool.
30. Usage notes 1 . The preview operation on the part connected to the DM IRQ must be unguarded. The preview operation cannot be guarded because it l0 is executed in interrupt context.
2. If the clients needs to access any data during preview or submit it should be in non-paged memory.
3. On preview the client is responsible to synchronize access to any data that is shared between the preview handler and the rest of the code, using appropriate atomic and interlocked operations. Note that no DriverMagic~' APIs may be called during preview.
4. While a preview operation is executed it could be preempted at any time by other preview operation with higher priority or running on different processor.
5. If the interrupt being serviced is level-sensitive, the preview operation handler should cause the device to deassert the interrupt request - otherwise the preview operation will be invoked immediately upon return. For devices that support multiple causes of interrupts, the preview operation needs to clear at least one cause on each invocation. Since the connected part is not supposed to know the type of interrupt (edge-sensitive or level-sensitive), the preview handler should always remove the cause of the interrupt before returning.
6. There is no limitation for the implementation of submit operation on the connected part.

7. DM-IRQ could send out a submit operation at any time. It is in the connected part responsibilities to guard itself from submit reentrancy.
Notifiers DM NFY - Notifier Fig. 7 illustrates the boundary of the inventive DM-NFY part.
DM-NFY is a connectivity part. It passes all events received on its in terminal to its out terminal watching for particular event (trigger) to come. When such trigger event is received, DM_NFY can optionally send two notifications that such event has l0 been received: before and/or after passing it through its out terminal.
The ID of the trigger event as well as the IDs of the notification events are exposed as properties on the DM-NFY boundary.
1. Boundary 1.1. Terminals Terminal "in" with direction "In" and contract I-DRAIN. Note: All input events are received here and forwarded to out terminal. The status returned is the one returned by the operation on the out terminal. If out terminal is not connected, the operation will return CMST-NOT_CONNECTED. Unguarded. Can be connected when the part is active.
Terminal "out" with direction "Out" and contract I-DRAIN. Note: All input events received on in terminal are forwarded through here. Can be connected when the part is active.
Terminal "nfy" with direction "Out" and contract I DRAIN. Note: Notifications that the trigger event is received are sent through here. Can be connected when the part is active.
1.2. Events and notifications All events received on in terminal are forwarded to out terminal, raising up to two notifications: one before and after the forwarding.
The event IDs are exposed as properties and therefore can be controlled by the outer scope.

The attributes of the notification events are: CMEVT A SELF CONTAINED, CMEVT A SYNC, CMEVT A ASYNC.
The pre and post notifications are always allocated on the stack.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "trigger ev" of type "UINT32". Note: Trigger event ID. Mandatory.
Property "pre ev" of type "UINT32". Note: Pre-notification event ID. Set to EV-NULL to disable issuing a pre-notification. Default: EV-NULL.
Property "post ev" of type "UINT32". Note: Post-notification event ID. Set to EV-NULL to disable issuing a post-notification. Default: EV-NULL.
2. Encapsulated interactions None.
3. Specification 4. Responsibilities 1. , Pass all events coming on in to out.
2. Watch for trigger event and send pre and/or post notification to nfy when this event arrives.
5. Theory of operation DM-NFY passes all events coming at the in terminal through its out terminal and watches for a particular event to arrive. When the event arrives, based on its parameters, DM NFY issues one or two notifications: before and/or after the event is passed through.
DM-NFY propagates the status returned on the out terminal operation back to the caller of the in terminal operation.
DM-NFY keeps no state.
DM NFY2 - Advanced Event Notifier Fig. 8 illustrates the boundary of the inventive DM NFY2 part.

DM-NFY2 is a connectivity part. It passes all events received on its in terminal to its out terminal watching for particular event (trigger) to come. When such trigger event is received, DM NFY2 can send one or two notifications that such event has been received: before and/or after passing it through its out terminal.
Unlike the standard notifier (DM NFY), DM NFY2 allocates the notification event buses using cm evt alloc and allows custom event bus sizes and event attributes.
6. Boundary 6.1. Terminals Terminal "in" with direction "In" and contract I_DRAIN. Note: All input events are received here and forwarded to out terminal. The status returned is the one returned by the operation on the out terminal. If out terminal is not connected, the operation will return CMST_NOT_CONNECTED. Unguarded. Can be connected when the part is active.
Terminal "out" with direction "Out" and contract I-DRAIN. Note: All input events received on in terminal are forwarded through here. Can be connected when the part is active.
Terminal "nfy" with direction "Out" and contract I DRAIN. Note: Notifications that the trigger event is received are sent through here. Can be connected when the part is active.
6.2. Events and notifications All events received on in terminal are forwarded to out terminal, raising up to two notifications: one before and after the forwarding.
The event IDs, bus size and attributes are exposed as properties and therefore can be controlled by the outer scope.
The pre and post notification event buses are allocated using cm evt alloc.
See notes at the end of this data sheet for details on freeing self-owned events and events with asynchronous completion.
6.3. Special events, frames, commands or verbs None.

6.4. Properties Property "trigger ev" of type "UINT32". Note: Trigger event ID. Mandatory.
Property '.'pre ev" of type "UINT32". Note: Pre-notification event ID. Set to EV-NULL to disable issuing a pre-notification. Default: EV-NULL.
Property "pre ev_bus sz" of type "UINT32". Note: Specifies the size (in bytes) of the event bus used for the pre-notification event. DM NFY2 zero-initializes the bus and updates the event header information (event id, bus size and attributes) before sending the event. Default is sizeof (CMEVENT HDR).
Property "pre ev attr" of type "UINT32". Note: Pre-notification event attributes.
These attributes are set by DM NFY2 after event allocation. Default:
CMEVT A SYNC ANY ~ CMEVT A SELF CONTAINED
Property "post ev" of type "UINT32". Note: Post-notification event ID. Set to EV-NULL to disable issuing a post-notification. Default: EV-NULL.
Property "post ev_bus sz" of type "UINT32". Note: Specifies the size (in bytes) of the event bus used for the post-notification event. DM NFY2 zero-initializes the bus and updates the event header information (event id, bus size and attributes) before sending the event. Default is sizeof (CMEVENT HDR).
Property "post ev attr" of type "UINT32". Note: Post-notification event attributes.
These attributes are set by DM NFY2 after event allocation. Default:
CMEVT A SYNC ANY ~ CMEVT A-SELF CONTAINED
7. Encapsulated interactions None.
8. Specification 9. Responsibilities 3. Pass all events coming on in to out.
4. Fail activation if CMEVT A ASYNG CPLT and CMEVT A SELF OWNED attributes are both set for either the pre or post notification event attributes.
5. Watch for trigger event and send pre and/or post notification to nfy when this event arrives.

10. Theory of operation DM-NFY2 passes all events coming at the in terminal through its out terminal and watches for a particular event to arrive. When the event arrives, based on its parameters, DM-NFY2 issues one or two notifications: before and/or after the event is passed through.
DM-NFY2 propagates the status returned on the out terminal operation back to the caller of the in terminal operation.
DM NFY2 keeps no state.
10.1. State machine None.
10.2. Main data structures None.
10.3. Mechanisms None.
11. Notes 1. DM NFY2's activation will fail if CMEVT A ASYNC CPLT and CMEVT A SELF-OWNED attributes are both set for either the pre or post notification event attributes.
2. If a notification event allows asynchronous completion (CMEVT A ASYNC CPLT attribute is set) and the return status of the event processing is CMST-PENDING, DM-NFY2 does not free the notification event. It is up to the recipient of this event to free the event bus. DM-NFY2 will only free the event if a status other than CMST PENDING is returned.
3. If a notification event is self-owned (CMEVT A SELF OWNED), ', DM-NFY2 will only free the event bus if the return status is not equal to CMST OK.
DM NFYS - Notifier on Status Fig. 9 illustrates the boundary of the inventive DM NFYS part.

DM-NFYS passes all operations received from the in terminal through the out terminal. If the return status of the operation (passed through out) is equal to a specific status, DM-NFYS generates a notification through the nfy terminal.
The operation status and the notification event ID are set as properties on DM NFYS.
DM_NFYS always returns the status returned from the out operation. The return status from nfy is ignored.
12. Boundary 12.1. Terminals Terminal "in" with direction "In" and contract I-POLY. Note: v-table, synchronous, infinite cardinality All operations received on this terminal are forwarded through out.
Terminal "out" with direction "Out" and contract I POLY. Note: v-table, synchronous, cardinality 1 All operations received from the in terminal are forwarded out through this terminal.
Terminal "nfy" with direction "Out" and contract I DRAIN. Note: v-table, synchronous, cardinality 1 Depending on the return status of the operation passed through out, DM-NFYS may generate a notification through this terminal.
12.2. Events and notifications Outgoing Bus Notes Event (ev-id) CMEVENT This notification is generated _HDR by DM-NFYS if the return status of the operation forwarded through out is equal to stat.
The event is sent with the CMEVENT HDR bus and CMEVT A SYNC ANY and CMEVT A SELF CONTAINE
D attributes. The event is allocated on the stack.
12.3. Special events, frames, commands or verbs None.
12.4. Properties Property "stat" of type "UINT32". Note: Return status that determines if DM
NFYS
should generate a notification through its nfy terminal. If the return status of the operation forwarded through out is equal to the value of this property, DM
NFYS
generates an ev-id notification. Default is CMST OK.
Property "ev id" of type "UINT32". Note: ID of the notification that DM NFYS
generates through its nfy terminal. Default is EV-NULL (no notifcation is generated).
13. Internal structure DM-NFYS is an assembly that is built entirely out of DriverMagic library parts. It is comprised of a "Distributor for Service" (DSV), which forwards unserviced operations to a specific terminal, a "Poly to Drain Adapter" (P2D) that converts I_POLY operations into events, an "Event Notifier" (NFY), which generates a notification when an specific event is received, and an "Event Stopper" (DST) which terminates the event flow from NFY.
Operations received on in are passed through the out terminal. If the return status of the operation is equal to the stat property, the operation is forwarded to P2D. P2D converts the operation call into an EV REO. POLY CALL event. This event is passed to NFY which generates an ev-id notification and passes it out the nfy terminal. The EV-REQ-POLY CALL event is then passed to DST where it is consumed.
If the return status of the forwarded operation is not equal to stat, the status is returned back to the caller and no further operation is needed.
14. Subordinate's Responsibilities 14.1. DSV - Distributor for Service 1 . Forwards incoming operation to out2 if the operation is not serviced by out1.
14.2. P2D - Poly to Drain Adapter 1. Convert operation calls into operation events IEV REQ POLY CALL).
14.3. NFY - Event Notifier 1 . Generates an event through aux when a specific event is received on in. The input event is forwarded through out either before or after the genereated event is sent through aux.
14.4. DST - Event Stopper 1. Terminate the event flow by returning a specified status (e.g., CMST OK).
15. Dominant's Responsibilities 15.1. Hard parameterization of subordinates Part Property Value nfy trigger ev EV-REQ-POLY CALL
dsv hunt if match TRUE
15.2. Distribution of Properties to the Subordinates Property Type Dist To Name stat UINT32 group dsv.hunt stat __ ._...__...._.___..........................._.._._.........................._.__ ____.....__._.._........................._._....._._____ ......................_._....._................_.....__._........_...group _..................
stat UINT32 dst.ret s ...............................................................................
...............................................................................
........._...._..........._..........................................._...._...
............................_............._...........
ev id UINT32 redir nfy.pre ev DM NFYB - Bi-directional Notifier Fig. 10 illustrates the boundary of the inventive DM-NFYB part.
DM-NFYB watches the event flow on its in and out terminals for particular events) (i.e., trigger) to come. All events that are received on one terminal are passed to the opposite terminal.
When the trigger event is received, a notification can be sent out the nfy terminal before and/or after passing the event through the opposite terminal.
16. Boundary 16.1. Terminals Terminal "in" with direction "Bidir" and contract I-DRAIN. Note: All incoming events are forwarded to the out terminal. The status returned is the one returned by the operation on the out terminal. This terminal is unguarded and can be connected when the part is active.
Terminal "out" with direction "Bidir" and contract I_DRAIN. Note: All incoming events are forwarded to the in terminal. The status returned is the one returned by the operation on the in terminal. This terminal is unguarded and can be connected when the part is active.
Terminal "nfy" with direction "out" and contract I DRAIN. Note: Notifications that a trigger event has been received on either terminal are sent through here. This terminal can be connected when the part is active.
16.2. Events and notifications All events received on in terminal are forwarded to out terminal and visa versa, raising up to two notifications: one before and after the forwarding.
16.3. Special events, frames, commands or verbs None.
16.4. Properties Property "trigger ev" of type "uint32". Note: Trigger event ID This property is mandatory.

Property "in-pre ev" of type "uint32". Note: Pre-notification event ID in response to receiving trigger ev on the in terminal. Set to EV NULL to disable issuing a pre-notification. Default: EV NULL.
Property "in post ev" of type "uint32". Note: Post-notification event ID in response to receiving trigger ev on the in terminal. Set to EV-NULL to disable issuing a post-notification. Default: EV NULL.
Property "out pre ev" of type "uint32". Note: Pre-notification event ID in response to receiving trigger ev on the out terminal. Set to EV-NULL to disable issuing a pre-notification. Default: EV NULL.
Property "out-post ev" of type "uint32". Note: Post-notification event ID in response to receiving trigger ev on the out terminal. Set to EV-NULL to disable issuing a post-notification. Default: EV NULL.
17. Internal Definition Fig. 1 1 illustrates the internal structure of the inventive DM-NFYB part.
DM-NFYB is an assembly that is built entirely out of DriverMagic library parts. It is composed of two Bi-directional Splitters (DM BSP) and two Event Notifiers (DM NFY).
18. Subordinate's Responsibilities 18.1. DM-BSP - Bi-directional Splitter The two DM-BSP parts provide the necessary plumbing to connect DM NFYB's bi-directional inputs to the DM-NFY's uni-directional input and output.
18.2. DM NFY - Event Notifier Each of the DM-NFY parts implements the event notification functionality for a single direction (in ~ out and out ~ in). When the trigger event is received, one or two notifications as specified by the xxx.pre ev and xxx.post ev properties are sent out the nfy terminal.
19. Dominant's Responsibilities 19.1. Hard Parameterization of Subordinates None.

19.2. Distribution of Properties to Subordinates Property name Type Dist To trigger ev uint32 group in.trigger ev, out.trigger ev in-pre ev uint32 redir in.pre ev in post uint32 redir in.post ev ev out_pre uint32 redir out.pre ev ev out-post uint32 redir outpost ev ev Adapters DM P2D - Poly-to-Drain Adapter Fig. 13 illustrates the boundary of the inventive DM P2D part.
DM-P2D converts I POLY v-table interface operations to EV REQ POLY CALL
events. DM P2D translates an operation call to an event by setting up an event control block, which describes the operation call. The control block contains all the information necessary to reconstruct the call (contract ID, physical mechanism of the operation call, the operation ID of the operation that was called and the operation bus l0 passed with the call). This control block is sent out as a synchronous event.
DM-P2D also enforces that the correct contract ID and synchronicity is supplied on an attempt to connect to its in input. The expected contract ID and synchronicity are specified through the property's expected cid and expected sync respectively.
This allows the owner of DM-P2D to protect against the connection of a wrong terminal.
1. Boundary 1.1. Terminals Terminal "in" with direction "in" and contract I POLY. Note: v-table, infinite cardinality, synchronous All operations on this terminal generate an EV REa POLY CALL event.
Terminal "out" with direction "out" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous All EV-REQ-POLY CALL events are passed out through this terminal.

1.2. Events and notifications There are no incoming events.
Outgoing Event Bus Notes EV_REQ-POLY- EV_POLY All incoming operations on CALL in are converted to an EV REQ POLY CALL event and sent through out.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "expected cid" of type "UINT32". Note: This is the contract ID of the terminal that is allowed to be connected to in. When it is 0, the part does not enforce the contract ID. Default is 0.
l0 Property "expected sync" of type "UINT32". Note: This is the synchronicity of the terminal that is allowed to be connected to in. Default is CMTRM S SYNC.
2. Encapsulated interactions None.
3. Specification 4. Responsibilities 4. Enforce that the contract ID and synchronicity of the counter terminal of in is the same as the one specified by the expected cid and expected sync properties respectively.
5. Convert all I POLY operations into EV REQ POLY CALL events and send them out through the out output terminal.
5. Theory of operation 5.1. State machine None.

5.2. Main data structures DM-P2D uses the following event control block for the EV REQ POLY CALL
events it generates:
EVENTX (EV-POLY, EV_REQ-POLY CALL, CMEVT A AUTO, CMEVT UNGUARDED) // poly event specific data dword cid ; // contract id uint16 mech ; // physical mechanism uint32 op_id ; // operation id void *~busp ; // pointer to operation bus END EVENTX
5.3. Mechanisms Enforcement of connection contracts to in When DM-P2D is connected on in, it compares the contract ID and synchronicity provided on the connection with its expected cid and expected sync properties respectively. If either of the two do not match, DM P2D will refuse the connection.
Conversion of in operations into EV REQ POLY CALL events When DM_P2D is invoked on one of its in operations, DM-P2D initializes an event control block and sends an EV-REQ POLY CALL event through the terminal out.
The header of the control block contains the event ID (EV REQ POLY CALL), the size of the control block, and attributes (depends upon successful duplication of the operation bus pointer).
The control block also contains information about the operation call. This includes the physical mechanism used (always v-table) and the contract ID
(expected cid). The ID of the operation invoked and the pointer to the operation bus are also provided. The operation bus is not interpreted by DM P2D; it is treated as an externally supplied context. After DM_P2D initializes the control block, it sends the event through the out terminal.
The attributes of the events generated by DM-P2D depend upon two variables.
The synchronicity of the counter terminal and whether or not the operation bus is pool allocated. The operation bus is pool allocated if it is allocated on the heap using the cm bus alloc function or the bus alloc macro.
The table below describes the attributes of the EV REQ POLY CALL event that DM-P2D generates. The first column is the synchronicity of the counter terminal of the in terminal. The intersections in the table are the attributes of the event. All events have the CMEVT A CONST attribute.
Terminal Pool allocated Non pool allocated synchronicitybus bus Synchronous CMEVT SYNC CMEVT A SYNC
A

AsynchronousCMEVT SYNC Invalid A

ANY and CMEVT SELF
A

OWNED

Both CMEVT SYNC CMEVT A SYNC
A

5.4. Use Cases Operation invoked on in 1 . The counter terminal of in invokes one of its operations. The call comes to one of in operation handlers (Op1 - Op64).
2. DM-P2D generates an EV REQ POLY CALL event. The event contains the following information:
a. the event ID (EV REQ POLY CALL) b. the contract ID (specified by the property expected cid) c. the physical mechanism (CMTRM M VTBL) d. the operation ID
e. the operation bus f. event attributes (as described in the above table) ' 3. DM-P2D sends the event through its out output.
DM D2P - Drain-to-Poly Adapter Fig. 14 illustrates the boundary of the inventive DM D2P part.
DM-D2P converts incoming EV REQ POLY CALL events into operation calls through the I POLY out terminal. DM-D2P translates an incoming EV-REQ POLY-CALL event to an operation call by examining the event. The event fully describes the operation call and contains all the information necessary to reconstruct the call (contract ID, physical mechanism, the operation ID and the operation bus passed with the call). This information is used by DM D2P to reconstruct the operation call through its out output.
DM-D2P also enforces that the correct contract ID is supplied on an attempt to connect to its out output. The expected contract ID is specified through a property called expected cid. This allows the owner of DM-D2P to protect against the connection of a wrong terminal.
6. Boundary 6.1. Terminals Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, infinite cardinality, synchronous This terminal receives all the incoming events for DM
D2P.
Terminal "out" with direction "Out" and contract I-POLY . Note: v-table, cardinality 1, synchronous This terminal is used to invoke operations as described in the event EV REQ POLY CALL.
6.2. Events and notifications Incoming Event Bus Notes EV-REa-POLY CA EV-POLY All incoming events of LL this type on in are converted to I POLY
operation calls on out.
Any other events are Incoming Event Bus Notes ignored.
6.3. Special events, frames, commands or verbs None.
6.4. Properties Property "expected cid" of type "UINT32". Note: This is the contract ID of the terminal that is allowed to be connected to out. When it is 0, the part does not enforce the contract ID. Default is 0.
7. Encapsulated interactions None.
8. Specification 9. Responsibilities 1. Enforce that the contract ID of the counter terminal of out is the same as the one specified by the expected cid property.
2. Convert all incoming EV REO-POLY CALL events into out operation calls.
10. Theory of operation 10.1. State machine None.
10.2. Main data structures DM-D2P interprets the following event control block for the EV REQ POLY CALL
events it receives:
EVENTX (EV POLY, EV_REQ-POLY CALL, CMEVT A AUTO, CMEVT UNGUARDED) // poly event specific data dword cid ; // contract id uint16 mech ; // physical mechanism uint32 op id ; // operation id void ~busp ; // pointer to operation bus END EVENTX
10.3. Mechanisms Enforcement of connection contracts to out DM_D2P has a property called expected cid. This property lets its owner parameterize DM-D2P to specify that terminals with a particular contract may connect to out. On an attempt to connect to out, the contract ID of the counter terminal is saved so that only the set of operations it specifies can be invoked.
Conversion of EV REQ POLY CALL events into out operation calls When DM D2P receives an EV REQ POLY CALL event, DM D2P reconstructs the l0 operation call described by the event. The event contains information about the operation. This includes the physical mechanism used (always v-table in this case), the contract ID, the ID of the operation to invoke and the pointer to the operation bus. The operation bus is not interpreted by DM_D2P; it is treated as an externally supplied context.
Upon receiving an EV REQ POLY CALL event, DM D2P validates the event for the proper information. DM_D2P then uses the operation ID as an operation index and invokes it. The operation bus from the event is passed with the operation call.
DM D2P will consume all events it receives.
10.4. Use Cases Event sent through in input The counter terminal of in sends an event to DM-D2P. The raise operation handler of DM-D2P is called and receives a pointer to an event control block.
1 . DM_D2P validates the event for proper information:
a. size > = sizeof (EV POLY) b. event ID = EV REQ POLY CALL
c. contract ID = value specified by the property expected cid d. mechanism = CMTRM M VTBL
e. operation ID is between 1 and 64 2. After validation, DM-D2P uses the operation ID minus one as an operation index and invokes the operation through out. The operation is invoked with the operation bus received in the event.
3. DM-D2P consumes the event, freeing the event bus if it is marked as self-owned.
DM NP2D, DM ND2P and DM BP2D - Poly-to-Drain and Drain-to-Poly Adapters Fig. 15 illustrates the boundary of the inventive DM-NP2D part.
Fig. 16 illustrates the boundary of the inventive DM-ND2P part.
Fig. 17 illustrates the boundary of the inventive DM-BP2D part.
DM-NP2D, DM-ND2P and DM-BP2D constitute a set of adapters that convert a v-table interface into an event (1 DRAIN) interface and vice-versa. The set of events is generated by adding the index of the v-table operation to a base value that is provided as a property.
The adapters propagate the operation data when converting from one interface to the other. For this reason, the operation data must be identical between the two interfaces.
When converting from a v-table interface to event interface, the adapters have an option by which return data from the outgoing event may be copied to the original operation bus before returning from the call.
11. Boundary 11.1. Terminals (DM NP2D) Terminal "in" with direction "In" and contract I POLY. Note: All operations on this terminal are converted into events with event IDs of ev base plus the v-table index of the operation being invoked.
Terminal "out" with direction "Out" and contract I DRAIN. Note: All converted events are passed out this terminal.
1.1.2. Terminals (DM ND2P) Terminal "in" with direction "In" and contract I DRAIN. Note: This terminal receives all of the incoming events.

Terminal "out" with direction "Out" and contract I POLY. Note: This terminal is used to invoke operations. The operation that is invoked is calculated from the event ID
received on in less the value of the ev-base property. CMST_NOT SUPPORTED is returned for unrecognized operations.
11.3. Terminals (DM BP2D) Terminal "poly" with direction "Bidir" and contract I-POLY. Note: Incoming operations are converted to events and forwarded out the out terminal.
Terminal "drain" with direction "Bidir" and contract I DRAIN. Note: All converted events are passed out this terminal. Events received on this terminal are converted to operation calls and invoked out the in terminal.
11.4. Events and notifications The events that are received and generated contain the following data:
1 . CMEVENT_HDR where the event id is in the range (ev-base + 0) ... (ev_base + 63) 2. Operation data 11.5. Special events, frames, commands or verbs None.
11.6. Properties (DM NP2D) Property "ev_base" of type "uint32". Note: Event base used to generate event IDs for outgoing events and extract operation IDs for incoming operations. The default is 0x01000800.
Property "ev attr" of type "uint32". Note: Event attributes to be set for outgoing events. The CMEVT A ASYNC CPLT attribute must not be set. The default is CMEVT A SYNC ANY.
Property "bus sz" of type "uint32". Note: Specifies the size of the operation bus received on I POLY operation calls. The default is 0.
Property "copy out" of type "uint32". Note: (Boolean) When TRUE, the contents of the event bus following the CMEVENT-HDR portion are copied to the original operation bus before returning. The default is TRUE.

11.7. Properties (DM ND2P) Property "n ops" of type "uint32". Note: Specifies the maximum number of operations that can be invoked out the adapter's I_POLY output. This property is mandatory.
Property "ev-base" of type "uint32". Note: Event base used to generate event IDs for outgoing events and extract operation IDs for incoming operations. The default is 0x01000800.
11.8. Properties (DM BP2D) Property "n-ops" of type "uint32". Note: Specifies the maximum number of operations that can be invoked out the adapter's I_POLY output. This property is mandatory.
Property "ev-base" of type "uint32". Note: Event base used to generate event IDs for outgoing events and extract operation IDs for incoming operations. The default is 0x01000800.
Property "ev attr" of type "uint32". Note: Event attributes to be set for outgoing events. The CMEVT A ASYNC CPLT attribute must not be set. The default is CMEVT A SYNC ANY.
Property "bus sz" of type "uint32". Note: Specifies the size of the operation bus received on I POLY operation calls. The default is 0.
Property "copy out" of type "uint32". Note: (Boolean) When TRUE, the contents of the event bus following the CMEVENT-HDR portion are copied to the original operation bus before returning. The default is TRUE.
12. Encapsulated interactions None.
13. Specification 14. Responsibilities 1 . Convert all incoming operation calls to events and forward out the opposite terminal.
2. Convert all incoming events to operation calls out the opposite terminal.

15. Theory of operation 15.1. State machine None.
15.2. Mechanisms Conversion of l POLY calls to Events When either poly-to-drain adapter is invoked on its I-POLY input, it allocates an event bus with a size of CMEVENT-HDR + the value of the bus sz property. The event ID is calculated from the value of the ev-base property plus the v-table index of the operation being called. The event attributes are set to the value of the ev attr property.
The contents of the incoming bus are copied to the event bus and the event is sent out the I-DRAIN output. If the cpy out property is TRUE, the contents of the event bus are copied back to the operation bus before returning.
Conversion of Events to l POLY Operations When the drain-to-poly adapter is invoked on its I-DRAIN input, it invokes the operation on its I_POLY output specified by the value of the incoming event ID
less the value of the ev-base property. The adapter passes a pointer to the event bus data following the CMEVENT-HDR portion of the incoming event bus as the operation bus. If the incoming event bus is CMEVENT-HDR, DM-ND2P passes a NULL operation bus when invoking the operation through its I-POLY output.
DM D2M - l DlO to Memory Adapter Fig. 18 illustrates the boundary of the inventive DM D2M part.
DM-D2M is an adapter that translates I-DIO read and write operations invoked on its in terminal into I-BYTEARR read and write operations that are passed through the out terminal.
All other I-DIO operations invoked through the in terminal are not supported (CMST-NOT-SUPPORTED) unless otherwise specified (through a property).
DM-D2M is used for a simple translation of device read and write operations into memory byte-array operations. Most of the I DIO operation parameters are lost in the translation. If greater functionality is desired, DM D2M should not be used (instead use the I_DIO interface directly).
16. Boundary 16.1. Terminals Terminal "in" with direction "Bidir" and contract in: I DIO out: I DIO C.
Note: v-table, cardinality 1, synchronous I_DIO read and write operations invoked through this terminal are translated into I-BYTEARR operations and are passed through the out terminal. All other I_DIO operations are not supported (CMST-NOT_SUPPORTED) unless otherwise specified by the support open close property. Since all operations complete synchronously, the output side of in is not used. This terminal is ungaurded.
Terminal "out" with direction "Out" and contract I BYTEARR. Note: v-table, cardinality 1, synchronous All read and write operations invoked through in are translated into I-BYTEARR operations and are passed through this terminal.
16.2. Events and notifications None.
16.3. Special events, frames, commands or verbs None.
16.4. Properties Property "support open close" of type "UINT32". Note: If TRUE I DIO.open, I-DIO.close and I-DIO.cleanup are supported (i.e., DM_D2M returns CMST SUBMIT
on preview and CMST OK on submit). Default is TRUE.
17. Encapsulated interactions None.
18. Specification 19. Responsibilities Translate I-DIO.read and I-DIO.write operations invoked through the in terminal into I-BYTEARR.read and I-BYTEARR.write operations and pass them through out.

Fail all other I_DIO operations invoked through the in terminal with CMST-NOT-SUPPORTED unless otherwise specified by the support open close property.
20. Theory of operation 20.1. Mechanisms Translation of l DlO operations into l BYTEARR operations DM-D2M translates the following operations:
I DIO.read~ I BYTEARR.read I DIO.write ~ I BYTEARR.write All other I-DIO operations are not supported unless otherwise specified by the support open close property.
DM-D2M uses the fields of the incoming B-DIO bus to fill in the fields for the B BYTEARR bus without modification and makes the call. When the I BYTEARR
operation returns, DM-D2M returns the status from the operation.
OM Dl02/RP - Device //O to /RP Adapter Fig. 19 illustrates the boundary of the inventive DM-D1021RP part.
DM-D1021RP is an adapter that converts incoming EV-DIO-RQ XXX requests to EV-REQ-IRP requests suitable for submission to Windows NT/WDM kernel-mode drivers.
When submitting a request, DM D1021RP either allocates a new IRP or uses the IRP that is provided with the EV-DIO-RQ XXX request. When allocating a new IRP, DM-D1021RP determines the number of stack locations to provide based on the current values of its properties and initializes the IRP with the appropriate values provided in the EV-DIO-RQ XXX request.
21. Boundary 21.1. Terminals Terminal "dio" with direction "Bidir" and contract I-DRAIN. Note: Input for device I/O
(EV-DIO-RQ-XXX) requests and output for the completion events of those requests that are processed asynchronously. DM_D102IRP converts the request into an EV_REQ-IRP request (allocating and initializing an IRP if one is not provided) and forwards the request to its irp output.
Terminal "irp" with direction "Bidir" and contract I DRAIN. Note: DM D1021RP
sends converted Device I/O requests in the form of EV REQ IRP events out this terminal.
DM-D1021RP receives EV-REO.-IRP events on this terminal when asynchronous IRPs have been completed.
21.2. Events and notifications Incoming Event Bus Notes EV DIO RQ OPEN B EV D This event is received on the dio terminal.
DM_D1021RP requires this event to contain a valid IRP
since most drivers require this request to be generated by the operating system.
EV DIO RQ CLOS B EV D This event is received on E 10 the dio terminal.
DM D1021RP requires this event to contain a valid IRP
since most drivers require this request to be generated by the operating system.

Incoming Event Bus Notes EV DIO RQ CLEA B EV D This event is received on NUP 10 the dio terminal.
DM D1021RP requires this event to contain a valid IRP
since most drivers require this request to be generated by the operating system.
EV DIO RQ READ B EV D When this event is received on the dio terminal, DM-D1021RP generates an IRP with a major function code of IRP MJ READ.
EV DIO RQ WRIT B EV D When this event is received E 10 on the dio terminal, DM_D1021RP generates an IRP with a major function code of IRP MJ WRITE.
EV DIO RQ IOCT B EV D When this event is L 10 received, DM D1021RP
generates an IRP with a major function code of IRP MJ DEVICE CONTROL

Incoming Event Bus Notes EV DIO RQ INTE B EV D When this event is RNAL IOCTL 10 received, DM D1021RP
generates an IRP with a major function code of IRP MJ INTERNAL DEVIC
E CONTROL.
Note: DM-D1021RP sends completion events for EV-DIO RQ XXX requests out the dio terminal.
Outgoing Event Bus Notes EV REQ IRP B EV IR DM D1021RP sends this P event out its irp terminal to submit the generated IRP.
Note: DM-D1021RP receives EV_REQ-IRP completion events on its irp terminal.
21.3. Special events, frames, commands or verbs None.
21.4. Properties Property "n stk loc" of type "UINT32". Note: Number of stack locations to reserve in new IRP. This property is optional and activetime. The default value is 0.
Property "dev objp" of type "UINT32". Note: Pointer to device object to use when allocating new IRPs. This property is used only when n stk loc is zero. This property is optional and activetime. The default value is 0.
Property "force-new-irp" of type "UINT32". Note: Boolean: When TRUE, new IRPs are allocated and used regardless if an IRP is provided with the EV DIO RQ XXX
event. When FALSE, DM-D1021RP allocates and uses a new IRP only if one is not provided with the EV DIO RQ XXX event. The default is FALSE.
22. Encapsulated interactions DM_D1021RP is designed to operate within a Windows NT/WDM kernel mode driver. It uses the following system services when allocating new IRPs:

IoAllocatelrp() IoGetNextIrpStackLocation() IoFreelrp() 23. Specification 24. Responsibilities Convert EV-DIO_RQ XXX requests received on the dio terminal into EV-REQ-IRP
requests and send out the irp terminal.
Refuse EV DIO Ra OPEN, EV DIO R0. CLOSE, and EV DIO R0. CLEANUP when no IRP is provided. ' l0 Refuse EV-DIO_RQ XXX request if no IRP provided and the n stk-loc and dev objp properties are 0.
Set the async completion attribute of the EV REO. IRP request based on the completion nature of the EV-DIO-Ra XXX request.
Send EV DIO RQ XXX completion event out dio when EV REQ IRP event is received IS on irp.
25. Theory of operation Fig. 20 illustrates an advantageous use of the inventive DM_D1021RP part.
25.1. State machine None.
20 25.2. Mechanisms Allocating lRPs If DM-D1021RP receives an EV-DIO-RQ XXX request and there is no IRP
provided, DM-D1021RP will allocate an IRP for the outgoing EV_REO._IRP
request.
If an IRP is provided, DM-D1021RP uses that IRP when submitting the EV-REO._IRP
25 request.
If the force new irp property is TRUE, DM D1021RP allocates a new IRP
regardless if an IRP is provided with the EV-DIO_RQ XXX request.
Determining if /RP is available DM D1021RP checks if the DIO A NT IRP attribute is set in the EV DIO RQ XXX
30 bus to determine if the event contains a valid IRP. If the attribute is set, DM-D1021RP interprets the 'ctx' field of the event bus as a pointer to a valid NT
driver IRP associated with the event.
Determining number of stack locations DM-D1021RP uses one of two methods for~determining the number of stack locations to provide when allocating IRPs:
If the n stk_loc property is non-zero, DM-D1021RP reserves the number of stack locations specified by the property.
Otherwise, DM_D1021RP uses the device object pointer specified in its dev objp property to obtain the number of stack locations needed.
If a new IRP is needed and both DM-D1021RP's n stk-loc and dev objp properties are zero, DM-D1021RP fails the EV-DIO-RQ XXX request.
Completing EV DlO RQ XXX requests DM_D1021RP has no state, so in order to complete asynchronous EV-DIO-RQ XXX requests, DM-D1021RP allocates an extended bus for the outgoing EV_REQ-IRP request. The extended portiori of'the bus contains the following fields:
(1 ) A signature so that DM D1021RP can determine if the request was originated by it, (2) The pointer to the EV DIO RQ XXX event bus, and (3) A flag specifying if DM D1021RP allocated the IRP so that it may free it when the event completes.
Completion status propagation When DM_D1021RP services a synchronous device I/O request, it returns the return status from the EV-REQ-IRP request.
When DM-D1021RP services an asynchronous device I/O request, the completion status that it returns comes from the completion status of the EV REa IRP
event and not from the IRP itself.

25.3. Use Cases Submitting device //O requests DM-D1021RP along with DM-IRPOUT is useful when a part needs to initiate and submit a device 1/O request to a lower driver, but does not wish to deal with the complexities of allocating, initializing, and completing IRP.
DM A2K - ASCll to Keystroke Converter Fig. 21 illustrates the boundary of the inventive DM A2K part.
DM A2K converts data that it receives on its input into keystrokes that it sends out its output. Each key specified in the data will result in DM A2K sending at least two keystrokes out its out terminal (i.e., key down and key up) as if the key were actually pressed on the keyboard. For those keys that require multiple keystrokes (e.g., a capital letter or control key), DM A2K first outputs the "down"
keystrokes for each key followed by the "up" keystrokes in the reverse order.
Before processing any data, DM A2K sends a request for the current lock state out its out terminal. It uses the response to determine if SHIFT keystrokes need to be generated when outputting capital letters and if NUM LOCK keystrokes need to be generated when outputting keys on the numeric keypad.
By default, DM A2K does not interpret the data it receives on its input in any way. Each character is converted and output as is, meaning that only those keys that have a direct ASCII representation can be converted. DM A2K supports only the first 128 ASCII characters.
To provide support for those keys that do not have a direct ASCII
representation, DM A2K defines a simple syntax for describing the keys. The syntax is described later in this document.
26. Boundary 26.1. Terminals Terminal "in" with direction "In" and contract I_DRAIN (v-table). Note: Input for data that is to be converted to key strokes as if the data was typed on the keyboard.
Terminal "out" with direction "Out" and contract I-DRAIN (v-table). Note:
Output for keystroke events and requests for current shift and lock state.

Events and notifications Incoming Event Bus Notes EV MESSAGE B EV MS This event is received on G DM A2K's in terminal.
It contains data that is to be converted to key scan codes.
Outgoing Event Bus Notes EV KBD EVENT B EV KBD DM A2K sends this event out its out terminal. It contains a key scan code and a flag indicating whether the key is being pressed or released.

EV KBD GET STATB EV KBD DM A2K sends this E event out its out terminal to request the current lock state (i.e., CAPS LOCK, NUM
LOCK, and SCROLL
LOCK).
Special events, frames, commands or verbs ASCii representation syntax The following tables describe the set of keys that is supported by DM A2K. The first table provides the string representations for the keys that cannot be specified by a single ASCII character. The second table describes those characters that can be specified by a single ASCII character.

Non-ASCII Keys Key Description ASCII Representation Control Break CTL-BRK

Backspace key BKS

SPACE key SP

Tab TAB

ENTER key ENTER

Left SHIFT key LSHFT or SHFT

Right SHIFT key RSHFT .

Left CTL key LCTL or CTL

Right CTL key RCTL

Left ALT key LALT or ALT

Right ALT key RALT

PAUSE key PAUSE

CAPS LOCK key CAPLK

ESC key ESC

PAGE UP key PUP

PAGE DOWN key PDN

END key END

HOME key HOME

LEFT ARROW key LARW

UP ARROW key UARW

RIGHT ARROW key RARW

DOWN ARROW key DARW

PRINT SCREEN key PRSCR

INSERT key INS

DELETE key DEL

Left Windows key (Microsoft . LWIN
Natural Keyboard) Key Description ASCII Representation Right Windows key (MicrosoftRWIN

Natural Keyboard) Application Key (MicrosoftAPP

Natural keyboard) Numeric keypad keys NO ... N9 MULTIPLY key (numeric keypad)NMUL

ADD key (numeric keypad NADD

SEPERATOR key (numeric NSEP

keypad) SUBTRACT key (numeric keypad)NSUB

DECIMAL key (numeric keypad)NDEC

DIVIDE key (numeric keypad)NDIV

Function keys F1 ... F12 NUM LOCK key NUMLK

SCROLL LOCK key SCRLK

ASCII Keys Description ASCII Character Number keys 0 ... 9 Letter keys A ... Z, a... z Punctuation and other characters ' ~ ! @ # S % " &
(space is also in this list) ) - - - + { } ~ ; : ' " , < . > /?
Special characters used by f ] \
DM A2K when parsing the ASCII
string.
The data received with the EV-MESSAGE event contains the following types of fields:
~ Literal characters - ASCII characters that are output as is ~ Special keys - control and special key strokes that don't have ASCII
representations The following table gives a brief description of the different field types and a short example.
Field Example Description Type literal L A literal is fixed data (ASCII

character) that is converted directly to a scan code without further interpretation (except for the current caps lock state).

escape \x20 An escape mechanism to literal \\ specify literal characters that \ < lit \f are recognized by DM
> A2K

\] when parsing the ASCII
string /e.g., f, 1, U or control characters that do not have text representation.
When the < lit > portion of the field is any character except 'x', DM A2K declares the character as a literal.
When the first character following the '\' is an 'x', DM A2K interprets the following two characters as the hexadecimal equivalent of a literal.

Field Type Example Description special key fALT-F]A special key field is an ASCII

[ < key > 1 fCTL-ALT-representation of key strokes F] that either have no ASCII code [TAB] /e.g., shift, CTL-ALT-DEL) or are commonly used control keys (e.g., tab, escape, enter).

The square brackets are required.

The < key > portion of the field is depicted by one or more key representations separated by '-'.

Keys may be specified in any order; the same key cannot be specified more than once in the field.

A maximum of 4 keys may be specified within the brackets and no nesting of special keys is allowed.

Properties Property "do special" of type "uint32". Note: Boolean: When TRUE, DM A2K
recognizes the ASCII representation of the non-ASCII characters contained in square brackets. The default value is FALSE.
Property "do escape" of type "uint32". Note: Boolean: When TRUE, DM A2K
recognizes the escape literal field described above. The default value is FALSE.

Encapsulated interactions DM A2K relies on the following C-runtime library functions: strtoul and strspn.
Implementations of these functions must be provided by the driver (using DM
A2K) in order to properly use DM A2K. A driver may fail to compile or load if the proper implementations of these functions are not available.
1. Specification Responsibilities 1 . Interpret data received on the in terminal based on do special and do escape properties and convert the data into a series of keystrokes, as if the keys were l0 typed on the keyboard, and send out the out terminal.
2. Interpret the current state of the CAPS LOCK key to determine if SHIFT
keystrokes should be generated.
3. Interpret the current state of the NUM LOCK key to determine if the NUM
LOCK
keystrokes need to be generated when outputting keystrokes for keys on the numeric keypad.
4. Assume that the CAPS, NUM, and SCROLL LOCK indicators are off if the EV KBD GET STATE request fails.
Theory of operation Fig. 22 illustrates an advantageous use of the inventive DM A2K part.
State machine None.
Main data structures ascii2scan table DM A2K uses a static table that contains the following information for each ASCII character ~ the key scan code, ~ whether a SHIFT, CTL, or ALT keystroke needs to be generated in addition to the key.
~ whether the NUM LOCK needs to be on ~ whether the character is an alphabetic character The ASCII character itself is the index into this table.
string2scan DM A2K uses an additional table to map the special key representations to their corresponding scan codes. DM A2K searches this table synchronously based on the string representation.
key stack and key queue DM A2K implements a small queue and a stack that it uses to output all keystrokes. Key down events are stored on the key queue and their corresponding key up events are simultaneously pushed onto the key stack. This ensures that the key up events are sent in the proper order when more than one keystroke is sent /e.g., to output an 'A', send "SHIFT down", "'a' down", "'a' up", "SHIFT up") The size of the queue and stack are based on the following criteria:
~ A key sequence specified in square brackets (i.e., special keys) cannot be more than 4 keys, ~ Each key can potentially be accompanied by a SHIFT, CTL, or ALT keystroke or a maximum of 4 keys in a single key sequence.
~ Each key has the potential to be preceded by a NUM LOCK on keystroke and followed by a NUM LOCK off keystroke.
~ Each key requires two keystrokes: "key down" and "key up".
Therefore, the queue has a maximum size of 4 ~" 4 + 4 '~ 4 = 32 and the stack has a depth of 8, which is the number of potential "key up" keystrokes for the keys (not including the NUM LOCK keystrokes).
Mechanisms Determining if SHIFT keystroke should be sent DM A2K outputs a SHIFT keystroke under the following conditions:
~ If the key is a lowercase letter and the CAPS LOCK is not on ~ If the key is an uppercase letter and the CAPS LOCK is off ~ If the key is not a letter and requires a shift. In this situation, DM A2K
ignores the state of the CAPS LOCK.

~ If the SHIFT key is explicitly specified in a special key field. In this situation, DM A2K ignores the state of the CAPS LOCK.
Outputting keystrokes When DM A2K receives an EV-MESSAGE event on its in terminal, it first requests the current shift and lock state by sending an EV_KBD_GET STATE
request out its out terminal. If the request fails, DM A2K assumes that the CAPS, SCROLL, and NUM LOCK LED indicators are not on.
DM A2K then synchronously scans the data. For each literal found, DM A2K
performs the following tasks:
~ Uses the character to index into its ascii2scan table and retrieves the scan code ~ Puts any required SHIFT or CTL key down event onto DM A2K's queue and pushes the corresponding key up event onto DM A2K's key stack.
~ Put the "key down" event onto the queue and push the corresponding "key up"
event onto the key stack.
~ Pops each "key up" event from the key stack and puts the event onto the queue.
~ Output all keystrokes that are on the queue thereby emptying the queue.
If DM A2K is configured to interpret escape characters (i.e., its do escape property is set to TRUE), DM A2K converts the escape representation into a character and performs the same sequence of operations described above.
If DM A2K is configured to interpret special keys (i.e., its do special property is set to TRUE), DM A2K searches its string2scan table for the string representation and outputs the appropriate keystrokes. The sequence of tasks is the same for a literal except that DM A2K may turn the NUM LOCK on or off by sending key down and key up keystrokes as required by the key.
After the keystrokes for the key have been outputted and DM A2K toggled the NUM LOCK, the NUM LOCK state is restored.
Handling errors and overflow DM A2K may encounter any of the following errors:
~ ASCII character specified in data is above 127 /i.e., size of the ascii2scan table) ~ Hexadecimal representation specified by "\xhh" is not a valid hexadecimal value (i.e., 'h' is not a hexadecimal digit) ~ Text representation of non-ASCII and control keys is unknown ~ DM A2K encounters a stack or queue overflow.
When DM A2K encounters an error, it will discontinue further processing of the data, discard any keystrokes currently on its queue and stack, and return a bad status.
Use Cases Emulating keystrokes DM A2K provides an operating system-independent interface by which to generate keystrokes from ASCII text. The KBD part connected to DM A2K's output provides the operating system-dependent mechanism for feeding keystrokes into the Windows keyboard buffer as if the keys were actually typed by the user.
DM /ES - Idle to Event Source Adapter Fig. 23 illustrates the boundary of the inventive DM_IES part.
DM-IES is an adapter that makes it possible to connect parts that rely on idle generation (i.e., DM-DWI) to event sources (i.e., DM-EST).
DM-IES converts EV-REQ-ENABLE and EV-REQ-DISABLE requests received on its idle terminal into arm and disarm operation calls through its evs terminal. DM IES
returns'CMST NOT SUPPORTED for all other events received on idle.
When the event source connected to evs fires (by invoking the fire operation on evs), DM-IES continuously generates EV-IDLE events through idle until CMST-NO ACTION is returned from the idle processing or an EV-REa-DISABLE
request is received. This allows, for example, a part connected to the idle terminal to pump events through a system.
DM-IES passes NULL buses with the arm and disarm operations. DM IES
expects that the event source connected to the evs terminal has sufficient defaults in order to handle this situation.

1. Boundary 1.1. Terminals Terminal "idle" with direction "Plug" and contract I_DRAIN. Note: v-table, cardinality 1, synchronous, unguarded The requests EV REQ ENABLE and EV REQ DISABLE
are expected to be received on this terminal. DM IES sends EV IDLE events out this terminal in response to fire operation calls invoked through the evs terminal from an event source.
Terminal "evs" with direction "Bidir" and contract "In: I EVS R Out: I EVS".
Note: v-table, cardinality 1, synchronous, unguarded DM_IES invokes the arm and disarm operations through this terminal in response to receiving EV-REQ_ENABLE
and EV-REQ-DISABLE requests from the idle terminal respectively. DM-IES sends EV_IDLE events out the idle terminal in response to fire operation calls invoked through this terminal from an event source.
1.2. Events and notifications Incoming Event Bus Notes EV-REQ_ENAB CMEVENT- This request is expected to LE HDR be received on the idle terminal.
In response to this request, DM IES invokes the arm operation through the evs terminal.

Incoming Event Bus Notes EV-REQ-DISA CMEVENT- This event is expected to BLE HDR be received on the idle terminal.
In response to this request, DM IES invokes the disarm operation through the evs terminal and halts any idle generation from a previous fire.
1.3.
Outgoing Bus Notes Event EV-IDLE CMEVENT- This event is sent through HDR the idle terminal.
EV_IDLE is generated by DM IES when the fire operation is invoked through the evs terminal.
1.4. Special events, frames, commands or verbs None.
1.5. Properties Property "force free" of type "UINT32". Note: Set to TRUE to free self-owned events received from the idle terminal. Default: FALSE.
2. Encapsulated interactions l0 None.

3. Specification 4. Responsibilities 1. In response to receiving EV_REQ_ENABLE and EV-REQ-DISABLE
requests on the idle terminal, invoke the arm and disarm operations on the evs terminal respectively.
2. Return CMST NOT SUPPORTED for unknown events received on the idle terminal.
3. In response to fire operation calls through the evs terminal, generate EV-IDLE requests through idle until CMST-NO ACTION is returned from the idle processing or an EV-REQ_DISABLE request is received.
4.1. State machine None.
4.2. Main data structures None.
4.3. Mechanisms Generating EV iDLE events in response to "file" operations After an EV REQ ENABLE request is sent to DM IES and the event source is armed, DM-IES does nothing until the event source fires at a later time.
When the fire operation is invoked through evs, DM_IES continuously generates EV-IDLE events through idle until CMST-NO ACTION is returned from the idle processing or an EV-REQ-DISABLE request is received.
DM-IES does not support fire previews. See the I_EVS interface for more information.
DM IES does not rely on any parameters passed with the fire operation.
Note if DM-IES is disabled and then enabled directly afterwards (while in the context of handling an EV-IDLE event from DM_IES), DM-IES will continue to generate idle events.

4.4. Use Cases Fig. 24 illustrates an advantageous use of the inventive DM_IES part.
Using DM /ES to create a thread based pump for event distribution Please refer to the DM-DWI and DM-EST documentation for details on how they work.
1 . The structure in figure 2 is created, connected, and activated.
2. Events, requests and notifications are sent through the in terminal of DM DWI.
3. DM-DWI enqueues the events and issues an EV-REQ-ENABLE
request through its idle terminal (only for the first event received).
4. DM_IES receives the enable request and invokes the arm operation through its evs terminal. DM-IES propagates the return status of the operation back to DM-DWI. (This use case assumes the arm operation completed successfully). The event source is armed and will fire according to its default settings.
5. DM-EST eventually fires by invoking the fire operation through its evs terminal.
6. DM_IES receives the fire operation call and generates EV-IDLE
events through the idle terminal until CMST NO ACTION is returned.
7. For each idle event received, DM-DWI dequeues an event and sends it through the out terminal. DM-DWI returns CMST-OK as long as there are more events to send out on its queue.
8. Part A receives the events from DM DWI and handles them accordingly.
9. Eventually, DM-DWI's queue becomes empty and it sends an EV-REQ_DISABLE request through its idle terminal and returns CMST_NO ACTION in response to the last EV-IDLE event.
10. DM-IES receives the disable request and disarms the event source by invoking the disarm operation through the evs terminal.

1 1. In response to the CMST-NO ACTION return status, DM_IES stops generating EV-IDLE events, sets the completion status to CMST OK, and returns control back to the event source (by returning from the fire operation call).
12. Steps 2-1 1 may be repeated again once another event is sent to DM DWI.
DM PLT - PnP-to-LFC Event Translator Fig. 25 illustrates the boundary of the inventive DM-PLT part.
DM-PLT translates the Plug-n-Play IRP events (EV_REQ-IRP) coming on its in terminal into life-cycle (LFC) events (EV-LFC xxx) and forwards these through its out terminal.
Life-cycle events can be completed asynchronously. DM-PLT will complete the IRP event whenever the respective life-cycle event completes. If completion of the life-cycle event is not detected in certain period of time, DM-PLT will automatically 15' complete the IRP event with CMST TIMEOUT.
To complete the IRP event, DM PLT will send EV REO. IRP event with CMEVT A COMPLETED attribute set back to in.
5. Boundary 5.1. Terminals Terminal "in" with direction "Plug" and contract I DRAIN. Note: IRP events (EV-REQ-IRP). All events that come at this terminal are completed asynchronously.
The back channel of this terminal is used for completion events only. Can be connected at Active Time.
Terminal "out" with direction "Plug" and contract I-DRAIN. Note: Life-cycle events.
The back channel is used for completion events only. Can be connected at Active Time.

Events and notifications passed through the "in" terminal Incoming Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
P needs processing.
Outgoing Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
P processing has completed.
This event is a copy of the event that was processed asynchronously with CMEVT A COMPLET
ED attribute set.
1.1. Events and notifications passed through the "out"
terminal Outgoing Event Bus Notes EV-LFC_REQ START B-EV-L Request to start FC normal operation.

EV_LFC-REQ STOP . B_EV-L Request to stop FC normal operation.

EV-LFC-REQ-DEV-PAU B-EV-L Request to put the SE FC device in a "paused"

state.

EV-LFC_REQ-DEV-RES B-EV-L Request to revert the UME FC device from "paused"

state to normal.

Outgoing Event Bus Notes EV LFC NFY DEV REM B EV L Notification that the OVED FC device has been removed.
1.2. Special events, frames, commands or verbs Upon receiving EV_REQ_IRP event on its in terminal, DM_PLT performs a secondary dispatch by IRPs minor function code for PnP IRPs (IRP MJ PNP).
For details on the expected order of IRP events and the order of outgoing LFC
events, see the DM PNS sheet.
1.3. Properties Property "cplt tout" of type "UINT32". Note: LFC completion timeout in miliseconds.
Redirected to subordinate TMR, property time. Default: 3000 2. Encapsulated interactions DM-PLT is an assembly and does not utilize such interactions. Its subordinates, however, may do so, depending on their implementation. For more information on the subordinates, please refer to the data sheets of:
DM EVT
DM PNS
3. Internal Definition Fig. 26 illustrates the internal structure of the inventive DM_PLT part.
Theory of operation DM_PLT is an assembly. The main goal of this assembly is to enhance the functionality of the DM-PNS (PnP-to-LFC State Machine) part with timeout capabilities and provide a simpler boundary.
The assembly uses a standard part DM-EVT to provide timer event to DM-PNS
and a Event Stopper (DM STP - standard part) to disable the flow control capabilities of DM PNS.

Subordinate Parameterization Subordinate ~ Property Value tmr time 3000 DM ERC - Event Recoder Fig. 27 illustrates the boundary of the inventive DM-ERC part.
DM_ERC is used to remap event IDs and attributes in an event flow. The event IDs and attributes to be remapped are specified as properties.
When DM ERC receives an event on its in terminal, it first checks if the event ID
needs to be remapped. If so, the event ID is remapped according to the out base property. Second, DM-ERC checks if the event attributes need to be remapped.
If so, DM-ERC remaps the attributes and then passes the event through the out terminal.
1. Boundary 1.1. Terminals Terminal "in" with direction "In" and contract I-DRAIN. Note: Synchronous, v-table, infinite cardinality, floating The attributes and event IDs of the incoming events are remapped (if needed) and are passed through out. This terminal is unguarded.
Terminal "out" with direction "Out" and contract I-DRAIN. Note: Synchronous, v-table, cardinality 1, floating Events received from the in terminal are remapped (if needed) and are passed out this terminal. This terminal is unguarded.
1.2. Events and notifications DM-ERC is parameterized with the event IDs of the events passed through out.
If needed, DM_ERC remaps the incoming events and their attributes and passes them through out.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "in-base" of type "UINT32". Note: Base ID for incoming events.
Default is 0.

Property "out_base" of type "UINT32". Note: Base ID for outgoing events.
Default is 0.
Property "n events" of type "UINT32". Note: Number of events to remap, starting from xxx base. Default is 0.
Property "attr mask" of type "UINT32". Note: Event attribute mask of event attributes to remap. Default is 0.
Property "attr val" of type "UINT32". Note: Event attribute values of event attributes to remap. Default is 0.
Property "and attr" of type "UINT32". Note: Event attributes that are ANDed with the incoming event's attributes. Used only if the event's attributes are to be remapped. Default is OxFFFFFFFF.
Property "or attr" of type "UINT32". Note: Event attributes that are ORed with the incoming event's attributes. Used only if the event's attributes are to be remapped.
Default is 0.
Property "xor attr" of type "UINT32". Note: Event attributes that are XORed with the incoming event's attributes. Used only if the event's attributes are to be remapped. Default is 0.
Property "enforce const" of type "UINT32". Note: If TRUE, DM-ERC does not modify constant events (CMEVT A CONST attribute is enforced). Attempts to do so result in an CMST REFUSE status. If FALSE, DM ERC modifies the event without consideration of the constant attribute. Default: TRUE.
Property "force free" of type "UINT32". Note: Set to TRUE to free self-owned events received from the in terminal. Default: FALSE.
2. Encapsulated interactions None.
3. Specification 4. Responsibilities 1. Remap the incoming event ID if needed (as specified by properties).

2. Remap the incoming event attributes if needed (as specified by properties).
3. Refuse to remap any events that have the constant (CMEVT A CONST) attribute set only if the enforce const property is TRUE.
5. Theory of operation 5.1. State machine None.
5.2. Main data structures None.
5.3. Mechanisms Remapping Event /Ds The incoming event IDs to be remapped are specified by setting the in base, out-base and n events properties. The event ID is remapped if it falls in the range of in base...in base + n events-1.
The outgoing event ID is calculated by using the out base and in-base properties.
The formula for calculating the outgoing event ID is: out base + (incoming event ID
- in-base). There is a one-to-one correspondence between the incoming event IDs and the outgoing event IDs generated by DM ERC.
Remapping Event Attributes The incoming event attributes to be remapped are specified by setting the attr mask and attr val properties. DM ERC performs a bit-wise AND between the event attributes and the value of attr mask; the result is then compared to attr val.
If there is an exact match, the attributes are remapped according to the and attr, or attr and xor attr properties.
If in-base is non-zero, attributes are considered for remapping only if the ID
of the incoming event falls in the range in base...in base + n events-1.
If in-base is zero, the event attributes are always remapped as long as they meet the criteria described above.

Use Cases Remapping a single event /D

1. DM_ERC is created and parameterized with the following:

a. in base = 0x222 b. out base = 0x333 c. n events = 1 2. DM ERC is activated.

3. An event with the ID of 0x222 is passed to DM-ERC
through its in terminal.

4. DM-ERC remaps the event ID to 0x333 and passes it through its out terminal.

5. DM ERC does not modify the event attributes.

6. Steps 3-4 may be repeated several times.

7. DM ERC is deactivated and destroyed.

Remapping range of event /Ds a 1. DM-ERC is created and parameterized with the following:

a. in base = 0x222 b. out base = 0x333 c. n events = 5 2. DM ERC is activated.

3. Events with the IDs of Ox222..Ox226 are passed to DM ERC

through its in terminal.

4. DM ERC remaps the event IDs to Ox333..Ox337 and passes them through its out terminal.

5. DM ERC does not modify the event attributes.

6. Steps 3-4 may be repeated several times.

7. DM ERC is deactivated and destroyed.

Modifying event attributes 1 . DM_ERC is created and parameterized with the following:

a. attr-mask = CMEVT A SYNC ~ CMEVT A ASYNC

b. attr val = CMEVT A SYNC
c. or attr = CMEVT A ASYNC
d. and attr = ~ CMEVT A SYNC
2. DM ERC is activated.
3. An event with the any event ID and attribute CMEVT A SYNC is passed to DM-ERC through its in terminal.
4. DM_ERC does not modify the event ID.
5. The event attribute matches (event attr & attr mask = = attr val) so DM-ERC modifies the attributes by doing the following:
a. Adds the CMEVT A ASYNC attribute (ORing or attr) b. Removes the CMEVT A-SYNC attribute (ANDing and attr) The effect is converting the discipline for the distribution of the event from synchronous to asynchronous.
6. DM_ERC passes the event through its out terminal.
7. Steps 3-6 may be repeated several times.
8. DM-ERC is deactivated and destroyed.
Modifying event attributes of a specific event 1. DM-ERC is created and parameterized with the following:
a. in base = 0x222 b. out base = 0x222 c. n events = 1 d. attr mask = CMEVT A SYNC ~ CMEVT A ASYNC
e. attr val = CMEVT A SYNC
f. or attr = CMEVT A ASYNC
g. and attr = ~ CMEVT A-SYNC
2. DM ERC is activated.
3. An event with an ID of 0x222 and attribute CMEVT A SYNC is passed to DM ERC through its in terminal.
4. DM-ERC does not modify the event ID.

5. The event attribute matches (event attr & attr mask = = attr val) so DM-ERC modifies the attributes by doing the following:
a. Adds the CMEVT A ASYNC attribute (ORing or attr) b. Removes the CMEVT A_SYNC attribute (ANDing and attr) The effect is converting the discipline for the distribution of the event from synchronous to asynchronous.
6. DM-ERC passes the event through its out terminal.
7. Steps 3-6 may be repeated several times.
8. DM-ERC is deactivated and destroyed.
Remapping both an event's /D and attributes 1. DM_ERC is created and parameterized with the following:
a. in base = 0x100 b. out base = 0x200 c. n events = 1 d. attr mask = CMEVT A SYNC
e. attr val = CMEVT A SYNC
f. or attr = CMEVT A ASYNC
g. and attr = ~ CMEVT A SYNC
2. DM ERC is activated.
3. An event with the ID of 0x100 and attribute CMEVT A SYNC is passed to DM-ERC through its in terminal.
4. DM ERC remaps the event ID to 0x200.
5. The event attribute matches so DM ERC modifies the attributes by doing the following:
a. Adds the CMEVT A ASYNC attribute (ORing or attr) b. Removes the CMEVT A SYNC attribute (ANDing and attr) The effect is converting a synchronous event to an asynchronous event.
6. DM-ERC passes the event through its out terminal.
7. Steps 3-6 may be repeated several times.

8. DM-ERC is deactivated and destroyed.
DM STX - Status Recoder Fig. 28 illustrates the boundary of the inventive DM STX part.
DM STX is used to recode return statuses in an event channel.
DM-STX forwards all events received on the in terminal through the out terminal.
DM-STX propagates all return status codes back to the original caller with the exception of one - this status is recoded using the values of the s1 and s2 properties.
Cascaded DM STX's can be used to recode more than one return status.
The events are not interpreted by DM STX.
The terminals are unguarded providing maximum flexibility in their use.
1. Boundary 1.1. Terminals Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, infinite cardinality, synchronous, unguarded Events received from this terminal are forwarded through the out terminal. The event is not interpreted by DM STX.
Terminal "out" with direction "Out" and contract I DRAIN. Note: v-table, cardinality 1, synchronous, unguarded Events received through the in terminal are forwarded through this terminal. The event is not interpreted by DM STX.
1.2. Events and notifications Events received on the in terminal are forwarded through the out terminal.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "s1 " of type "UINT32". Note: Mandatory. This is the status that DM
STX
will recode to s2 if it is returned from the event processing from the out terminal.
Property "s2" of type "UINT32". Note: Mandatory. This is the status that DM
STX
returns (to the counter terminal of in) if the return status from the event processing 3o from the out terminal is s1.

2. Encapsulated interactions None.
3. Specification 4. Responsibilities 1. Recode the event processing return status s1 (from the out terminal) to s2.
2. Forward all events received from the in terminal through the out terminal.
4.1. Use Cases Fig. 29 illustrates an advantageous use of the inventive DM_STX part.
Fig. 30 illustrates an advantageous use of the inventive DM STX part.
Using DM STX to recode a return status 1. Part A, Part B and DM STX are created.
2. DM STX is parameterized with s1 = CMST NO ACTION and s2 =
CMST OK.
3. All the parts are activated.
4. Part A sends an event through its out terminal.
5. DM STX receives the event on its in terminal and forwards it through the out terminal.
6. Part B receives the event and returns CMST NO ACTION.
7. DM STX receives the CMST NO ACTION return status and returns CMST OK.
8. Part A receives the CMST OK status from the event processing and continues execution.
9. Steps 4-8 are executed again, this time Part B returns CMST-FAILED. DM STX propagates the CMST_FAILED status back to Part A.

Using cascaded status recoders This use cause demonstrates the usage when there is a need to recode different statuses along the same channel. In this example, 3 status recoders are cascaded -one for each of 3 status' that are recoded to a different status if returned from the event processing on Part B.
1. The structure in figure 5 is created, parameterized, and activated.
2. Part A sends an event to the first status recoder. The recoder passes it through the out terminal.
3. The second recoder receives the event and passes it through the out terminal.
4. The third recoder receives the event and passes it through the out terminal.
5. Part B receives the event and returns CMST NO ACTION. Control is returned to the second recoder.
6. The second recoder receives the CMST NO ACTION return status and returns CMST OK.
7. Part A receives the CMST OK status from the event processing, and continues execution.
DM ACT - Asynchronous Completer Fig. 31 illustrates the boundary of the inventive DM ACT part.
DM ACT is an adapter that converts synchronously completed events on its out terminal into events that complete asynchronously on in.
Events that complete asynchronously on out are simply passed through with no modification.
5. Boundary 5.1. Terminals Terminal "in" with direction "Plug" and contract I-DRAIN. Note: Incoming events are received here.
Terminal "out" with direction "Plug" and contract I-DRAIN. Note: Outgoing events are sent through here.

5.2. Properties Property "cplt s offs" of type "UINT32". Note: Offset in bytes of the completion status in the event bus. Mandatory.
Property "enforce async" of type "UINT32". Note: Boolean. Set to TRUE to enforce that the incoming events allow asynchronous completion. If TRUE and the incoming event does not allow asynchronous completion, CMST REFUSE is returned as an event distribution status.
6. Encapsulated interactions None.
7. Specification 8. Responsibilities 1. Transform synchronous completion of an outgoing event into asynchronous completion of the incoming event that generated the former.
9. Theory of operation 9.1. Mechanisms Transformation of Synchronous Completion to Asynchronous one Sending a completion event back to the channel that originated the event within the input call simulates asynchronous completion.
This feature is used by DM ACT to transform synchronous completion of events on its out terminal to events completing asynchronously on in.
DM ACT passes all incoming events through its out terminal and for those that return distribution status different than CMST-PENDING (synchronous completion), DM ACT stores this status at the completion status field in the event bus (the same one passed on in) and returns CMST-PENDING. The storage for the completion status field is computed from cplt s offs property and the event bus pointer.
For events that when passed to out, naturally complete asynchronously (by returning CMST-PENDING), DM ACT does not do anything and is only a pass-through channel.
DM SFMT- String Formatter Fig. 32 illustrates the boundary of the inventive DM SFMT part.

DM-SFMT modifies a string in the incoming bus by adding a prefix and/or suffix to it and passes the operation to out. The input bus may be restored before DM SFMT returns from the operation.
10. Boundary 10.1. Terminals Terminal "in" with direction "in" and contract I POLY. Note: v-table, infinite cardinality. Add prefix and suffix to string in bus and forward operation to out.
Terminal "out" with direction "out" and contract I_POLY. Note: Output for operations containing modified strings.
l0 10.2. Events and notifications None.
10.3. Special events, frames, commands or verbs None.
10.4. Properties Property "offset" of type "UINT32". Note: Offset of string in event bus. The default value is 0x00.
Property "by ref" of type "UINT32". Note: (boolean) If TRUE, the string in the bus is by reference. If FALSE, the string is contained in the bus. The default value is FALSE.
Property "max size" of type "UINT32". Note: Maximum number of characters that may be stored at offset if string is contained in the bus The default value is 0 - no maximum.
Property "prefix" of type "ASCIZ". Note: Prefix to be added to incoming string. The default value is "".
Property "suffix" of type "ASCIZ". Note: Suffix to be added to incoming string. The default value is "".
Property "undo" of type "UINT32". Note: (boolean) If TRUE, the change to the bus will be restored before returning from the operation. The default is FALSE.
11. Encapsulated interactions None.

12. Specification 13. Responsibilities 1. Add prefix and suffix to string in bus for operations received on in and forward the operation with modified bus to out.
2. Restore bus to original contents before returning from call if undo is TRUE.
14. Theory of operation 14.1. State machine None.
14.2. Mechanisms Dereferencing String If the by ref property is FALSE, then the offset in the bus is treated as a byte location representing the first character of the string. If the by-ref property is TRUE, then the offset is treated as a DWORD value that represents the pointer to the string.
Handing strings contained in the bus When DM-SFMT is invoked on an operation, it first calculates the length of the new string. If the length of the new string is greater than the value of the max size property, DM-SFMT writes debug output to the debug console and fails the operation. If there is space, DM-SFMT modifies the string (in place) in the bus by adding the prefix and/or suffix, and forwards the operation to its out output.
Upon return DM_SFMT restores the original string(in place) if undo is set and returns the status from the call to out.
Handing strings by reference When DM_SFMT is invoked on an operation that contains a string by reference, it saves the pointer to the original string in the bus so that it may restore it later.
DM-SFMT allocates a new buffer, adds the prefix and suffix to the string, stores the pointer in the bus, and forwards the operation to out.
If DM SFMT is unable to allocate the necessary memory, it writes debug output to the debug console and fails the operation.
Upon return, DM SFMT frees its allocated string, restores the saved pointer in the bus, and returns the status from the call to out if undo is set.

If the operation returns CMST-PENDING (indicating that the operation is going to be completed asynchronously), DM SFMT doesn't free the allocated string, displays debug output, and returns the same status.
Distributors DM EVB - Event Bus Fig. 33 illustrates the boundary of the inventive DM-EVB part.
The primary function of DM-EVB is to distribute incoming events to all parts connected to its terminals. A special discipline of distribution is followed:
an incoming event is optionally sent for preview (if do pview property is TRUE), if that is successful (return status equals status specified by pview st ok), the event is distributed among the recipients. The participants can be connected to two terminals for event distribution: dom and evt. The dom terminal accepts only one connection, as the intent is this terminal to be connected to a dominant. The evt terminal has unlimited cardinality and can be used for connecting subordinate parts. This terminal can be connected at active time; that allows it to be connected to dynamically created parts.
The part connected to the dom terminal is guaranteed to receive the incoming events either before or after the parts connected to evt terminal. The "before" or "after" decision is based on the value of dom first property. The order of distribution among the parts connected to the evt terminal is not guaranteed.
DM-EVB optionally desynchronizes all incoming events before sending them out through the dom and evt terminals. This is controlled by the sync property.
If no explicit parameterization is used, DM-EVB will skip the preview; it will desynchronize and distribute all incoming events first to all the parts connected to the evt terminal and then to the part connected to the dom terminal.
1. Event bus notation The horizontal line represents the DM-EVB part. The labels on the line represent the names of the DM-EVB terminals. The line emanating from the pview label represents a unidirectional connection. The line emanating from the dom label 3o represents' a bi-directional connection between DM EVB and the dominant.
The remaining lines emanating from the event bus are bi-directional connections between DM_EVB's evt terminal and other parts.
The name of the evt terminal may be omitted; any connection to and from the bus, that doesn't have a terminal label next to it, is assumed to be through the evt terminal.
Fig. 34 illustrates an advantageous use of the inventive DM EVB part.
2. Boundary 2.1. Terminals Terminal "evt" with direction "Bi, In or Out" and contract I DRAIN . Note: v-table, distinguishable connections, infinite cardinality, synchronous, active-time.
General-purpose distribution terminal.
Terminal "dom" with direction "Bi" and contract I-DRAIN . Note: v-table, cardinality 1, floating, synchronous. Terminal for distributing events to the dominant ' (assembly).
Terminal "pview" with direction "Out" and contract I DRAIN . Note: v-table, cardinality 1, floating, synchronous. Preview output. Events are sent synchronously through this terminal before they are desynchronized and distributed further.
The status returned by sending the event through this terminal determines whether a particular event will be distributed further or not. If the return status is the one specified by pview st ok then the event distribution continues; otherwise the event is ignored and not distributed through any of the other terminals.
Note Although the evt terminal is a bi-directional terminal, it will accept a connection in any direction: in, out or bi-directional.
2.2. Events and notifications Incoming Bus Notes Event < all > CMEVENT By default all incoming HDR events are distributed first /CMEvent to all recipients connected Incoming Bus Notes Event to the evt terminal and then to the one connected to the dom terminal.
The dom first property can reverse this behavior.
The distribution can be prevented .if:
1. the preview is enabled (do pview property) AND
2. the pview terminal is connected and preview operation returns value different than the one set to the pview st ok property.
Outgoing Bus Notes Event < all > CMEVENT See above.
HDR
/CMEvent 2.3. Special events, frames, commands or verbs None.
2.4. Properties Property "sync" of type "UINT32". Note: Boolean. When TRUE, DM EVB distributes all incoming events synchronously in the thread of the caller. Default is FALSE.

Property "dom first" of type "UINT32". Note: Boolean. When TRUE, DM EVB
distributes the incoming events to the dominant (dom terminal) first and then to all remaining recipients (evt terminal). Default is FALSE.
Property "do pview" of type "UINT32". Note: Boolean. When TRUE, DM EVB first sends the event synchronously through the pview terminal and, if the status returned matches pview st ok, it distributes the event further through dom and evt terminals.
Default is FALSE.
Property "pview st ok" of type "UINT32". Note: Only the low-order 16 bits are used. This is the status that indicates whether the preview operation is successful or not. If the status returned by the output through pview terminal matches the value set in this property, this is an indication of success for the purposes of further event distribution. Default is CMST OK.
Property "detect" of type "UINT32". Note: Boolean. When TRUE, DM-EVB attempts to detect changes in the bus after distributing the event to each recipient.
In general, setting this property to TRUE will slow down the operation of DM EVB. The intended use of this property is for debugging purposes. Default is FALSE.
Property "enforce" of type "UINT32". Note: Boolean. When TRUE, DM EVB enforces that each recipient receives the original copy of the bus as it came with the incoming event. In general setting this property to TRUE will slow down the operation of DM_EVB. The intended use of this property is for debugging purposes. Default is FALSE.
3. Encapsulated interactions None.
4. Specification 5. Responsibilities 1. Distribute all incoming events to all parts connected to dom and evt terminals, in the order specified by the property dom first.
2. Send event for "preview" through pview terminal according to do_pview property if the pview output is connected. Stop further distribution it the preview is not successful.

3. Desynchronize all incoming events unless otherwise specified in sync property.
6. Theory of operation Fig. 35 illustrates an advantageous use of the inventive DM EVB part.
6.1. State machine None.
6.2. Main data structures None.
6.3. Mechanisms - Caller Identification DM EVB uses the connection IDs specified when its evt terminal is connected in order to be able to distinguish between the connections to this terminal. As a result, CM-EVT can determine through which connection a given event came and not send that event back through the same connection.
Enforcement of bus contents Detection of bus changes is done by binary comparison of the contents of the bus after sending it to an individual recipient. Enforcing the contents of the bus is done by overwriting it with the contents from the original bus before sending it to the next recipient.
6.4. Use Cases Distribution among peers In case of peer distribution, the dom terminal is unconnected and no events come in from this terminal - all events come from the evt terminal.
DM_EVB desynchronizes it (unless sync property is TRUE) and sends it out to all parts connected to the evt terminal except the one that sent the event in.
Distribution in an assembly In this case there is a part connected to the dom terminal (the dominant) as well as subordinates connected to the evt terminal. There are two possibilities:
the dominant sending events to the bus or subordinate sending events to the bus.

In the first case DM-EVB desynchronizes the event sent by the dominant and distributes this event to all subordinates connected to the evt terminal.
In the second case DM-EVB depending on the dom first property sends the event first to the dominant and then to the subordinates or backwards. DM EVB does not distribute the event to the part that sent it.
Dominant filters events out during previeinr In this case all terminals are connected and the do-pview property is set to TRUE.
The dom terminal is connected to the dominant, evt to subordinates and pview to another terminal implemented on the dominant as well.
When an event comes through evt or dom, DM-EVB sends it out immediately for preview through the pview terminal. The dominant connected at the other end, receives this event and decides not to distribute it further. For this to happen, the dominant returns CMST CANCELLED or other status code that is different from the value of the pview st ok property. When the DM EVB receives such a status, it does not distribute the event. This way the event is filtered out.
Dominant replaces the event during preview with another event In this case, again all terminals are connected and the do pview property is set to TRUE. The dom terminal is connected to the dominant, evt to subordinates and pview to another terminal implemented on the dominant as well.
When the dominant receives the event for a preview, it returns a status different than the value of pview-st ok property. However, before it does that, it sends another event back to the bus through the terminal connected to dom terminal on the DM EVB.
Note that at this moment the pview input implementation in the dominant is re-entered to preview the newly sent event; the dominant must be prepared to handle it properly.
When the replacement event is previewed successfully, the original event is not distributed further as the dominant rejected (absorbed) it, but the replacement event is distributed as usual - DM-EVB first desynchronizes it and then sends it to the subordinates. Note also, that the new event will reach all subordinates connected to the bus, including the one that generated the event that the dominant recoded.
Distribution of notifications in a static assembly In this case all notification terminals of subordinates are connected to the evt terminal, dom terminal is connected to an interior terminal on the assembly /i.e., the dominant), and the pview terminal is connected to a EV FLT subordinate which implements the filtering of notifications.
The notifications from subordinates are distributed to all other subordinates before they go out of the assembly. Note that in most cases when filtering is used, it is l0 done by the dominant; in this case the pview terminal of the bus is connected to an interior terminal on the assembly.
If the assembly does not have need to process the notifications itself, but it needs to be able to send them out - and, possibly, to accept incoming events and notifications - the DM_EVB dom terminal can be exposed through the assembly boundary as a pass-through terminal.
Note Exposing the evt terminal of the event bus through the assembly boundary is strongly discouraged, because: (a) the order of distribution through this terminal is not guaranteed, and (b) it is possible to get a duplicate connection ID between the inner and the outer assembly (CIassMagic generates connection IDs for static connections to be unique within the scope of the assembly).
DM DSV- Distributor for Sewice Fig. 36 illustrates the boundary of the inventive DM DSV part.
DM DSV forwards all operations received on in to out1 and if the call returns a status that specifies the operation was not serviced, DM_DSV forwards the operation to out2.
The status that is returned on in is the last status:

~ If the operation is not forwarded to out2, then the status from out1 is returned.
~ If the operation is forwarded to out2, the status from out2 is returned.
7. Boundary 7.1. Terminals Terminal "in" with direction "in" and contract I POLY. Note: v-table, infinite cardinality, unguarded. Operations received are forwarded to outl and if the status returned indicates that the operation was not serviced, then it is forwarded to out2.
Terminal "out1 " with direction "out" and contract I_POLY. Note: Output for forwarded operations.
Terminal "out2" with direction "out" and contract I-POLY. Note: Output for operations not serviced by out1.
7.2. Events and notifications None.
7.3. Special events, frames, commands or verbs None.
7.4. Properties Property "hunt stat" of type "UINT32". Note: Return status to recognize on out1.
The default is CMST NOT SUPPORTED.
Property "hunt-if-match" of type "UINT32". Note: (boolean) If TRUE, DM-DSV
hunts for service on out2 if out1 returned exactly hunt stat. If FALSE, hunt for service on out2 only if status on out1 doesn't match hunt stat. The default is TRUE.
8. Encapsulated interactions None.
9. Specification 10. Responsibilities 1 . Forward all operations received on in to out1. Either return from the call or forward the operation to out2 based on the status returned and the values of DM_DSV's hunt stat and hunt if-match properties.

11. Theory of operation 11.1. State machine None.
11.2. Mechanisms None.
11.3. Use Cases Fig. 37 illustrates an advantageous use of the inventive DM DSV part.
Tiy out2 if operation not served by out?
If the return status from out1 is equal to the value of the hunt stat property and l0 the hunt-if-match property is TRUE, DM-DSV forwards the operation to out2.
Try out2 if out 7 fails If the return status from out1 is not equal to the value of the hunt stat property and the hunt if match property is FALSE, DM-DSV forwards the operation to out2.
Cascading DM DSV
DM-DSV may be cascaded to achieve hunting for service among more than two terminals.
DM RPL - Event Repiicator Fig. 38 illustrates the boundary of the inventive DM-RPL part.
DM-RPL is a connectivity part. DM-RPL passes the events received on its in terminal to the out terminal and, in addition, duplicates them and sends the duplicates to its aux terminal.
The status returned by the operation on the out terminal is propagated back to the sender of the event.
Optionally, DM-RPL can be programmed (through property) to send the duplicates before it passes the event out.
The duplicate events are allocated using the CIassMagic event allocation mechanism and are always self-owned. All other attributes are kept intact.

12. Boundary 12.1. Terminals Terminal "in" with direction "In" and contract I_DRAIN. Note: All input events received here are forwarded to out terminal. The status returned is the one returned by the operation on the out terminal. If out terminal is not connected, the operation returns CMST-NOT CONNECTED. Unguarded. Can be connected when the part is active.
Terminal "out" with direction "Out" and contract I DRAIN. Note: All events received on in terminal are forwarded through here. Can be connected when the part is active.
Terminal "aux" with direction "Out" and contract I-DRAIN. Note: All duplicate events are sent through here. Can be connected when the part is active.
12.2. Events and notifications Each event received on in terminal is forwarded to the out terminal and a duplicate event is sent out through the aux terminal.
12.3. Special events, frames, commands or verbs None.
12.4. Properties Property "aux first" of type "UINT32". Note: Set to TRUE to send the duplicate events (going through aux terminal) first - before the original event is passed through the out terminal. Default: FALSE.
13. Encapsulated interactions None.
14. Specification 15. Responsibilities 6. Pass all events coming on in to out.
7. Duplicate events coming on in and send the duplicates to aux.
16. Theory of operation DM-RPL duplicates the incoming events and sends the duplicates through a separate terminal. The memory for the duplicates is allocated using pool allocation (provided by the CIassMagic engine).

DM SEQ - Event Sequencer Fig. 39 illustrates the boundary of the inventive DM SEa part.
The primary function of DM SEQ is to distribute incoming events received on in to the parts connected to the out1 and out2 terminals.
The incoming event IDs are parameterized on DM SEQ - DM SEQ supports up to 16 events. Each event has a corresponding distribution discipline and cleanup event ID (also specified through properties). These properties describe how the events are distributed and also upon failure, the cleanup event that should be sent.
DM SEQ supports four distribution disciplines: fwd-ignore, bwd-ignore, fwd cleanup, bwd cleanup. Events may be distributed either sequentially (out1..out2) or backwards (out2..out1 ). The main difference is whether DM SEQ
ignores the return status from the event processing (fwd_ignore, bwd-ignore) or takes it into account (fwd cleanup, bwd cleanup). See the Mechanisms section for more information on the distribution disciplines.
The events sent through out1 and out2 can be completed either synchronously or asynchronously - DM SEQ takes care of the proper sequencing, completion and necessary cleanup.
Unrecognized events received on in or aux are passed out through the opposite terminal without modification. This enables DM SEQ to be inserted in any event flow and provides greater flexibility.
17. Boundary 17.1. Terminals Terminal "in" with direction "Plug" and contract I DRAIN. Note: v-table, synchronous, cardinality 1 Incoming events for distribution are received here.
All recognized events are distributed according to their discipline. All unrecognized events are passed through aux. Unrecognized events (received from aux) are sent out this terminal.
Terminal "out1 " with direction "Plug" and contract I DRAIN. Note: v-table, synchronous, cardinality 1 Event distribution terminal. The distribution depends upon the discipline of the event received on in.

Terminal "out2" with direction "Plug" and contract I DRAIN. Note: v-table, synchronous, cardinality 1 Event distribution terminal. The distribution depends upon the discipline of the event received on in.
Terminal "aux" with direction "Plug" and contract I DRAIN. Note: v-table, synchronous, cardinality 1, floating Unrecognized events received from this terminal are passed out in. Unrecognized events received from in are passed out this terminal.
17.2. Events and notifications DM SEQ is parameterized with the event IDs of the events it distributes to out1 and out2. When one of these events are received from in, DM SEQ distributes the event according to its discipline. If the distribution fails and the discipline allows cleanup, DM SEQ distributes the cleanup event in the reverse order from where the distribution failed.
If the event received on in can be distributed asynchronously, DM SEQ will send a completion event through in when the event distribution has completed.
If the event sent through out1 or out2 can be completed asynchronously, the completion event bus must be the same (or similar) for all the events DM SEQ
handles.
All unrecognized events received from either in or aux are passed through the opposite terminal without modification.
. 17.3. Special events, frames, commands or verbs None.
17.4. Properties Property "unsup ok" of type "BOOL". Note: If TRUE, a return status of CMST NOT SUPPORTED from the event distribution terminals out1 or out2 is remapped to CMST OK. Default is TRUE.
Property "async cplt attr" of type "UINT32". Note: Value of the attribute that signifies a recognized event received from in can be processed asynchronously.
The default is: EVT A ASYNC CPLT
Property "cplt attr" of type "UINT32". Note: Value of the attribute that signifies that the processing of the asynchronous event distributed to out1 or out2 has been completed. When an event distributed through out1 or out2 is processed asynchronously, the completion event passed back to DM SEQ is expected to have this attribute set. The default is: EVT A COMPLETED
Property "cplt s offs" of type "UINT32". Note: Offset in completion event bus for the completion status. The size of the storage must be at least sizeof (cmstat).
Default is OxOC. (first field in event bus after standard fields id, sz and attr) Property "ev[0].ev-id-ev[15].ev id" of type "UINT32". Note: Event IDs that DM
SEQ
distributes to out1 and out2 when received on the in terminal. The default values are EV NULL.
Property "ev[0].disc-ev[15].disc" of type "ASCIZ". Note: Distribution disciplines for ev[0].ev id-ev[15].ev-id, can be one of the following: fwd ignore bwd-ignore fwd cleanup bwd cleanup See the Mechanisms section for descriptions of the disciplines.
The default values are fwd-ignore.
Property "ev[0].cleanup id-ev[15).cleanup-id" of type "UINT32". Note: Event IDs used for cleanup if the event distribution fails. The cleanup event is not sent if it is EV_NULL. Cleanup events are used only if the distribution discipline is fwd cleanup or bwd cleanup. The default values are EV NULL.
18. Encapsulated interactions None.
19. Specification 20. Responsibilities 1 . or all unrecognized events received from in, pass out aux without modification.
2. For all unrecognized events received from aux, pass out in without modification.
3. For all recognized events received from in, distribute them to out1 and out2 according to their corresponding discipline (parameterized through properties -see the Mechanisms section for definitions of the distribution disciplines).
4. Allow both synchronous and asynchronous completion of the distributed events.

5. Fail the event distribution if a recognized synchronous event received on in is processed asynchronously by out1 or out2.
6. Track events and their sequences, ignoring events that come out-of-sequence (e.g., completion coming back through a terminal on which DM SEQ did not initiate an operation; or getting a new event through in while event distribution is in progress).
7. Do not process any new recognized events while event distribution is pending.
8. If so configured, remap the status CMST NOT SUPPORTED received from the event distribution to CMST OK.
21. Theory of operation 21.1. State machine None.
21.2. Main data structures None.
21.3. Mechanisms Event Distribution Disciplines The following disciplines are used to define how the recognized events received on in are distributed to out1 and out2. These are specified for each event through properties. There is a one-to-one correspondence between a recognized event, cleanup event, and the event distribution discipline.
fwd ignore (broadcast event forward and ignore return status):
Send event through out1, ignore return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending).
Send event through out2, ignore return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending).
Complete event distribution with CMST OK.
bwd-ignore (broadcast event backwards and ignore return status):

Send event through out2, ignore return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending).
Send event through out1, ignore return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending).
Complete event distribution with CMST OK.
fwd cleanup (broadcast event forward and cleanup on failure):
Send event through out1, save return status If status is CMST-PENDING, return to the caller - processing of asynchronous event is pending. When asynchronous event has completed, extract completion status.
If return status or completion status is not CMST OK, complete event distribution with failed status Send event through out2, save return status If status is CMST-PENDING, return to the caller - processing of asynchronous event is pending. When asynchronous event has completed, extract completion status.
If return status or completion status is not CMST OK and the cleanup event id is not EV-NULL, send the cleanup event through out1 and ignore the return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending. Continue to next step only when event processing has completed).
Complete event distribution with the failed status or CMST OK if the event was distributed successfully.
bwd cleanup,(broadcast event backwards and cleanup on failure):
Send event through out2, save return status If status is CMST-PENDING, return to the caller - processing of asynchronous event is pending. When asynchronous event has completed, extract completion status.
If return status or completion status is not CMST OK, complete event distribution with failed status Send event through out1, save return status If status is CMST-PENDING, return to the caller - processing of asynchronous event is pending. When asynchronous event has completed, extract completion status.
l0 If return status or completion status is not CMST OK and the cleanup event id is not EV-NULL, send the cleanup event through out2 and ignore the return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending. Continue to next step only when event processing has completedl.
Complete event distribution with the failed status or CMST OK if the event was distributed successfully.
Note that depending on the value of the unsup ok property, a CMST-NOT_SUPPORTED return status from out1 or out2 may be mapped to CMST OK and the event distribution will continue.
Synchronous and Asynchronous Sequencing DM SEQ uses sequencer tables that define the steps taken for each distribution discipline defined above. Steps are performed only after the previous step has completed. Each step may be completed either synchronously (getting any status other than CMST-PENDING) or asynchronously (getting a CMST-PENDING status).
DM SEQ uses a sequencer to execute each of the steps, including any cleanups.
As long as steps complete synchronously, DM_SEQ feeds events automatically into the sequencer to advance to the next step; when an event gets desynchronized (returns CMST-PENDING), DM SEQ uses the respective completion event (the same event with the cplt attr attribute set) to resume feeding the sequencer. When the distribution is complete, DM SEQ sends the same event with the cplt attr attribute set out the in terminal (only if the original event received from in specified asynchronous completion).
Preventing Reentrancy When DM SEQ receives a completion indication from out1 or out2, it posts a message to itself and processes the indication asynchronously. This prevents recursion into the part that sent the completion indication.
Recognizing Out-of Sequence Events DM SEQ keeps in its state what was the last event or request it sent out and through which terminal it sent it (out1 or out2). When it gets a completion indication, DM SEa asserts that the terminal is the same and the completed operation was the one DM SEO. requested.
If they match, DM SEQ proceeds with the next step in the sequence. Otherwise, it ignores the indication and prints a message to the debug console.
DM-SEa handles out-of-order requests on in: if it receives a new recognized event on in while it is in the middle of event distribution (at any stage), DM
SEQ fails that new event/request and prints a message to the debug console.
Generating Cleanup Events The cleanup events sent by DM SEQ are allocated dynamically (not on the stack).
The attributes and size of the event depend upon whether the original event is allowed to complete asynchronously. The rules are as follows:
If the original event is only allowed to complete synchronously:
size = sizeof (CMEVENT HDR) attributes = CMEVT A SELF CONTAINED ~ CMEVT A SYNC
If the original event is allowed to complete asynchronously:
size = cplt s offs + sizeof (cmstat) attributes = CMEVT A SELF CONTAINED ~ CMEVT A SYNC
async cplt attr 22. Notes 1. DM SEQ does not allow self-owned events (CMEVT A SELF OWNED) to be distributed through its terminals. Upon receiving such an event, DM SEa fails with CMST REFUSE.
DM SEAT - Event Sequences on Thread Fig. 40 illustrates the boundary of the inventive DM SEAT part.
The primary function of DM-SEAT is to distribute incoming events received on in to the parts connected to the out1 and out2 terminals. The events sent through out1 and out2 are in the context of DM SEO.T's worker thread (unlike DM SEQ
where the events are in the context of the DriverMagic's pump thread). Each instance of DM-SEO.T preferably has its own worker thread.
The incoming event IDs are parameterized on DM SEAT - DM SEO.T supports up to 16 events. Each event has a corresponding distribution discipline and cleanup event ID (also specified through properties). These properties describe how the events are distributed and also upon failure, the cleanup event that should be sent.
DM-SEAT supports four distribution disciplines: fwd-ignore, bwd_ignore, fwd cleanup, bwd cleanup. Events may be distributed either sequentially (out1..out2) or backwards (out2..out1 ). The main difference is whether DM
SEO.T
ignores the return status from the event processing (fwd-ignore, bwd-ignore) or takes it into account (fwd cleanup, bwd cleanup). See the Mechanisms section for more information on the distribution disciplines.
The events sent through out1 and out2 can be completed either synchronously or asynchronously - DM SEOT takes care of the proper sequencing, completion and necessary cleanup.
Unrecognized events received on in or aux are passed out through the opposite terminal without modification. This enables DM SEAT to be inserted in any event flow and provides greater flexibility.

23. Boundary 23.1. Terminals Terminal "in" with direction "Plug" and contract I-DRAIN. Note: v-table, synchronous, cardinality 1 Incoming events for distribution are received here.
All recognized events are distributed according to their discipline.
Terminal "out1 " with direction "Plug" and contract I_DRAIN. Note: v-table, synchronous, cardinality 1 Event distribution terminal. The distribution depends upon the discipline of the event received on in.
Terminal "out2" with direction "Plug" and contract I DRAIN. Note: v-table, l0 synchronous, cardinality 1 Event distribution terminal. The distribution depends upon the discipline of the event received on in.
23.2. Events and notifications DM SEAT is parameterized with the event IDs of the events it distributes to out1 and out2. When one of these events are received from in, DM SEAT distributes the event according to its discipline. If the distribution fails and the discipline allows cleanup, DM SEAT distributes the cleanup event in the reverse order from where the distribution failed.
If the event received on in can be distributed asynchronously, DM SEo.T will send a completion event through in when the event distribution has completed.
23.3. Special events, frames, commands or verbs None.
23.4. Properties Property "thread-priority" of type "UINT32". Note: Specifies the priority of the worker thread. The values for this property depend on the environment. It is used directly to call the environment specific function that sets the thread priority (SetThreadPriority in Win32, KeSetPriorityThread in WDM, etc.). This property is redirected to the RDWT subordinates.
Property "disable diag" of type "UINT32". Note: Boolean. This determines whether DM-RDWT prints debug output indicating that a call through out failed. A call through out fails if the return status is not equal to ok stat. This property affects only the checked build of DM_RDWT. This property is redirected to the RDWT
subordinates. Default is FALSE.
Property "cplt s offs" of type "UINT32". Note: Offset in bytes of the completion status in the request bus. This property is redirected to the RDWT and SEQ
subordinates. Mandatory.
Property "ev[0].ev-id-ev[15].ev id" of type "UINT32". Note: Event IDs that DM SEAT distributes to out1 and out2 when received on the in terminal. This property is redirected to the SEQ subordinate. The default values are EV NULL.
Property "ev[0].disc-ev[15].disc" of type "ASCIZ". Note: Distribution disciplines for ev[0].ev id-ev[15].ev_id, can be one of the following: fwd ignore bwd ignore fwd cleanup bwd cleanup See the Mechanisms section of the DM SEO. documentation for descriptions of the disciplines. This property is redirected to the SEQ
subordinate.
The default values are fwd-ignore.
Property "ev[0].cleanup id-ev[15].cleanup_id" of type "UINT32". Note: Event IDs used for cleanup if the event distribution fails. The cleanup event is not sent if it is EV NULL. Cleanup events are used only if the distribution discipline is fwd cleanup or bwd cleanup. This property is redirected to the SEa subordinate. The default values are EV NULL.
24. Encapsulated interactions None.
25. Specification 26. Responsibilities 1. For all recognized events received from in, distribute them to out1 and out2 according to their corresponding discipline (parameterized through properties).
2. Allow both synchronous and asynchronous completion of the distributed events.
3. Fail the event distribution if a recognized synchronous event received on in is processed asynchronously by out1 or out2.
4. Track events and their sequences, ignoring events that come out-of-sequence (e.g., completion coming back through a terminal on which DM-SEAT did not initiate an operation; or getting a new event through in while event distribution is in progress).
5. Do not process any new recognized events while event distribution is pending.
6. If so configured, remap the status CMST-NOT SUPPORTED received from the event distribution to CMST OK.
7. Distribute all events passed out of out1 and out2 in the context of DM
SEQT's own worker thread.
27. Internal Definition Fig. 41 illustrates the internal structure of the inventive DM-SEO.T part.
28. Theory of Operation DM_SEQT is an assembly built entirely of DriverMagic parts.
The events received through the in terminal are distributed to out1 and out2 according to their discipline. All events passed out of out1 and out2 are in the context of DM SEQT's own worker threads, one for each channel.
Please see the DM SEO. data sheet for more information about the sequencer and how it works.
28.1. Mechanisms Event Distribution Disciplines The following disciplines are used to define how the recognized events received on in are distributed to out1 and out2. These are specified for each event through properties. There is a one-to-one correspondence between a recognized event, cleanup event, and the event distribution discipline.
fwd-ignore (broadcast event forward and ignore return status):
Send event through out1, ignore return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending).
Send event through out2, ignore return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending).
Complete event distribution with CMST OK.

bwd-ignore (broadcast event backwards and ignore return status):
Send event through out2, ignore return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending).
Send event through out1, ignore return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending).
Complete event distribution with CMST OK.
fwd cleanup (broadcast event forward and cleanup on failure):.
to Send event through out1, save return status If status is CMST-PENDING, return to the caller - processing of asynchronous event is pending. When asynchronous event has completed, extract completion status.
If return status or completion status is not CMST OK, complete event distribution with failed status Send event through out2, save return status If status is CMST-PENDING, return to the caller - processing of asynchronous event is pending. When asynchronous event has completed, extract completion status.
If return status or completion status is not CMST OK and the cleanup event id is not EV-NULL, send the cleanup event through out1 and ignore the return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending. Continue to next step only when event processing has completedl.
Complete event distribution with the failed status or CMST OK if the event was distributed successfully.
bwd cleanup (broadcast event backwards and cleanup on failure):
Send event through out2, save return status If status is CMST-PENDING, return to the caller - processing of asynchronous event is pending. When asynchronous event has completed, extract completion status.
If return status or completion status is not CMST OK, complete event distribution with failed status Send event through out1, save return status If status is CMST-PENDING, return to the caller - processing of asynchronous event is pending. When asynchronous event has completed, extract completion status.
If return status or completion status is not CMST OK and the cleanup event id is not EV NULL, send the cleanup event through out2 and ignore the return status (if CMST PENDING, return to the caller - processing of asynchronous event is pending. Continue to next step only when event processing has completed).
Complete event distribution with the failed status or CMST OK if the event was distributed successfully.
Note that depending on the value of the unsup ok property, a CMST-NOT SUPPORTED return status from out1 or out2 may be mapped to CMST OK and the event distribution will continue.
Synchronous and Asynchronous Sequencing DM-SEAT uses sequencer tables that define the steps taken for each distribution discipline defined above. Steps are performed only after the previous step has completed. Each step may be completed either synchronously (getting any status other than CMST-PENDING) or asynchronously (getting a CMST-PENDING status).
DM-SEAT uses a sequencer to execute each of the steps, including any cleanups.
As long as steps complete synchronously, DM-SEAT feeds events automatically into the sequencer to advance to the next step; when an event gets desynchronized (returns CMST-PENDING), DM-SEAT uses the respective completion.event (the same event with the cplt attr attribute set) to resume feeding the sequencer. When the distribution is complete, DM SEAT sends the same event with the cplt attr attribute set out the in terminal (only if the original event received from in specified asynchronous completion).
Preventing Reentrancy When DM-SEAT receives a completion indication from out1 or out2, it posts a message to itself and processes the indication asynchronously. This prevents recursion into the part that sent the completion indication.
Recognizing Out-of Sequence Events DM_SEQT keeps in its state what was the last event or request it sent out and l0 through which terminal it sent it (out1 or out2). When it gets a completion indication, DM-SEAT asserts that the terminal is the same and the completed operation was the one DM SEAT requested.
If they match, DM-SEAT proceeds with the next step in the sequence.
Otherwise, it ignores the indication and prints a message to the debug console.
DM SEAT handles out-of-order requests on in: if it receives a new recognized event on in while it is in the middle of event distribution (at any stage), DM
SEAT
fails that new event/request and prints a message to the debug console.
Generating Cleanup Events The cleanup events sent by DM SEAT are allocated dynamically (not on the stack). The attributes and size of the event depend upon whether the original event is allowed to complete asynchronously. The rules are as follows:
If the original event is only allowed to complete synchronously:
size = sizeof (CMEVENT HDR) attributes = CMEVT A SELF CONTAINED ~ CMEVT A SYNC
If the original event is allowed to complete asynchronously:
size = cplt s offs + sizeof (cmstat) attributes = CMEVT A-SELF CONTAINED ~ CMEVT A SYNC ~
async cplt attr 29. Subordinate's Responsibilities 29.1. DM SEQ - Event Sequences For all recognized events received from in, distribute them to out1 and out2 according to their corresponding discipline Track events and their sequences, ignoring events that come out-of-sequence (e.g., completion coming back through a terminal on which DM-SEQ did not initiate an operation; or getting a new event through in while event distribution is in progress).
29.2. DM RDWT - Request Desynchronizes with Thread Desynchronize all incoming requests received from in and send them through out.
Use a dedicated worker thread to call the out terminal.
30. Dominant's Responsibilities 30.1. Hard parameterization of subordinates Subordinate Property Value SEQ cplt attr CMEVT A COMPLET
ED
async cplt attr CMEVT A ASYNC C
PLT
30.2. Distribution of Properties to the Subordinates Property Name Type Dist To unsup ok UINT3 Redir seq.unsup ok ev[0].ev-id- UINT3 Redir seq.ev[0].ev id-ev[15].ev id 2 seq.ev[15].ev id ev[0].disc- UINT3 Redir seq.ev[0].disc-ev[15].disc 2 seq.ev[15].disc ev[0].cleanup UINT3 Redir seq.ev[0].cleanup id- id-ev[15].cleanup-i2 seq.ev[15].cleanup id d
31. Notes 1 . DM SEAT does not allow self-owned events (CMEVT A SELF OWNED) to be distributed through its terminals. Upon receiving such an event, DM SEAT fails with CMST REFUSE.
DM LFS - Life-Cyc% Sequencer Fig. 42 illustrates the boundary of the inventive DM-LFS part.
The primary function of DM-LFS is to distribute incoming life-cycle events received on in to the parts connected to the out1 and out2 terminals.
DM-LFS relies on DM SEQ for the event distribution functionality. DM-LFS
l0 parameterizes DM SEQ with life-cycle events (defined below). See the hard parameterization section below for a list of life-cycle events that DM LFS
handles.
Additional events may be distributed by setting properties on DM-LFS. For more information about the event distribution, see the DM SEQ documentation.
32. Boundary 32.1. Redirected Terminals All the following terminals are redirected to DM SEa:
Terminal "in" with direction "Plug" and contract I-DRAIN. Note: v-table, synchronous, cardinality 1 Incoming events for distribution are received here.
All recognized events are distributed according to their discipline. All unrecognized events are passed through aux. Unrecognized events (received from aux) are sent out this terminal.
Terminal "out1 " with direction "Plug" and contract I-DRAIN. Note: v-table, synchronous, cardinality 1 Event distribution terminal. The distribution depends upon the discipline of the event received on in.
Terminal "out2" with direction "Plug" and contract I-DRAIN. Note: v-table, synchronous, cardinality 1 Event distribution terminal. The distribution depends upon the discipline of the event received on in.
Terminal "aux" with direction "Plug" and contract I-DRAIN. Note: v-table, synchronous, cardinality 1, floating Unrecognized events received from this terminal are passed out in. Unrecognized events received from in are passed out this terminal.

32.2. Events and notifications DM-LFS parameterizes DM SEO. to handle life-cycle events. The remaining events that can be handled by DM SEO can be parameterized from the outside of DM-LFS. These are redirected properties on DM_LFS; see below for more details.
32.3. Special events, frames, commands or verbs None.
32.4. Redirected Properties All the following properties are redirected to DM SEQ:
Property "unsup ok" of type "BOOL". Note: If TRUE, a return status of CMST NOT SUPPORTED from the event distribution terminals out1 or out2 is remapped to CMST-OK. Default is TRUE.
Property "ev[0].ev-id-ev[1 1 ].ev id" of type "UINT32". Note: Event IDs that DM-LFS
distributes to out1 and out2 when received on the in terminal. The default values are EV NULL.
Property "ev[O].disc-ev[11].disc" of type "ASCIZ". Note: Distribution disciplines for ev[0].ev id-ev[8].ev_id, can be one of the following: fwd-ignore bwd_ignore fwd cleanup bwd cleanup See the DM SEQ documentation for descriptions of the disciplines.
The default values are fwd ignore.
Property "ev[0].cleanup id-ev[1 1 ].cleanup-id" of type "UINT32". Note: Event IDs used for cleanup if the event distribution fails. The cleanup event is not sent if it is EV_NULL. Cleanup events are used only if the distribution discipline is fwd cleanup or bwd cleanup. The default values are EV NULL.
25' 32.5. Hard Parameterization All the following properties are set on DM SEQ:
Property "unsup ok" of type "BOOL". Note: TRUE
Property "async cplt attr" of type "UINT32". Note: EVT A ASYNC CPLT
Property "cplt attr" of type "UINT32". Note: EVT A COMPLETED
Property "cplt s offs" of type "UINT32". Note: OxOC

Property "ev[0].ev-id" of type "UINT32". Note: EV-LFC-REa START
Property "ev[0].disc" of type "ASCIZ". Note: "fwd cleanup"
Property "ev[0].cleanup-id" of type "UINT32". Note: EV-LFC-REQ STOP
Property "ev[1 ].ev-id" of type "UINT32". Note: EV-LFC-REa STOP
Property "ev[1 ].disc" of type "ASCIZ". Note: "bwd_ignore"
Property "ev[1 ].cleanup-id" of type "UINT32". Note: EV-NULL
Property "ev[2].ev id" of type "UINT32". Note: EV LFC REQ DEV PAUSE
Property "ev[2].disc" of type "ASCIZ". Note: "bwd cleanup"
Property "ev[2].cleanup id" of type "UINT32". Note: EV LFC REQ DEV RESUME
l0 Property "ev[3].ev-id" of type "UINT32". Note: EV LFC-REQ-DEV-RESUME
Property "ev[3].disc" of type "ASCIZ". Note: "fwd cleanup"
Property "ev[3].cleanup-id" of type "UINT32". Note: EV-LFC-REQ-DEV-PAUSE
33. Encapsulated interactions None.
DM MUX- Event-Control%d Multiplexer Fig. 43 illustrates the boundary of the inventive DM-MUX part.
DM MUX forwards operations received on its in input to either its out1 or out2 outputs. The outgoing terminal, which DM-MUX forwards incoming operations to, is controlled via three events it receives on its ctl terminal.
DM MUX is parameterized with the three events via properties. One event switches outgoing operations to out1, one event switches outgoing operations to out2, and the last event toggles the outgoing operation terminal /i.e., out1 if out2 is selected and out2 if out1 is selected) By default, DM MUX forwards operations received its in terminal to its out1 terminal.
34. Boundary 34.1. Terminals Terminal "in" with direction "in" and contract I POLY. Note: v-table, infinite cardinality, unguarded. Operations received are forwarded to either out1 or out2.

Terminal "out1 " with direction "out" and contract I-POLY. Note: Output for forwarded operations.
Terminal "out2" with direction "out" and contract I_POLY. Note: Output for forwarded operations.
Terminal "ctl" with direction "in" and contract I DRAIN. Note: v-table, infinite cardinality, unguarded. Receive events that control multiplexer switching.
34.2. Events and notifications DM-MUX recognizes three specific events: ev out1, ev out2 and ev toggle on its ctl terminal. The event IDs for these events are specified as properties and are described in the table below.
Incoming Bus Notes Event (ev out1 ) CMEVENT Select out1 for outgoing -HDR operations.
The default is EV REQ ENABLE.
(ev out2) CMEVENT Select out2 for outgoing _HDR operations.
The default is EV REQ DISABLE.
(ev toggle) CMEVENT Select the other output for -HDR outgoing operations (i.e., outl if out2 is selected and out2 if out1 is selected).
The default is EV NULL.
34.3. Special events, frames, commands or verbs None.
34.4.. Properties Property "ev out1 " of type "UINT32". Note: Event ID to switch to out1.

Property "ev out2" of type "UINT32". Note: Event ID to switch to out2.
Property "ev toggle" of type "UINT32". Note: Event ID to switch to the other output (i.e., out1 if out2 is selected and out2 if out1 is selected).
35. Encapsulated interactions None.
36. Specification
37. Responsibilities 1. Forward operations received on in to out1 or out2 based upon control events received on ctl terminal.
38. Theory of operation 38.1. State machine DM-MUX keeps state as to which outx terminal it is to forward operations received on its in terminal to. The state is controlled by the events it receives on its ctl input. DM-MUX uses InterlockedExchangel) to update its state. By default, DM-MUX's state specifies that it is to forward operations to its out1 terminal.
1P SWP and ZP SWPB - Property-Control%d Switches Fig. 44 illustrates the boundary of the inventive DM SWP part.
Fig. 45 illustrates the boundary of the inventive DM SWPB part.
The property-controlled switches forward operations received on the in input to one of their outputs (out1 or out2).
The selection of the outgoing terminal is controlled by the value of a property that is modifiable while the part is active. When the value of property falls within a programmable range (defined by the min, max and mask properties), all events received on the in terminal are forwarded through the outl terminal; otherwise they are forwarded through the out2 terminal.
ZP SWPB is a bi-directional version of ZP SWP. In the in to out direction it operates exactly as ZP-SWP. It forwards all operations received on its out1 and out2 terminals to the in terminal.
These parts provide a way to direct a flow of operations through different paths, depending on the value of a property that can be modified dynamically.
39. Boundary 39.1. Terminals (ZP SWP) Terminal "in" with direction "in" and contract I POLY. Note: v-table, infinite cardinality, unguarded. Operations received are forwarded to either out1 or out2.
Terminal "out1 " with direction "out" and contract I-POLY. Note: Output for forwarded operations.
Terminal "out2" with direction "out" and contract I-POLY. Note: Output for forwarded operations.
39.2. Terminals (ZP SWPB) Terminal "in" with direction "Bidir" and contract I POLY. Note: v-table, infinite cardinality, unguarded. Operations received are forwarded to either out1 or out2.
Terminal "out1 " with direction "Bidir" and contract I_POLY. Note: Output for forwarded operations. Operations received are forwarded to in.
Terminal "out2" with direction "Bidir" and contract I_POLY. Note: Output for forwarded operations. Operations received are forwarded to in.
39.3. Properties Property "val" of type "uint32". Note: This property is modifiable. Specifies the value used to determine which terminal the operation is sent out. ZP SWP/ZP SWPB
masks the value of this property with mask before comparing it to min and max.
Default is 0.
Property "mask" of type "uint32". Note: Bitwise mask ANDed with the value of val property. before comparing it to min and max. Default is OxFFFFFFFF (no change).
Property "min" of type "uint32". Note: Lower boundary of the out1 operations.
This is the lowest integer value (inclusive) of the val property upon which all operations will be forwarded through outl terminal. Default is 0.
Property "max" of type "uint32". Note: Upper boundary of the out1 operations.
This is the upper most integer value of the val property (inclusive) upon which all operations will be forwarded through out1 terminal. Default is OxFFFFFFFF.
39.4. Events and notifications None.

39.5. Special events, frames, commands or verbs None.
40. Encapsulated interactions None.
41. Specification
42. Responsibilities 1. Forward operations received on in to out1 or out2 based the value of val property.
2. (ZP SWPB) Forward operations received on out1 and out2 to in.
ZP CDM, ZP CDMB - Connection Demultipiexers Fig. 46 illustrates the boundary of the inventive DM CDM part.
Fig. 47 illustrates the boundary of the inventive DM CDMB part.
ZP CDM and ZP CDMB demultiplex operations received on their input to one of the connections of their multiplexed output terminal. ZP CDMIB) picks the ID
of the connection to which the output is directed from a fixed offset in the operation bus.
This offset and the data field size are programmable as properties.
All operations received on the out terminal of ZP CDMB are forwarded to the in terminal.
ZP CDM and ZP-CDMB are parts that have "infinite cardinality" outputs, that is, outputs that can be connected to any number of inputs (another such part is the event bus - ZP EVB).
ZP CDM/B) can be used with structures that allow connecting multiple parts to a single terminal and provide a known unique connection ID for each established connection. Currently, the only such structure is provided by the part array (ZP ARR) - when it creates and connects a new part in the array, it automatically assigns the part ID to all connections established with that part.
43. Boundary 43.1. Terminals (ZP CDM) Terminal "in" with direction "in" and contract I POLY. Note: All operations received on this terminal are forwarded to the out terminal connection specified by the connection ID retrieved from operation bus.
Terminal "out" with direction "out" and contract I-POLY. Note: Output for forwarded operations. This terminal may be connected and disconnected while the part is active. This is an "infinite cardinality" output - unlike a normal output terminal, it will accept any number of simultaneous connections.
43.2. Terminals (ZP CDMB) Terminal "in" with direction "bi" and contract I POLY. Note: All operations received on this terminal are forwarded to the out terminal connection specified by the connection ID stored in the operation bus.
Terminal "out" with direction "bi" and contract I-POLY. Note: All operations received on this terminal are forwarded to the in terminal. This terminal may be connected and disconnected while the part is active. This is an "infinite cardinality" bi-directional terminal - unlike a normal output or bi-directional terminal, it will accept any number of simultaneous connections.
43.3. Properties 2o Property "id offset" of type "uint32". Note: Offset in operation bus where connection ID is stored. The default is 0.
Property "id sz" of type "uint32". Note: Size of the connection ID field in bytes. This property can have a value between 1 and 4 inclusive. For sizes greater than 1, the byte order is assumed to be the natural byte order of the host CPU. Important:
if 2 or 4 is used, the id offset must be a valid offset to a uintl 6 or uint32 structure field, respectively, aligned as necessary. If 1 or 3 is used, the offset can be anywhere in the bus. The default is 4.
Property "id sgnext" of type "uint32". Note: Boolean. If TRUE, connection IDs smaller than 4 bytes are sign extended. The default is FALSE.
44. Specification
45. Responsibilities 1. Sign extend connection IDs with size less than 4 bytes when id sgnext property is TRUE.
2. Enter the part guard when selecting the connection to ensure that the terminal selection and activetime connection and disconnection of the out terminal are serialized.
3. Forward operations received on in to out by performing atomic selection on out terminal.
4. Forward operations received on out to in.
46. Theory of operation 46.1. Mechanisms Performing atomic se%ction of 'out' output When ZP CDM and ZP CDMB receive a call on its in terminal, they perform the following operations:
~ Enter the part guard using z-part enter() ~ Select the outgoing connection and obtain the pointer to the interface ~ Leave the part guard suing z-part leave() ~ Make the outgoing call.
ZP CMX - Connection Multiplexer/De-multiplexes Fig. 48 illustrates the boundary of the inventive DM CMX part.
ZP CMX is a plumbing part that allows a single bi-directional terminal to be connected to multiple distinguishable bi-directional terminals and vice versa.
Operations received on the bi terminal are forwarded out the mux terminal using a connection ID or an internally generated id stored in the operation bus.
Operations received on the mux terminal are forwarded out the bi terminal with ZP CMX
stamping the connection id and optionally stamping an external connection context into the bus.

While ZP-CMX is active, it has the option to generate event requests out its ctl terminal when a connection is established and/or dissolved on its mux terminal.
These requests provide the recipient with the ability to assign an external context to the connection, which can be used at a later time to process operation requests more efficiently.
ZP-CMX can be used to dispatch requests to one of many recipients (e.g., parts within a part array) or to connect multiple clients to a single server.
Both of ZP-CMX's input terminals are unguarded and may be invoked at interrupt time.
l0 47. Boundary
47.1. Terminals Terminal "bi" with direction "bi" and contract I-POLY. Note: Operations received on this terminal are forwarded to the mux terminal. The connection is specified by a connection ID or an internally generated identifier stored in the operation bus.
Terminal "mux" with direction "bi" and contract I-POLY. Note: Operations received on this terminal are redirected to the bi terminal. ZP CMX stamps a connection identifier and context into the operation bus before forwarding the operation.
This is an "infinite cardinality" output - unlike a normal output terminal, it will accept any number of simultaneous connections. This terminal may be connected and disconnected while the part is active.
Terminal "ctl" with direction "Out" and contract I-DRAIN. Note: Event requests are generated out this terminal when the mux terminal is connected and/or disconnected while ZP CMX is active. This terminal may remain unconnected and may not be connected while the part is active.
47.2. Properties Property "use conn id" of type "uint32". Note: Boolean. When TRUE, ZP CMX uses a connection ID to dispatch operations received on the bi terminal to the mux terminal. When FALSE, ZP-CMX uses an internally generated id stored in the operation bus to dispatch the call (faster than when using the connection id).
Default is FALSE.

Property "id offset" of type "uint32". Note: Offset in operation bus for connection ID
storage. When use conn-id is FALSE, it is assumed that id offset specifies the offset of a ctx field in the operation bus; otherwise it assumes that id offset specifies the offset of a DWORD field. The default is 0.
Property "conn ctx offset" of type "uint32". Note: Offset in operation bus where the connection context returned on ctl connect ev request is stored for operations traveling from mux to bi. When the value is -1 and/or ZP CMX's ctl terminal is not connected, no context is stored in the bus. The default is -1.
Property "ctl connect ev" of type "uint32". Note: Event request to generate out ctl when a connection on the mux terminal is established (connected). When the value is EV-NULL, no event is generated. The default is EV-NULL.
Property "ctl disconnect ev" of type "uint32". Note: Event to generate out ctl when a connection on the mux terminal is dissolved (disconnected). When the value is EV-NULL, no event is generated. The default is EV-NULL.
Property "ctl bus sz" of type "uint32". Note: Size of event bus for connect and disconnect event requests generated out the ctl terminal. The value of this property must be at least as large to accommodate storage for connection ID and context as specified the ctl-id offset and ctl conn ctx offset properties. The default is 0.
Property "ctl-id offset" of type "uint32". Note: Offset in event bus for connection id storage. When use conn-id is FALSE, it is assumed that ctl id offset specifies the offset of a ctx field in the operation bus; otherwise it is assumes that ctl id offset specifies the offset of a DWORD field. When the value is -1, no ID is stored in the event bus. The default is -1.
Property "ctl conn ctx offset" of type "uint32". Note: Offset in event bus for connection context storage. The recipient of the ctl connect ev request provides the connection context and this context is stamped into the bus of operations traveling from mux to bi. When the value is -1, no context is stored in the event bus.
The default is -1.

47.3. Events and notifications Teiminal.~ ctl Event Dir Bus Notes (ctl connect ev) ou any ZP CMX generates this t request when a connection is established on its mux terminal.
The event data may contain a connection identifier as specified by the use conn-id property.
(ctl disconnect ev ou any ZP CMX generates this t request when a connection is dissolved on its mux terminal.
The event data may contain a connection identifier as specified by the use conn-id property and or a connection context that was returned with the ctl connect ev request.
48. Specification
49. Responsibilities 1. Forward operations received on bi to mux using the connection ID specified at id offset when use conn id is TRUE.
2. Forward operations received on bi to mux using an internally generated connection id specified at id offset when use conn id is FALSE.

3. Stamp connection ID as specified by use conn id into bus on operations traveling from mux to bi.
4. Stamp connection context into bus of operations traveling from mux to bi if conn ctx offset is not -1.
5. Generate event request out ctl terminal when a connection on mux terminal is established and the value of the ctl connect ev property is not EV NULL.
6. Generate event request out ctl terminal when a connection on mux terminal is dissolved and the value of the ctl disconnect ev property is not EV-NULL.
50. Use Cases l0 Fig. 49 illustrates an advantageous use of the inventive DM CMX part.
50.1. Mux Terminal Connection This use case describes the actions taken by ZP CMX when it receives a request to establish a connection on its mux terminal 1. If the value of the ctl connect ev property is EV NULL or the ctl terminal is not connected, ZP CMX establishes the connection and returns.
2. ZP CMX allocates a ctl connect ev event request and if the use conn id property is TRUE, stores the actual connection ID at ctl conn-id offset;
otherwise it stores an internally generated connection ID at ctl conn id offset.
3. ZP CMS sends the event out the ctl terminal. If the return status is not ST OK, ZP-CMX fails the connect request with ST-REFUSE; otherwise ZP CMX stores the connection context specified at ctl conn ctx offset into the data for the connection and returns success.
50.2. Mux Terminal Disconnection This use case describes the actions taken by ZP CMX when it receives a request to dissolve a connection on its mux terminal.
1 . If the value of the ctl disconnect ev property is EV NULL or the ctl terminal is not connected, ZP CMX dissolves the connection and returns.
2. ZP CMX allocates a ctl disconnect ev event request and if the use conn id property is TRUE, stores the actual connection ID at ctl conn id offset;
otherwise it stores an internally generated connection ID at ctl conn-id offset.

ZP CMX also stores the connection context that was returned on ctl connect ev at ctl conn ctx offset.
3. ZP CMX sends the event out the ctl terminal. If the return status is not ST OK, ZP CMX displays output to the debug console, dissolves the connection, and returns ST OK; otherwise it simply dissolves the connection and returns ST OK.
50.3. De-multiplexing Operations When ZP_CMX receives an operation on its bi terminal, it extracts the connection identifier stored at id offset in the operation bus and interprets its value based on the value of its use conn-id property. ZP CMX selects the appropriate connection on its mux terminal and forwards the operation without modification.
50.4. Multiplexing Operations When ZP CMX receives on operation on its mux terminal, it performs the following actions before forwarding the operation to its bi terminal:
1. Stamps the connection identifier at id offset based on the value of its use conn id property.
2. Stamps the connection context associated with the connection at conn ctx offset.
3. Forwards the operation to the bi terminal.
51. Typical Usage
52. Using ZP CMX to allow connection of multiple clients to a single server The following diagram illustrates how ZP CMX can be used to manage the connections between multiple clients and a single server component. It is assumed that the server is able to handle multiple sessions at a time.
. In the above scenario, ZP CMX's use conn id property is set to FALSE. When a connection is established, ZP CMX generates a connect request out its ctl terminal and the server returns a connection context that ZP CMX is to stamp into the bus of operations received on that connection of the mux terminal. This gives the server the ability to quickly identify the client that originated an operation request it receives.

When ZP CMX receives a request on its mux terminal, it stamps the connection identifier of the connection on which it received the call into the operation bus and stamps the connection context provided by the server and forwards the call out its bi terminal. When ZP CMX receives a request on its bi terminal from the server, it extracts the connection identifier from the operation bus, resolves the mux terminal connection and forwards the operation.
When ZP CMX receives a disconnect request, it generates an event request out its ctl terminal to allow the server to perform any necessary cleanup before the connection is dissolved.
53. Using ZP CMX with the Dynamic Structure Framework Fig. 50 illustrates an advantageous use of the inventive DM CMX part.
The following diagram illustrates how ZP CMX is used with the Dynamic Structure Framework parts. Its functionality is similar to that of ZP CDMB.
In the above scenario, ZP CMX's use conn id property is set to TRUE. When a request is distributed to any of the part instances it carries an identifier that uniquely specifies the actual recipient (part instance (i.e., connection) ID). ZP CMX
extracts the identifier from the incoming request and dispatches the request to the corresponding part instance.
DM SPL, DM BFL - Event Flow Splitters (FilteisJ
Fig. 51 illustrates the boundary of the inventive DM SPL part.
Fig. 52 illustrates the boundary of the inventive DM_BFL part.
DM-SPL is a connectivity part. DM SPL is designed to split the flow of events received on its in terminal into two: one going out through its out terminal and a second one going out through the aux terminal. The event split depends upon whether the incoming event is in range defined by the ev-min and ev-max properties.
The event flow going through the out terminal (passing through) is considered to be the "main flow" - the majority of the events should go there; the one going to the aux terminal is the "secondary flow" (auxiliary events) - these events are the generally exceptions from the main flow.

DM SPL can be parameterized for the range of auxiliary events. This range is contiguous (cannot have "holes") and is defined by the upper and the lower boundaries. .
Hint: to construct a non-contiguous range: daisy-chain instances of DM SPL.
54. Boundary 54.1. Terminals (DM SPL) Terminal "in" with direction "In" and contract I_DRAIN. Note: All input events are received here and the main flow is forwarded to out terminal. The auxiliary flow is forwarded to aux terminal. The status returned is the one returned by the operation on the out or aux terminals depending to which terminal the event is forwarded to.. If the terminal to which the event is forwarded is not connected, the operation will return CMST-NOT CONNECTED. Unguarded. Can be connected when the part is active.
Terminal "out" with direction "Out" and contract I DRAIN. Note: All main flow events received on in terminal are forwarded through here. Can be connected when the part is active.
Terminal "aux" with direction "Out" and contract I-DRAIN. Note: All auxiliary events are forwarded through here. Can be connected when the part is active.
54.2. Terminals (DM BFL) Terminal "in" with direction "Plug" and contract I DRAIN. Note: All input events are received here and the main flow is forwarded to out terminal. The auxiliary flow is forwarded to aux terminal. The status returned is the one returned by the operation on the out or aux terminals depending to which terminal the event is forwarded to.. If the terminal to which the event is forwarded is not connected, the operation will return CMST-NOT CONNECTED. Unguarded. Can be connected when the part is active.
Terminal "out" with direction "Plug" and contract I DRAIN. Note: All main flow events received on in terminal are forwarded through here. Can be connected when the part is active.

Terminal "aux" with direction "Plug" and contract I_DRAIN. Note: All auxiliary events are forwarded through here. Can be connected when the part is active.
54.3. Events and notifications All events received on in terminal are forwarded either to the out or to the aux terminals depending on whether they are considered main flow or auxiliary.
The range of auxiliary event IDs (contiguous) can be controlled by the outer scope by properties.
54.4. Special events, frames, commands or verbs None.
54.5. Properties Property "ev-min" of type "UINT32". Note: Lower boundary of the auxiliary events.
This is the lowest event ID value (inclusive) that will be considered auxiliary. If ev min is EV-NULL, DM SPL will consider all events auxiliary if their event ids are less than ev max. If both ev min and ev max are EV NULL, all events are considered auxiliary and sent through aux. Default: EV NULL.
Property "ev-max" of type "UINT32". Note: Upper boundary of the auxiliary events.
If ev-max is EV-NULL, DM SPL will consider all events auxiliary if their event ids are greater than ev min. If both ev min and ev max are EV NULL, all events are considered auxiliary and sent through aux. Default: EV NULL.
55. Encapsulated interactions None.
56. Specification
57. Responsibilities 8. If event received on the in terminal is between ev min and ev max, pass through the aux terminal (auxiliary flow).
9. If event received on the in terminal is not between ev min and ev-max, pass through the out terminal (main flow).
10. DM-BFL: Pass all events received from aux through in.
1 1. DM-BFL: Pass all events received from out through in.
58. Theory of operation Fig. 53 illustrates the internal structure of the inventive DM-BFL part.
DM SPL and DM-BFL split the event flow into two flows: main flow and auxiliary events. The main flow events are passed through the out terminal, the auxiliary to aux terminal.
The range of auxiliary events is controlled by properties.
DM lFL T, DM lFL TB - Filters b y Integer Value Fig. 54 illustrates the boundary of the inventive DM_IFLT part.
Fig. 55 illustrates the boundary of the inventive DM_IFLTB part.
DM-IFLT/DM-IFLTB are connectivity parts. DM-IFLT/DM IFLTB are designed to split the flow of operations received on their in terminals into two: one going through their out terminals and a second one going through their aux terminals. The operation split depends upon whether the incoming filter integer value (contained in the operation bust is in range defined by the min and max properties.
The operation flow going through the out terminal (passing through) is considered to be the "main flow" - the majority of the operations should go here; the one going to the aux terminal is the "secondary flow" (auxiliary operations) - these operations are generally exceptions from the main flow.
DM-IFLT/DM-IFLTB can be parameterized for the range of auxiliary operations.
This range is contiguous (cannot have "holes") and is defined by lower and the upper boundaries (min and max properties respectively). .
Note: To construct a non-contiguous auxiliary range, daisy-chain instances of DM IFLT/DM IFLTB.
59. Boundary 59.1. Terminals (DM (FLT) Terminal "in" with direction "In" and contract I-POLY. Note: All input operations are received here and the main flow is forwarded to the out terminal. The auxiliary flow is forwarded through the aux terminal. The status returned is the one returned by the operation on the out or aux terminals depending on which terminal the operation is forwarded to. If the terminal to which the operation is forwarded is not connected, the operation will return CMST-NOT CONNECTED. This terminal is unguarded.
DM_IFLT does not enter its guard at any time.
Terminal "out" with direction "Out" and contract I POLY. Note: All main flow operations received on the in terminal are forwarded through here. The main flow are operations in which their buses filter integer value falls outside of the range min...max.
Terminal "aux" with direction "Out" and contract I-POLY. Note: All auxiliary operations are forwarded through here. The auxiliary flow are operations in which their buses filter integer value falls in the range of min...max.
59.2. Terminals (DM IFLTB) Terminal "in" with direction "Plug" and contract I-POLY. Note: All input operations are received here and the main flow is forwarded to the out terminal. The auxiliary flow is forwarded through the aux terminal. The status returned is the one returned by the operation on the out or aux terminals depending on which terminal the operation is forwarded to. If the terminal to which the operation is forwarded is not connected, the operation will return CMST NOT CONNECTED. This terminal is unguarded. DM-IFLTB does not enter its guard at any time.
Terminal "out" with direction "Plug" and contract I POLY. Note: All main flow operations received on the in terminal are forwarded through here. The main flow are operations in which their buses filter integer value falls outside of the range min...max. All operations invoked through this terminal are passed directly through in without modification.
Terminal "aux" with direction "Plug" and contract I-POLY. Note: All auxiliary operations are forwarded through here. The auxiliary flow are operations in which their buses filter integer value falls in the range of min...max. All operations invoked through this terminal are passed directly through in without modification.
59.3. Events and notifications All operations and events received on the in terminal are forwarded either to the out or to the aux terminals depending on whether they are considered main flow or auxiliary.

To use DM-IFLT/DM-IFLTB to filter events by ID, they may be parameterized to use the event ID as the filter integer value. The min and max properties can be used to specify the range of the event IDs that are sent through the aux terminal (auxiliary flow). See the properties below for more information.
59.4. Special events, frames, commands or verbs None.
59.5. Properties Property "offset" of type "UINT32". Note: Offset of the filter integer value in the bus passed with the operation received on the in terminal (specified in bytes). The l0 offset is specified from the beginning of the operation bus. The size of the integer value stored at this offset is expected to be 32-bits. Default is 0 (first field in operation bus).
Property "mask" of type "UINT32". Note: Bitwise mask ANDed with the integer value extracted from the operation bus. DM IFLT/DM IFLTB masks the extracted integer value before comparing it to min and max. Default is OxFFFFFFFF (no change).
Property "min" of type "UINT32". Note: Lower boundary of the auxiliary operations.
This is the lowest integer value (inclusive) that is considered auxiliary. If filtering events, this is the lowest event ID that is considered auxiliary. Default is 0.
Property "max" of type "UINT32". Note: Upper boundary of the auxiliary operations.
This is the upper most integer value (inclusive) that is considered auxiliary.
If filtering events, this is the upper most event ID that is considered auxiliary. Default is OxFFFFFFFF.
60. Encapsulated interactions None.
61. Specification
62. Responsibilities 12. If the. operation filter integer value received on the in terminal is between min and max, pass operation through the aux terminal lauxiliary flowl.

13. If the operation filter integer value received on the in terminal is not between min and max, pass operation through the out terminal (main flow).
14. Before comparing the filter integer value with the min and max properties, bitwise AND the filter value with the mask property.
15. DM_IFLTB: Pass all operations received from aux through in.
16. DM-IFLTB: Pass all operations received from out through in.
63. Theory of operation DM IFLT is a coded part.
DM IFLTB is a static assembly 63.1. Mechanisms Filtering Operations DM IFLT and DM IFLTB split the operation flow into. two flows: main flow and auxiliary. The main flow operations are passed through the out terminal, the auxiliary to the aux terminal.
Which flow an operation belongs to is determined by the filter integer value in the operation bus. DM-IFLT/DM-IFLTB extracts the filter integer value from the operation bus using the offset property. This value is then ANDed (bitwise) with the mask property value. The resulting value is then compared to the min and max values to check which flow the operation belongs to.
The auxiliary flow are operations in which the filter integer value falls into the range min...max. Operations in which the filter integer value falls outside of the min...max range are considered main flow and are passed through the out terminal.
DM-IFLT/DM-IFLTB do not modify the operation bus received on the in terminal.
If a NULL bus is passed with the operation, the operation is passed through the out terminal (main flow).
63.2. Use Cases Filtering Operations by Integer Value Fig. 56 illustrates the internal structure of the inventive DM-IFLT part.
1. The structure in the above figure is created.
2. DM_IFLT is parameterized with the following:

a. offset = offset of integer value in operation bus b. mask = mask to AND integer value with c. min = minimum boundary of auxiliary flow d. max = maximum boundary of auxiliary flow 3. The structure in the above figure is connected and activated.
4. At some point, Part A invokes an operation through DM-IFLT
passing an operation bus that contains some integer value.
5. DM-IFLT extracts the filter integer value from the operation bus passed with the call. DM-IFLT uses the offset property to extract the value.
6. DM_IFLT then ANDs the integer value with the value of the mask property.
7. The resulting value is compared to the min and max properties. If the value is outside this range, the operation is forwarded through the out terminal and arrives in Part B (main flow). Otherwise, the operation is forwarded through the aux terminal and arrives in Part C (auxiliary flow).
8. Steps 4-7 may be executed many times.
Filtering Events by /D
Fig. 57 illustrates an advantageous use of the inventive DM-IFLTB part.
1. The structure in the above figure is created.
2. DM-IFLT is parameterized with the.following:
a. offset = offset of the event ID (offsetof (CMEVENT HDR, id)) b. mask = mask to AND integer value with (OxFFFFFFFF) c. min = minimum boundary of auxiliary flow events d. max = maximum boundary of auxiliary flow events 3. The structure in the above figure is connected and activated.
4. At some point, Part A sends an event to DM IFLT.
5. DM-IFLT extracts the event ID from the event bus passed with the call.
DM-IFLT uses the offset property to extract the ID.
6. DM-IFLT then ANDs the event ID with the value of the mask property leaving the event ID unchanged.

7. The event ID is compared to the min and max properties. If the ID is outside this range, the event is forwarded through the out terminal and arrives in Part B (main flow). Otherwise, the event is forwarded through the aux terminal and arrives in Part C (auxiliary flow).
8. Steps 4-7 may be executed many times.
OM SFL T and DM SFL T4 - String Filters Fig. 58 illustrates the boundary of the inventive DM SFLT part.
Fig. 59 illustrates the boundary of the inventive DM SFLT4 part.
DM SFLT and DM-SFLT4 filter incoming requests received on in by comparing a string contained in the operation bus with a templates) that the part is parameterized with. When a match is found, DM-SFLT forwards the operation to its aux terminal and DM SFLT4 forwards the operation to the aux terminal that corresponds to the template that was matched. When no match is found, the operation is forwarded to out.
The template can be one of four forms:
~ "" -~ Send all operations out out.
~ "String" ~ Match the string exactly.
~ "String" ~ Match strings starting with specified string up to "'~ ".
~ "~" ~ Send all operations out aux.
64. Boundary 64.1. Terminals (DM SFLT) Terminal "in" with direction "In" and contract I POLY. Note: v-table, infinite cardinality. All operations received are either passed to out terminal or aux terminal based on whether template is matched. This input is unguarded.
Terminal "out" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1 Output for operations that do not match template string.
Terminal "aux" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1 Output for operations that match template string.

64.2. Terminals (DM SFLT4) Terminal "in" with direction "In" and contract I POLY. Note: v-table, infinite cardinality. All operations received are either passed to out or to one of the aux terminals based on which template is matched. This input is unguarded.
Terminal "out" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1 Output channel.for those operations where the string does not match any of the templateX properties.
Terminal "aux1 " with direction. "Out" and contract I-POLY. Note: v-table, cardinality 1 Output channel for those operations that contain a string matching template1 property.
Terminal "aux2" with direction "Out" and contract I_POLY. Note: v-table, cardinality 1 Output channel for those operations that contain a string matching template2 property.
Terminal "aux3" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1 Output channel for those operations that contain a string matching template3 property.
Terminal "aux4" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1 Output channel for those operations that contain a string matching template4 property.
64.3. Events and notifications None.
64.4. Special events, frames, commands or verbs None.
64.5. Properties (DM SFLT) Property "offset" of type "UINT32". Note: Offset of string in operation bus.
The default value is 0x00.
Property "by_ref" of type "UINT32". Note: (boolean) If TRUE, the string in the bus is by reference. If FALSE, the string is contained in the bus. The default value is FALSE.

Property "ignore case" of type "UINT32". Note: (boolean) If TRUE, the string compare is not case-sensitive. The default is TRUE.
Property "template" of type "ASCIZ". Note: Template to use when comparing strings. The default value is "".
64.6. Properties (DM SFLT4) DM SFLT4 has separate templates for each of its filter channels. All other properties are common to all channels.
Property "offset" of type "UINT32". Note: Offset of string in operation bus.
The default value is 0x00.
Property "by-ref" of type "UINT32". Note: (boolean) If TRUE, the string in the bus is by reference. If FALSE, the string is contained in the bus. The default value is FALSE.
Property "ignore case" of type "UINT32". Note: (boolean) If TRUE, the string compare is not case-sensitive. The default is TRUE.
Property "template1 " of type "ASCIZ". Note: Template to use when comparing strings for operations to be forwarded to auxl . The default is "".
Property "template2" of type "ASCIZ". Note: Template to use when comparing strings for operations to be forwarded to aux2. The default is "".
Property "template3" of type "ASCIZ". Note: Template to use when comparing .
strings for operations to be forwarded to aux3. The default is "".
Property "template4" of type "ASCIZ". Note: Template to use when comparing strings for operations to be forwarded to aux4. The default is "".
65. Encapsulated interactions None.
66. Specification
67. Responsibilities 1. Forward operations that contain a string matching the template property in its bus to the respective aux terminal.
2. Forward all other operations to the out terminal.
68. Theory of operation 68.1. State machine None.
68.2. Mechanisms Dereferencing String If the by-ref property is FALSE, then the offset in the bus is treated as a byte location representing the first character of the string. If the by-ref property is TRUE, then the offset is treated as a DWORD value that is converted into a character pointer.
69. Dominant's Responsibilities (DM SFLT4) 69.1. Hard Parameterization of Subordinates DM-SFLT4 does not perform any hard parameterization of its subordinates.
69.2. Distribution of Properties to the Subordinates Property nameType DistrTo offset UINT3 bcas sfltX.offset 2 t by-ref UINT3 bcas sfltX.by ref 2 t ignore case UINT3 bcas sfltX.ignore case 2 t template1 ASCIZ redirsflt1.template template2 ASCIZ redir sflt2.template template3 ASCIZ redir sflt3.template template4 ASCIZ redir sflt4.template DM lRPFL T - /RP Event Filter Fig. 60 illustrates the boundary of the inventive DM-IRPFLT part.

DM_IRPFLT is designed to filter IRP events received on its in terminal and send the filtered events to a separate terminal (aux). The events that are not subject to filtering are passed through to the out terminal.
The event flow going through the out terminal (passing through) is considered to be the "main flow" - the majority of the events should go there; the one going to the aux terminal is the "secondary flow" (auxiliary events) - these events are generally exceptions from the main flow.
DM-IRPFLT is parameterized with the function codes (both major and minor), of the auxiliary IRP events. No more than one major and up to 32 minor codes are supported. If no minor codes are specified, the filtering is done only by major function code (the minor is ignored).
70. Boundary 70.1. Terminals Terminal "in" with direction "In" and contract I-DRAIN. Note: All input events are received here and the main flow is forwarded to out terminal. The auxiliary events are forwarded to aux terminal. The status returned is the one returned by the operation on the out or aux terminals depending to which terminal the event is forwarded to. If the terminal to which the event is forwarded is not connected, the operation will return CMST_NOT CONNECTED. Unguarded. Can be connected when the part is active.
Terminal "out" with direction "Out" and contract I DRAIN. Note:.All main flow events received on in terminal are forwarded through here. Can be connected when the part is active.
Terminal "aux" with direction "Out" and contract I-DRAIN. Note: All auxiliary events are forwarded through here. Can be connected when the part is active.
70.2. Events and notifications received on the "in" terminal Incoming Event Bus Notes EV REO, IRP B EV IR Indicates that IRP
P needs processing.

70.3. Properties Property "irp-mj" of type "UCHAR". Note: Major function code of IRP events considered auxiliary. If OxFF is specified, all events are sent to aux, without regard to other properties. Default: OxFF.
Property "irp-mnf0..31]" of type "UCHAR". Note: Array of IRP minor function codes.
If irp mj is not OxFF, these codes are used to determine whether an IRP event should be sent to considered Default: OxFF.
71. Encapsulated interactions DM-IRPFLT calls the Windows I/O manager to retrieve IRP stack location.
72. Specification
73. Responsibilities Pass main flow events to out terminal.
Pass auxiliary events to aux terminal
74. Theory of operation 74.1. Main data structures l0 STACK LOCATION (system-defined) This structure is used by the I/O Manager to pass the arguments for all driver functions (IRP MJ xxx).
75. Notes If DM IRPFLT is parameterized to filter minor IRP codes and an IRP
received on in has a minor code > = 32, the IRP is simply passed through the out terminal without modification.
DM BSP - Bi-directional Spiitter Fig. 61 illustrates the boundary of the inventive DM BSP part.
DM-BSP is a CIassMagic adapter part that makes it possible to connect parts with bi-directional terminals to parts that have uni-directional terminals.
All of DM-BSP terminals are I-POLY; thus DM-BSP can be inserted between any bus-based cdecl v-table connection (as long as there are no more then 64 operations implemented on the counter terminals of DM BSP). The terminals are also activetime and unguarded providing maximum flexibility in its use.

DM BSP is inserted between a part with a bi-directional terminal and one or two parts with uni-directional terminals (one input and one output). DM BSP
forwards operation calls between the parts. Operations invoked on its bi terminal are forwarded out through the out terminal. Operations invoked on its in terminal are forwarded out through the bi terminal. This allows the parts connected to DM
BSP
to communicate as if they were directly connected to each other.
The bus passed with the operation calls are not interpreted by DM BSP.
76. Boundary 76.1. Terminals l0 Terminal "in" with direction "In" and contract I POLY. Note: v-table, infinite cardinality, synchronous, unguarded, activetime Operations invoked through this terminal are redirected out through the bi terminal. The bus passed with the call is not interpreted by DM BSP.
Terminal "out" with direction "Out" and contract I_POLY. Note: v-table, cardinality 1, synchronous, unguarded, activetime Operations invoked through the bi terminal are redirected out through this terminal. The bus passed with the call is not interpreted by DM BSP.
Terminal "bi" with direction "Bidir (plug)" and contract I_POLY. Note: v-table, cardinality 1, synchronous, unguarded, activetime Operations invoked through this terminal are redirected out through the out terminal. Calls received from the in terminal are redirected out through this terminal. The bus passed with the call is not interpreted by DM BSP.
76.2. Events and notifications None.
76.3. Special events, frames, commands or verbs None.
76.4. Properties None.
77. Encapsulated interactions None.
78. Specification
79. Responsibilities 1 . Provide a compatible connection between a bi-directional terminal and two uni-directional terminals lone input and one output).
80. Theory of operation 80.1. State machine None.
80.2. Main data structures None.
80.3. Mechanisms Forwarding operation calls between parts Fig. 62 illustrates an advantageous use of the inventive DM_BSP part.
DM-BSP makes it possible to connect a bi-directional terminal on one part to uni-directional terminals on other parts. DM-BSP accomplishes this by forwarding the operations invoked on them to the appropriate part.
When DM-BSP receives a call through its in terminal, it redirects the call out through its bi terminal. When a call is received on the bi terminal, it is redirected out through the out terminal. This mechanism provides a compatible connection between the counter terminals of in, out and bi.
The bus received with the operation calls are not interpreted by DM BSP.
80.4. Use Cases Connecting two parts to a bi-directional terminal using DM BSP
1. In order to establish the connections in the diagram above, DM BSP must be inserted between parts A, B and C.
2. All the parts are constructed.
3. Part A's bi terminal is connected to DM BSP's bi terminal.
4. DM BSP's in termirial is connected to Part B's out terminal.
5. DM BSP's out terminal is connected to Part C's in terminal.
6. All the parts are activated.
7. At some point, Part A invokes an operation through its bi terminal.

8. DM-BSP receives the operation call on its bi terminal and redirects the call out through its out terminal.
9. Part C receives the operation call on its in terminal and executes code for the operation. When the operation is complete, control is returned back to Part A where the operation call originated.
10.At some point, Part B invokes an operation through its out terminal.
1 1 . DM BSP receives the operation call on its in terminal and redirects the call out through its bi terminal.
12. Part A receives the operation call on its bi terminal and executes code for the operation. When the operation is complete, control is returned back to Part B where the operation call originated.
13. Steps 7-9 and 10-12 may be executed many times.
14.A11 the parts are deactivated and destroyed.
Connecting a part with two uni-directional terminals to a part with a bi-directional terminal using DM BSP
Fig. 63 illustrates an advantageous use of the inventive DM BSP part.
1. In order to establish the connections in the diagram above, DM BSP must be inserted between parts A and B.
2. All the parts are constructed.
3. Part A's bi terminal is connected to DM BSP's bi terminal.
4. DM BSP's in terminal is connected to Part B's out terminal.
5. DM BSP's out terminal is connected to Part B's in terminal.
6. All the parts are activated.
7. The operation calls are forwarded in the same way as in the first use case.
8. All the parts are deactivated and destroyed.
DM DlS - Device Interface Splitter Fig. 64 illustrates the boundary of the inventive DM-DIS part.
DM DIS dispatches the operations on its in terminal to the out1 and out2 terminals using a preview call to determine which of the two outputs will accept the operations. The preview operation is the same operation as the one received on in, with the DIO A PREVIEW attribute set in the bus.
DM_DIS always calls both outl and out2 on preview and interprets the return status as follows:
CMST-OK - the operation is acceptable, the part will process it synchronously /i.e. will not return CMST PENDING status).
CMST-SUBMIT - the operation is acceptable, the part claims the exclusive right to execute the operation. The operation may be processed asynchronously.
Other - the operation is not implemented.
Depending on the combination of returned statuses, DM-DIS calls out1, out2 or both with the preview flag cleared. The complete definition of all combinations can be found in the boundary section below.
To allow DM-DIS to be chained, it handles specially incoming calls on in with the preview attribute set - the preview is passed to out1 or out2 and if any of them returns CMST SUBMIT or CMST OK, DM DIS returns with this status and enters a "pass" state, expecting the next call to be the same operation with the preview attribute cleared. This call will be passed transparently to the outputs) that originally returned CMST SUBMIT or CMST OK.
Incoming calls on out1 and out2 are forwarded transparently to in.
81. Boundary 81.1. Terminals Terminal "in" with direction "Bidir" and contract In: I DIO Out: I DIO C.
Note:
Multiplexed input/output. Incoming calls are dispatched to out1 and out2. See the section "Requirements to Parts Connected to DM DIS" for requirements to parts connected to this terminal.
Terminal "out1 " with direction "Bidir" and contract In: I DIO C Out: I DIO.
Note:
Dispatched input/output #1. Calls to this terminal are passed transparently to in.
See the section "Requirements to Parts Connected to DM-DIS" for requirements to parts connected to this terminal.

Terminal "out2" with direction "Bidir" and contract In: I DIO C Out: I DIO.
Note:
Dispatched input/output #2. Calls to this terminal are passed transparently to in. See the section "Requirements to Parts Connected to DM-DIS" for requirements to parts connected to this terminal.
81.2. Events and notifications None.
81.3. Special events, frames, commands or verbs None.
81.4. Properties None.
81.5. Requirements to Parts Connected to DM DIS
Requirements to the Parts Connected to out1 and out2 The parts connected to the out1 and out2 terminals should cooperate with DM-DIS by responding to preview calls, so that DM_DIS can determine how to distribute the calls on in to these parts.
When a part receives a call with the preview attribute set it should determine if it will handle the operation and return one of the following statuses:
CMST-OK - the part will handle the operation synchronously and it is OK for another part to handle the same operation (non-exclusive claim).
CMST-SUBMIT - the part will handle the operation either synchronously or asynchronously and it should be the only part to handle the operation (exclusive claim).
Any error status - the part will not handle the operation.
A part performs the operations when it receives them with the preview attribute cleared. If the operation was claimed non-exclusively (by returning CMST OK on preview) the part should not return CMST PENDING. DM DIS will detect this and display an error message on the debug console.
Requirements to the Part Connected to in A part connected to the in terminal may use two modes of operation:
normal - all calls are submitted with the "preview" attribute cleared.

preview/submit - each call is submitted first with the preview attribute set, then (if the return status is CMST OK or CMST SUBMIT) with the preview attribute cleared. If DM_DIS is chained, there should be no intervening calls to other operations between the preview and the submit call. The out1 and out2 terminals of DM-DIS itself conform to these requirements, so that two or more instances of DM-DIS can be chained. If DM_DIS is not chained, there can be any number of operation calls between the preview and the submit call.
A part connected to the in terminal is not required to keep using only one of the above modes - they can be interchanged on a per-call basis.
l0 82. Encapsulated interactions None.
83. Specification 84. Responsibilities Distribute calls on the in terminal to the out1 and out2 terminals, use preview calls to determine which outputls) should handle each call.
Allow connection of a part that uses preview calls (e.g., another instance of DM DIS) to be connected to the in terminal.
Pass calls from out1 and out2 transparently to in.
85. Theory of operation 85.1. State machine None.
85.2. Main data structures None.
85.3. Mechanisms Preview Mechanism DM-DIS uses this mechanism to determine which of the two right-side terminals (out1 or out2) will handle an incoming call from in. The following outcomes are defined:
Non-exclusive claim - one or more outputs will handle the operation.
Asynchronous completion is not allowed.

Exclusive claim - only one output will handle the operation. Asynchronous completion is allowed.
Operation Rejected - none of the outputs will handle the operation.
Preview failed - conflicting claims.
DM-DIS performs the following steps:
Call out1 with the preview attribute set and save the return status Call out2 with the preview attribute set and save the return status Determine the preview outcome as follows:
one or both preview calls returned CMST OK, none of them returned CMST SUBMIT - non-exclusive claim one of the calls returned CMST SUBMIT, the other returned an error -exclusive claim both calls returned an error - operation rejected none of the above - preview failed Call Distribution This mechanism is used when DM-DIS receives the calls on in with the preview attribute cleared:
The preview mechanism (as described above) is invoked to determine the preview outcome.
If the outcome was "non-exclusive claim" - call the terminalls) that returned CMST-OK, log an error if any of the calls returns CMST-PENDING. The status returned in case both outputs are invoked is the status from the second call if the first one returned CMST OK and the status from the first call otherwise.
If the outcome was "exclusive claim" - call the terminal that returned CMST SUBMIT and return the status from that call.
If the outcome was "operation refused" return the status from the first preview.
If the statuses from preview indicate conflict, log an error message and return CMST UNEXPECTED.

Preview Forwarding This mechanism is used when DM-DIS is invoked on in with the preview attribute set:
The preview mechanism (as described above) is invoked.
If the operation is rejected - return the status from the preview on out1.
If the preview failed - log an error and return CMST-UNEXPECTED.
Save the outcome, including which outputs) claimed the operation.
Remember the operation that was invoked.
Set "pass" flag - this will cause the next operation on in to be processed as described in the next mechanism below.
Return CMST OK if the claim was non-exclusive or CMST SUBMIT if the claim was exclusive.
Submit Forwarding This mechanism is used when DM-DIS has the "pass" flag set and the in terminal is invoked on the same operation as the one that caused the "pass" flag to be set:
1. Clear the "pass" flag 2. If the saved outcome was "non-exclusive claim" - call the terminals) that returned CMST OK, log an error if any of the calls returns CMST PENDING.
The status returned in case both outputs are invoked is the status from the second call if the first one returned CMST OK and the status from the first call otherwise.
3. If the saved outcome was "exclusive claim" - call the terminal that returned CMST SUBMIT and return the status from that call.
85.4. Use Cases Using DM DlS to arbitrate between two parts that implement subsets of l DlO
If two parts implement non-intersecting subsets of I-DIO they can be connected with DM-DIS to produce a single I-DIO terminal that exposes the combined functionality of the two parts. To do this the two parts should:

Check the preview attribute in the bus and return CMST SUBMIT if it is set and the part implements the requested operation or CMST NOT IMPLEMENTED
otherwise.
Execute the operation when called with the preview attribute cleared.
While processing a call with the preview attribute set, the parts should not perform any action or state change under the assumption that they will receive the operation later, e.g. invoke complete operation on the back channel of the I DIO connection.
In this case DM DIS will:
call the out1 terminal (with preview set) call the out2 terminal (with preview set) call out1 or out2 depending on which one returned CMST SUBMIT and return the status from the operation Chained operation The in terminal of DM_DIS may be connected to another part that uses the preview/submit pattern used by DM DIS itself.
Case 1 (no CMST SUBMIT or CMST OK) DM-DIS receives a call on in with the preview attribute set.
DM-DIS calls both out1 and out2 with the operation, none of them returns CMST SUBMIT or CMST OK
DM DIS returns the status from out1 .
Case 2 (one of the outputs returns CMST SUBMIT) DM_DIS receives a call on in with the preview attribute set DM-DIS calls both out1 and out2 with the operation the following information is saved:
set "pass" flag which output returned CMST SUBMIT (1 or 2) which I DIO operation was called DM DIS returns CMST SUBMIT

When the next call is received on in; if not the same call as the one saved in step 3, DM-DIS resets the "pass" flag and processes the call as normal (depending on the preview flag) If the call is the same: the call is passed to the output (as saved from step 3).
Case 3 lone or both outputs returns CMST OK) receive a call on in with the preview attribute set call both out1 and out2 with the operation save the following information in self:
l0 set "pass" flag which outputs) returned CMST OK
which I-DIO operation was called return CMST OK
receive a call on in; if not the same call as the one saved in step 3, reset the "pass" flag and process the call as normal (depending on the preview flag) If the call is the same: the call is passed to the outputs) (as saved from step 3). If one or both calls return CMST-PENDING, log an error.
If only one output was called - DM DIS returns the status from that call.
If both outputs were called - DM DIS returns the status from the second call if the first one returned CMST OK and the status from the first call otherwise.
Bi-directional operation Parts that implement the I DIO interface can use the back channel of the I DIO
connection to complete the operations asynchronously. This is done by.
returning CMST-PENDING when the operation is submitted and invoking I-DIO C.complete operation on the back channel when the operation is completed.

If a part connected to out1 or out2 has to complete an operation asynchronously, it should return CMST SUBMIT on preview. This will guarantee that it will be the only part to execute the operation.
If DM-DIS receives CMST-PENDING status from a part that has not claimed exclusive access (by returning CMST SUBMIT on preview) it will log an error message.
DM lEV - Idle Generator Driven by Event Fig. 65 illustrates the boundary of the inventive DM-IEV part.
DM-IEV generates idle events when it receives an external event. Upon receiving an event (EV XXX) at its in terminal, DM-IEV will continuously generate EV
IDLE
events through idle until the sending of the EV-IDLE event returns CMST NO
ACTION
or CMST BUSY, or until DM IEV receives an EV REQ DISABLE event from idle. The incoming event is not interpreted by DM-IEV; it is always forwarded through the out terminal.
DM_IEV has a property called idle first which controls when the idle generation should take place. If TRUE, the idle generation begins before sending the incoming event through out; otherwise the idle generation happens after the event is sent.
DM-IEV keeps internal state indicating whether the idle generation is enabled or disabled. The idle generation becomes enabled or disabled when DM IEV receives EV-REQ ENABLE or EV REQ DISABLE, respectively. By default, the idle generation is enabled.
86. Boundary 86.1. Terminals Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, infinite cardinality, floating, synchronous. This terminal receives all the incoming events for DM IEV.
Terminal "out" with direction "Out" and contract I DRAIN. Note: v-table, cardinality 1, floating, synchronous. DM-IEV sends all events received from in out through this terminal. The events are not interpreted by DM IEV.

Terminal "idle" with direction "Bi" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous. The EV_IDLE events are sent out through this terminal.
EV REQ ENABLE and EV_REQ DISABLE may be received through this terminal to control the idle generation.
86.2. Events and notifications Event Bus Notes < all > CMEVENTAll incoming events received from in -HDR terminal are passed through out /CMEvent terminal.

Depending on the value of the idle first property, DM_IEV
will send the event out either before or after the idle generation.

86.3. Special events, frames, commands or verbs Speciallncoming Bus Notes Event EV_REQ-ENABL CMEVENT A request to start the idle E -HDR/CME generation. It is received vent through the idle terminal.
This request is sent by an idle consumer.
Enabling and disabling are not cumulative.
EV-REQ-DISABL CMEVENT A request to stop the idle E -HDR/CME generation. It is received vent through the idle terminal.
This request is sent by an idle consumer.
Enabling and disabling are not cumulative.
Special Outgoing Bus Notes Event EV-IDLE ~ CMEVENT This event is generated -HDR/CME continuously either before vent or after sending the incoming event out through out (Depending on the setting of the idle first property).
86.4. Properties Property "idle first" of type "UINT32". Note: If TRUE, DM-IEV will generate EV
IDLE
events continuously before passing the incoming event to the out terminal. If FALSE, EV IDLE feed will be generated after passing the incoming event to the out terminal.
Non-mandatory, Default is FALSE
87. Encapsulated interactions None.
88. Specification 89. Responsibilities 1. Generate EV-IDLE events until the idle generation is disabled or a CMST NO ACTION or CMST BUSY event status is returned.
2. Pass the incoming event through out terminal.
3. Maintain the internal state of the idle generation.

90. Theory of operation 90.1. Mechanisms Idle generation Idle generation becomes enabled or disabled when DM IEV receives EV-REa ENABLE or EV REQ_DISABLE respectively (through the idle terminal). By default, idle generation is enabled.
The idle generator is a tight loop that will continuously generate EV IDLE
events through the idle terminal. The generation will stop if the event return status is CMST NO ACTION or CMST BUSY or if EV REO. DISABLE is received on the idle terminal.
Passing the external event The incoming event is passed through the out terminal either before or after the idle generation. This is determined by the value of the idle first property.
If the property is TRUE, the incoming event is sent out after the idle generation, otherwise its sent before.
90.2. Use Cases Idle generation after passing the event through 1 . The counter terminal of in sends an event to DM IEV. The idle first property is FALSE.
2. The event is passed through the out terminal.
3. If the idle generation is enabled, EV-IDLE events are continuously generated and sent out through the idle terminal. The idle generation stops either when an EV-REQ-DISABLE event is received through the idle terminal or an event status of CMST NO ACTION or CMST BUSY is returned.
4. DM-IEV returns with the status obtained in step 2 above.
Idle generation before passing the event through 5.. The counter terminal of in sends an event to DM IEV. The idle first property is TRUE.

6. If the idle generation is enabled, EV IDLE events are continuously generated and sent out through the idle terminal. The idle generation stops either when an EV REO. DISABLE event is received through the idle terminal or when an event status of CMST NO ACTION or CMST BUSY is returned.
7. The event is passed through the out terminal.
Notes DM-IEV is an idle feed generator driven by external events. Whenever it receives an incoming call (event), the idle generator propagates it to its output and then starts generating idle feed, or pulse event, IEV-IDLE) through its idle terminal.
When it receives indication that there is no more need for idle feed, it returns to the original caller.
Together with DM DWI, this part forms a complete implementation of the run to completion pattern. Whenever an incoming call is received, DM-IEV sends it out for processing; during this processing, one or more events may get enqueued on the desynchronizer's queue for later processing. When DM IEV receives control back, it starts feeding events into the desynchronizer, causing all pending events to be distributed. As a result, before DM IEV returns to its caller, all events that were generated during the processing of the original call, are completely served.
In conjunction with the poly-to-drain and drain-to-poly adapters, this mechanism can provide run to completion for practically any input interface.
Terminators DM STP DM BST DM PST, DM PBS - Event and Operation Stoppers Fig. 66 illustrates the boundary of the inventive DM STP part.
Fig. 67 illustrates the boundary of the inventive DM-BST part.
Fig. 68 illustrates the boundary of the inventive DM_PST part.
Fig. 69 illustrates the boundary of the inventive DM PBS part.

DM STP is a connectivity part. DM STP consumes all events' that come to its in terminal and returns a status code specified in a property.
One of the important aspects of the DM_STP functionality is processing of self-owned events (CMEVT A-SELF OWNED). These events need special handling as the ownership of the memory allocated for them travels with them.
DM-STP frees the self-owned events if the return status (specified by a property) is CMST-OK. For compatibility reasons DM STP exposes a property, which can force freeing the event memory regardless of the return status.
DM-PST and DM-PBS are I-POLY operation stoppers. These parts can be used l0 to stub any interface and return the appropriate status.
1. Boundary 1.1. Terminals (DM STP) Terminal "in" with direction "In" and contract I-DRAIN. Note: All input events are received here and consumed by the part. The status returned is the one specified by the ret s property. Unguarded. Can be connected when the part is active.
1.2. Terminals (DM BST) Terminal "in" with direction "Plug" and contract I-DRAIN. Note: All input events are received here and consumed by the part. The status returned is the one specified by the ret s property. Unguarded. Can be connected when the part is active.
1.3. Terminals (DM PST) Terminal "in" with direction "In" and contract I-POLY. Note: All operations received here and consumed by the part. The status returned is the one specified by the ret s property. Unguarded. Can be connected when the part is active.
1.4. Terminals (DM PBS) Terminal "in" with direction "Plug" and contract I-POLY. Note: All operations received here and consumed by the part. The status returned is the one specified by the ret s property. Unguarded. Can be connected when the part is active.
' DM STP is something like a "black hole" - events go in, nothing goes out.

1.5. Events and notifications All events received on in terminal are consumed.
The memory allocated for the self-owned events is freed if the return status (property) is CMST OK.
If the value of the force free property is TRUE then the memory for the self-owned events is freed regardless of the return status.
1.6. Special events, frames, commands or verbs None.
1.7. Properties l0 Property "ret s" of type "UINT32". Note: Status to return on the raise operation.
Default: CMST OK.
Property "force free" of type "UINT32". Note: Set to TRUE to free self-owned events without regard of what ret s value is. Default: FALSE.
2. Encapsulated interactions None.
3. Specification 4. Responsibilities 17. DM-STP and DM-BST: Consume all events coming on in.
18. DM_PST and DM_PBS: Stub all operations invoked through the in terminal and return the appropriate status (specified by the ret s property).
19. Free the memory allocated for self-owned events if necessary.
6. Theory of operation DM-STP consumes all events and returns a status specified by a property. The memory allocated for self-owned events is freed if any of the following conditions is satisfied:
a) the value of ret s property is CMST OK.
b) the value of the force free property is TRUE.
5.1. Interior Fig. 70 illustrates the internal structure of the inventive DM_BST part.
Fig. 71 illustrates the internal structure of the inventive DM_PST part.

Fig. 72 illustrates the internal structure of the inventive DM-PBS part.
DM STP is a coded part.
DM BST, DM PST and DM PBS are static assemblies.
DM UST, DM DST - Universal and Drain Stoppers Fig. 73 illustrates the boundary of the inventive DM-UST part.
Fig. 74 illustrates the boundary of the inventive DM DST part.
DM-UST and DM-DST are connectivity parts. They are used to consume all events/operations that come to their in and bi terminals and return a status code specified in a property. They can be used in either uni-directional or bi-directional connections. The terminals are activetime and unguarded providing maximum flexibility in their use.
DM-UST can be used to consume either events or operations, which is controlled through a property. For convenience, DM-DST is provided and can be used for event consumption instead of parameterizing DM-UST.
One of the important aspects of the functionality related to events is the processing of self-owned events (CMEVT A-SELF OWNED). These events need special handling as the ownership of the memory allocated for them travels with them.
DM-UST/DM_DST frees the self-owned events if the return status (specified by a property) is CMST OK. For compatibility with older parts they expose a property, which can force free the event memory regardless of the return status.
6. Boundary 6.1. Terminals (DM UST) Terminal "in" with direction "In" and contract I POLY. Note: v-table, activetime, infinite cardinality, synchronous All operations/events are received here and consumed by the part. Depending on the value of the in is drain property, this terminal is expected to be used for either events (I-DRAIN) or operation calls. The status returned is the one specified by the ret s property. Unguarded. Can be connected when the part is active.

Terminal "bi" with direction "Plug" and contract I POLY. Note: v-table, activetime, cardinality 1, synchronous Same as the in terminal described above except used for bi-directional connections. The output side of bi is not used.
6.2. Terminals (DM DST) Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, activetime, infinite cardinality, synchronous All events are received here and consumed by the part. The status returned is the one specified by the ret s property.
Unguarded. Can be connected when the part is active.
Terminal "bi" with direction "Plug" and contract I-DRAIN. Note: v-table, activetime, l0 cardinality 1, synchronous Same as the in terminal described above except used for bi-directional connections. The output side of bi is not used.
6.3. Events and notifications DM-UST (parameterized as an event stopper) and DM-DST accept any incoming events and notifications on in or bi. They do not send out any events or notifications (the output side of bi is not used).
6.4. Special events, frames, commands or verbs None.
6.5. Properties (DM UST) Property "in is drain" of type "UINT32". Note: If TRUE, treat the in and bi terminals as I_DRAIN; otherwise as I-POLY. This property defines whether DM_UST is used to consume I_DRAIN events or interface operation calls. Default: FALSE.
Property "ret-s" of type "UINT32". Note: Status to return on the operation invoked through the in or bi terminals. Default: CMST OK.
Property "force free" of type "UINT32". Note: Set to TRUE to free self-owned events without regard of what ret s value is. Valid only if in is drain property is TRUE.
Default: FALSE.
6.6. Properties (DM DST) Property "ret s" of type "UINT32". Note: Status to return on the raise operation.
Default: CMST OK.

Property "force free" of type "UINT32". Note: Set to TRUE to free self-owned events without regard of what ret s value is. Default: FALSE.
7. Encapsulated interactions None.
8. Specification 9. Responsibilities 20. DM-UST: Consume either all operations or events received through the in and bi terminals and return the appropriate status (specified by the ret s property).
l0 21. DM-DST: Consume all events received through the in and bi terminals and return the appropriate status (specified by the ret s property).
22. DM-UST and DM-DST: Free the memory allocated for self-owned events if necessary.
10. Theory of operation DM-UST consumes all events/operations and returns a status specified by the ret s property.
If using DM_UST or DM-DST to consume events, the memory allocated for self-owned events is freed if any of the following conditions are satisfied:
a) the value of ret s property is CMST OK.
b) the value of the force free property is TRUE.
10.1. Interior Fig. 75 illustrates the internal structure of the inventive DM_DST part.
DM UST is a coded part.
DM DST is a static assembly.
10.2. Hard parameterization of subordinates (DM DST) Part Property Value UST in is drain TRUE

10.3.
10.4. Distribution of Properties to the Subordinates (DM DST) Property Type Dist To Name ret s UINT32 redir UST.ret s force free ~ ~ UINT32 redir ~ ~TUST.force free Event consolidators DM ECSB and DM ECS - Event Consolidators Fig. 76 illustrates the boundary of the inventive DM-ECS part.
Fig. 77 illustrates the boundary of the inventive DM-ECSB part.
DM-ECSB recognizes a pair of events - the "open" event and the "close" event.
l0 DM ECSB forwards .the first "open" event received on in to out and either counts and consumes or rejects subsequent "open" events depending on how it is parameterized.
DM_ECSB consumes all "close" events except for the last one, which it forwards to its out terminal. If DM ECSB receives a "close" event and it has not received an "open" event, it returns a status with which it has been parameterized.
DM-ECSB forwards all unrecognized events received on its in terminal to its out terminal and visa versa.
DM-ECSB is able to handle events that are completed asynchronously. .
DM ECS is the uni-directional version of DM ECSB. It assumes that all events are handled synchronously.
1. Boundary 1.1. Terminals (DM ECSB) Terminal "in" with.direction "Bidir (plug)" and contract I-DRAIN (v-table).
Note: Input for unconsolidated "open" and "close" events and output for completion events..
Terminal "out" with direction "Bidir (plug)" and contract I-DRAIN (v-table).
Note:
Output for consolidated "open" and "close" events and input for completion events.

1.2. Terminals (DM ECS) Terminal "in" with direction "In" and contract I-DRAIN (v-table). Note: Input for unconsolidated "open" and "close" events.
Terminal "out" with direction "Out" and contract I-DRAIN (v-table). Note:
Output for consolidated "open" and "close" events.
1.3. Events and notifications DM-ECSB recognizes two specific events: ev open and ev close. The event IDs for these two events are specified as properties and are described in the table below.
Incoming Event Bus Notes ev open CMEVENT- Synchronous or HDR or Asynchronous "open"
extended event received on in terminal or an asynchronous completion event received on the out terminal (DM ECSB).
The event ID is specified as a property on DM ECSB.
ev-closeT~T_..___.. --CMEVENT- Synchronous or~~
HDR or Asynchronous "close"
extended event received on in terminal or an asynchronous completion event received on the out terminal (DM ECSB).
The event ID is specified as a property on DM ECSB.

all others CMEVENT All events received on in HDR or are forwarded to out.
extended DM-ECSB: unrecognized events received on out are forwarded to in if DM-ECSB is not expecting to receive a completion event; otherwise the event is refused.
1.4. Special events, frames, commands or verbs None.
1.5. Properties Property "ev open" of type "UINT32". Note: ID of the "open" event. The default is EV REQ ENABLE
Property "ev close" of type "UINT32". Note: ID of the "close" event. the default is EV REQ DISABLE
Property "cplt s offset" of type "UINT32". Note: Offset in event bus for completion l0 status. If the value is 0 - do not use. The default is 0x00 for DM ECS and OxOC for DM ECSB.
Property "underflow s" of type "UINT32". Note: Status to return when a "close"
event is received and there is has been no "open" event received. The default is CMST NO ACTION.
Property "reject" of type "UINT32". Note: (boolean)When TRUE, DM ECS and DM-ECSB will reject nested "open" events. The default is FALSE.
Property "reject-s" of type "UINT32". Note: Status to return when rejecting nested "open" events. The default is CMST REFUSE.
Property "busy s" of type "UINT32". Note: Status to return if an "open" or "close"
event is received on in and there is already a pending "open" or "close"
request. The default is CMST BUSY.

Property "force free" of type "UINT32". Note: (boolean)Set to TRUE to free self-owned events without regard to what the return status is. The default is FALSE.
2. Encapsulated interactions None.
3. Specification 4. Responsibilities 1. Maintain counter that is incremented when an "open" event is received and decremented when a "close" event is received.
2. Forward first "open" event and last "close" event received on in to out;
consume or reject all others based on parameterization.
3. Forward all non-recognized events received on in to out without modification.
4. Refuse subsequent "open"/"close" events when there is a synchronous/asynchronous event request pending.
5. (DM-ECSB) Forward all non-recognized events received on out to in without modification.
5. Theory of operation 5.1. State machine DM_ECSB implements a small state machine that it uses to handle pending events. Regardless of whether the events complete synchronously or asynchronously, it is possible to get into the following situation: while the first enable is pending, a second one comes. Since DM_ECSB doesn't know whether the first one will succeed, it doesn't know whether to pass it or not. Another situation is where the "close" event comes while the "open" event is still pending.
Note that if the events complete synchronously and the second request comes in another thread, it will be blocked until the first event completes and then it will be processed as usual. The problem exists only if the events may complete asynchronously or the second event may come in the same thread in which the first one is pending (feedback).

To simplify the above situations, DM-ECSB rejects subsequent "open"/"close"
events, when it has an event pending, with CMST BUSY.
The state machine has the following states:
S-IDLE DM_ECSB is waiting for an "open" or "close" event.
S SYNC_PENDING DM-ECSB is currently processing a synchronous "open" or "close" event.
S ASYNC-PENDING OPE DM-ECSB is currently N processing an asynchronous "open" event and is waiting for the completion event.
S ASYNC-PENDING CLO DM-ECSB is currently SE processing an asynchronous "close"
event and is waiting for the completion event.
5.2. Mechanisms Handling pending synchronous events When DM-ECSB receives a synchronous "open" or "close" event, and it is in the SIDLE state and it does not consume/reject the event, it transitions its state to S SYNC-PENDING and forwards the request to its output. When the operation has to completed, DM ECSB increments/decrements its counter, moves its state back to S IDLE and returns the status from the call.
If DM-ECSB receives a synchronous "open" or "close" event and it is in any of its S XXX_PENDING states, it consumes the request and returns the value of its busy s property.

Handling pending asynchronous events When DM-ECSB receives a asynchronous "open" or "close" event, and it is in the S-IDLE state and it does not consume/reject the event, it transitions its state to S ASYNC-PENDING-XXX depending on the, event and forwards the request to its output. If the call fails with status other than CMST PENDING, DM ECSB moves back to the S-IDLE state. If the operation returned success and DM-ECSB's cplt offset-s property is not 0, it checks the completion status in the event bus. If it is not CMST OK or CMST PENDING, it moves back to the S IDLE state and returns the status from the call; otherwise it remains in the S ASYNC PENDING XXX
state.
When DM-ECSB receives the completion event on its out terminal for the pending event, it increments/decrements its counter appropriately, moves back to the S
IDLE
state, and forwards the call to its in terminal.
If DM-ECSB receives an asynchronous "open" or "close" event and it is in any of its S XXX-PENDING states, it fails the request and returns the value of its busy s property.
Indicators DM lND - Indicator Fig. 78 illustrates the boundary of the inventive DM IND part.
DM-IND is used to trace the program flow through part connections. DM-IND
can be inserted between any two parts that have a unidirectional connection.
When an operation is invoked on its in terminal, DM_IND dumps the operation bus fields to the debug console by descriptor. The operation is then forwarded to the out terminal. DM-IND does not modify the operation bus.
In order to interpret the operation bus, DM-IND must be parameterized with a pointer to an interface bus descriptor (bus descp property). This descriptor specifies the format strings and operation bus fields to be dumped. The format string syntax is the same as the one used in printf. The order of the fields in the descriptor needs to correspond to the order of the format specifiers in the format string. The descriptor may have any number of format strings and fields. The only limitation is that the total size of the formatted output cannot exceed 512 bytes. Please see the reference of your C or C + + run-time library for a description of the format string specifiers.
DM-IND's dump output can be disabled by setting the enabled property to FALSE.
When disabled, all operation calls are directly passed through out, allowing control over multiple indicators in a system. By default, DM_IND will always dump the operation bus according to its descriptor.
Each DM_IND instance may be uniquely identified. Before dumping the operation bus to the debug console, DM_IND will optionally identify itself by outputting the name property (if not ""). This property can be set to any string; it is not interpreted by DM IND.
1. Boundary 1.1. Terminals Terminal "in" with direction "In" and contract I_POLY. Note: v-table, cardinality 1, floating, synchronous. All operations invoked through this terminal are passed through the out terminal. DM-IND does not modify the operation bus passed with the call.
Terminal "out" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1, floating, synchronous. All operations invoked on the in terminal are passed through this terminal. If this terminal is not connected, DM IND will fail the call with CMST-NOT CONNECTED after displaying the data. DM-IND does not modify the operation bus passed with the call.
1.2. Events and notifications None.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "name" of type "ASCIIZ". Note: This is the instance name of DM IND.
It is displayed first in the debug output. Default is "".
Property "enabled" of type "UINT32". Note: If TRUE, DM-IND will dump the operation bus to the debug console according to its descriptor (bus descp). If FALSE, DM-IND will not output anything to the debug console. It will just pass the operation call through out terminal. Default is TRUE.
Property "bus descp" of type "UINT32". Note: This is the pointer to the operation bus descriptor used by DM-IND. It describes the output format and the operation bus fields. This property must be set and contain a valid descriptor pointer.
This property is mandatory.
2. Encapsulated interactions None.
3. Specification 4. Responsibilities 1. Dump the values of the operation bus fields to the debug console according to the bus descriptor.
2. Pass all operation calls on the in terminal out through the out terminal.
5. Theory of operation 5.1. State machine None.
5.2. Main data structures DM-IND uses an operation bus descriptor (supplied from outside by the property bus descp). This descriptor specifies the format strings and operation bus fields.
The descriptor is an array of the following structure:
// entry types enum CMINT ET

CMIND-ET- NONE = 0, // no entry type specified CMIND-ET- FORMAT - 1, // format string CMIND ET VALUE = 2, // value field CMIND ET REF 3, // reference field =

CMIND ET END 4, // end of table =

};

// operation bus table entry typedef struct CMIND BUS ENTRY
dword et ; // entry type [CMIND ET XXX]
dword et ctx ; // entry type specific context dword sz ; // size of storage l0 } CMIND-BUS_ENTRY;
The entry type specifies the type of the field. There are three entry types:
1 . format string - The format string describes the way the output will look on the debug console. This entry contains a formatting string, identical to the one used by printf (i.e., "Int = %d, Char = %c\n").
2. value field - The value field represents an operation bus field that contains a value. An example would be a character, an integer or a pointer to a string.
3. reference field - The reference field represents an operation bus field that should be passed by reference (address of). Use this type to print the value of a string that is contained in the bus. Excluding strings, DM-IND can dump only the value of a pointer, not the data referenced by the pointer.
The entry type context is either an offset to the storage of an operation bus field or a string reference. If the entry type is a format string, the context is a pointer to a string describing the output format. If the entry type is a value or reference field, the context is the offset of the field within the operation bus.
The size is only used by the value field entry type. This represents the size of the storage of the field within the operation bus.

DM-IND defines several macros that aid in defining the operation bus descriptor.
The macros are defined below:
Macro Description BUS_DUMP-DESC(n Begin declaration of operation bus ame) descriptor END-BUS-DUMP-D End declaration of operation bus ESC descriptor ind formatlstr) Define a format string entry ind by val(bus,field) Define a value field ind by reflbus,field) Define a reference field DM-IND defines several macros that aid in parameterizing the indicator. The macros are defined below:
Note: These macros must follow immediately the DM-IND part entry in the SUBORDINATES table.
// macros used for hard parameterization of the indicator l0 Macro Description ind dump(name Hard parameterizes the "bus descp"
property to be the address of the declared bus descriptor ind disable Hard parameterizes the "enabled"
property to FALSE
ind-name(name) Hard parameterizes the "name" property to name Here is an example of defining an operation bus descriptor:
BUS DUMP DESC (B EXAMPLE BUS) ind format Integer = %d, Character = %c, String (" = %s") ind format Pointer= %1x, Buffer "%s"\n") ("

ind_ by val -EXAMPLE-BUS, integer ) (B

ind by val EXAMPLE BUS, character ) (B

ind by val _EXAMPLE-BUS, string ) (B

ind- by val -EXAMPLE_BUS, pointer ) (B

ind by ref EXAMPLE BUS, buffer ) (B

END BUS DUMP DESC
Here is the definition of B EXAMPLE BUS:
BUS (B EXAMPLE BUS) uint integer;

char character;

char string;

void ~*pointer;

char buffer[120];

END BUS

Here is an example of hard parameterizing DM-IND in the subordinates table:
SUBORDINATES (PART NAME) part (ind1, DM IND) ind-name ("My example indicator name") ind dump (B EXAMPLE BUS) ind disable // other parts . . .
END SUBORDINATES

5.3. Mechanisms Dumping an operation's bus contents DM IND will assemble all output into one buffer and then dump the entire buffer to the debug console.
To dump the operation bus, DM-IND executes two passes through the operation bus descriptor. During the first pass, DM IND will collect all format strings and concatenate them. During the second pass, DM_IND will collect all the field values and will assemble them in a separate buffer. DM IND will then use wvsprintf to format the final output string and output it to the debug console.
The size of the formatted output cannot exceed 512 bytes. If it does there will be a memory overwrite by wvsprintf. DM_IND will attempt to detect overwrites but it cannot prevent them. If an overwrite is detected DM_IND will print a warning to the debug console.
5.4. Use Cases Tiacingldebugging the program flow through connections 1 . Insert DM IND between a part A and part B. Part A's output terminal is connected to DM IND's in terminal and Part B's input terminal is connected to DM IND's out terminal.
2. Fill out a bus descriptor to get the desired output formatting for the bus.
3. Parameterize DM IND with a pointer to the bus descriptor and an instance name (instance name is optional).
4. Activate DM IND.
5. As Part A invokes operations through its output terminal connected to DM-IND, the operation calls come to DM IND's in terminal. DM IND displays its instance name (if name is not "") and dumps the formatted operation bus contents to the debug console.
6. The operation call is passed out through DM-IND's out terminal and the operation on part B's input terminal is invoked. The return status from the operation call is returned to the caller.

Note As both terminals of DM-IND are of type I-POLY, care should be taken to use only compatible terminals; DM-IND may not always check that the contract ID is the same.
DM CTR - Call Tracer Fig. 79 illustrates the boundary of the inventive DM CTR part.
DM CTR is used to trace the program execution through part connections.
DM CTR can be inserted between any two parts that have a unidirectional connection.
When an operation is invoked on its in terminal, DM CTR dumps the call information to either the debug console or by sending an EV-MESSAGE event through the con terminal (if connected). The operation is then forwarded to the out terminal. When the call returns, DM CTR outputs the call information and the return status of the operation. DM CTR does not modify the operation bus.
DM CTR's output can be disabled through a property. When disabled, all operations are directly passed through out, allowing for selective tracing through a system.
Each DM-CTR instance is uniquely identified. Before dumping the operation bus, DM CTR will identify itself. This identification includes the DM-CTR unique instance id, recurse count of the operation and other useful information. This identification may also include the value of the name property.
Note As both terminals of DM CTR are of type I-POLY, care should be taken to use only compatible terminals; DM-CTR may not always check that the contract ID is the same.
6. Boundary 6.1. Terminals Terminal "in" with direction "In" and contract I POLY. Note: v-table, infinite cardinality, floating, synchronous. All operations invoked through this terminal are passed through the out terminal. DM CTR does not modify the bus passed with the operation.

Terminal "out" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1, floating, synchronous. All operations invoked on the in terminal are passed through this terminal. If this terminal is not connected, DM CTR will return with CMST_NOT-CONNECTED after displaying the call information. DM-CTR does not modify the bus passed with the operation.
Terminal "con" with direction "Out" and contract I-DRAIN. Note: v-table, cardinality 1, floating, synchronous. If connected, DM CTR sends an EV MESSAGE event containing the call information through this terminal. In this case no debug output is printed.
6.2. Events and notifications Outgoing Bus Notes Event EV MESSA B EV M DM CTR sends an EV MESSAGE
GE SG event containing the call information through the con terminal (if connected).
This allows the output to be sent to mediums other than the debug console.
6.3. Special events, frames, commands or verbs None.
6.4. Properties Property "name" of type "ASCIIZ". Note: This is the instance name of DM CTR.
It is the first field in the call information. If the name is "", the instance name printed is "DM CTR". Default is "".
Property "enabled" of type "UINT32". Note: If TRUE, DM CTR will dump the call information to either the debug console or as an EV_MESSAGE event sent through the con terminal. If FALSE, DM CTR will not output anything. It will just pass the operation call through the out terminal. Default is TRUE.
Property "opt-op16" of type "ASCIIZ". Note: These properties are the names of the first 16 operations. DM CTR uses these names to identify the operation call in the call information output. If the operation name is empty, the operation ID is used.
Default is "".
7. Encapsulated interactions None.
8. Specification 9. Responsibilities 1. Dump the call information to either the debug console or send an EV_MESSAGE
event containing the output.
2. Pass all operation calls on the in terminal out through the out terminal.
10. Theory of operation 10.1. State machine None.
10.2. Main data structures None.
10.3. Mechanisms Dumping the call information DM-CTR will assemble all output into one buffer and then dump the entire buffer either to the debug console or by sending an EV-MESSAGE event through the con terminal.
DM-CTR determines where to send the output by checking if the con terminal is connected on activation. If con is connected, DM CTR will send EV MESSAGE
events that contain the output. This enables the output to be sent to a different medium other than the debug console (i.e. serial port). If con is not connected, the output will always go to the debug console.
The format of the call information before DM CTR passes the incoming call through out is:

< instance name > [# < instance id > ] ( < re-enterance call # > ) < operation name/id > ( < operation call # > ) called\n The format of the call information after DM CTR passes the incoming call through out is:
< instance name > [# < instance id > ] ( < re-enterance call # > ) < operation name/id > ( < operation call # > ) returned < status text > [ < status code > ]\n Example:
l0 MyCTRDump [#3451879] (1 ) 'MyOpName' (3) called\n MyCTRDump [#3451879] (2) 'MyOpName' (4) called\n MyCTRDump [#34518791 (2) 'MyOpName' (4) returned CMST OK [0]\n MyCTRDump [#3451879] (1 ) 'MyOpName' (3) returned CMST OK [0]\n In the example above, 'MyOpName' was called a total of 4 times.
Field Description instance nameUnique name of DM CTR supplied by user (name property).

instance id Unique instance id of DM CTR

(assembled by DM CTR).

re-enterance Value that uniquely identifies the call # operation call in case of recursive calls to operations through the same interface. This makes it easy to trace recursive operation calls.

operation Value that indicates the number call # of times operations have been called through this interface. DM CTR only keeps track of the first 16 operations.

Field Description operation name Name of operation invoked.
If the operation does not have a name, DM CTR will output the following "operation #XX" where XX is the operation number.
status text Return status (text form) of operation invoked through DM CTR's out terminal.
status code Return status code of operation invoked through DM CTR's out terminal.
10.4. Use Cases Tracing/debugging the program flow through connections (output sent to the debug conso%~
1. Insert DM_CTR between part A and part B. Part A's output terminal is connected to DM-CTR's in terminal and Part B's input terminal is connected to DM CTR's out terminal.
2. Parameterize DM-CTR with an instance name and operation names (instance and operation names are optional).
3. Activate DM CTR.
4. As Part A invokes operations through its output terminal connected to DM
CTR, the operation calls come to DM CTR's in terminal. DM CTR displays the call information to the debug console.
5. The operation call is passed out through DM CTR's out terminal and the operation on part B's input terminal is invoked. The return status from the operation call is returned to the caller.

Tracingldebugging the program flow through connections (output sent to other mediums) 1. Insert DM-CTR between part A and part B. Part A's output terminal is connected to DM CTR's in terminal and Part B's input terminal is connected to DM CTR's out terminal.
2. Connect DM CTR's con terminal to Part C's in terminal.
3. Parameterize DM CTR with an instance name and operation names (instance and operation names are optionall.
4. Activate DM CTR.
5. As Part A invokes operations through its output terminal connected to DM
CTR, the operation calls come to DM CTR's in terminal. DM CTR sends an EV-MESSAGE event containing the call information through the con terminal.
6. Part C receives the EV MESSAGE event and sends the call information out a serial port to another computer.
7. The operation call is passed out through DM CTR's out terminal and the operation on part B's input terminal is invoked. The return status from the operation call is returned to the caller.
DM BSD - Bus Dumper Fig. 80 illustrates the boundary of the inventive DM-BSD part.
DM_BSD is used to trace the program execution through part connections.
DM-BSD can be inserted between any two parts that have a unidirectional connection.
When an operation is invoked on its in terminal, DM-BSD dumps the operation bus fields. The dump goes to either the debug console or by sending an EV-MESSAGE event through the con terminal (if connectedl. The operation is then forwarded to the out terminal. When the call returns, DM-BSD dumps the bus again.
The dumping of the bus before and after the operation call can be selectively disabled through properties. DM-BSD does not modify the operation bus.
In order to interpret the operation bus, DM-BSD must be parameterized with a pointer to an interface bus descriptor (bus descp property). This descriptor specifies the format strings and operation bus fields to be dumped. The format string syntax is the same as the one used in printf.
The order of the fields in the descriptor needs to correspond to the order of the format specifiers in the format string. The descriptor may have any number of format strings and fields. The only limitation is that the total size of the formatted output cannot exceed 512 bytes. Please see the reference of your C or C + +
run-time library for a description of the format string specifiers.
DM-BSD's output can be disabled through properties. When disabled, all operations are directly passed through out, allowing for selective tracing through a system. By default, DM_BSD will always dump the operation bus according to its descriptor.
Each DM-BSD instance is uniquely identified. Before dumping the operation bus, DM_BSD will identify itself. This identification includes the DM-BSD unique instance id, recurse count of the operation invoked and other useful information. This identification may also include the value of the name property.
Note As both terminals of DM_BSD are of type I-POLY, care should be taken to use only compatible terminals; DM-BSD may not always check that the contract ID is the same.
11. Boundary 11.1. Terminals Terminal "in" with direction "In" and contract I POLY. Note: v-table, infinite cardinality, floating, synchronous. All operations invoked through this terminal are passed through the out terminal. DM-BSD does not modify the bus passed with the operation.
Terminal "out" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1, floating, synchronous. All operations invoked on the in terminal are passed through this terminal. If this terminal is not connected, DM BSD will return with CMST_NOT-CONNECTED after dumping the bus information. DM-BSD does not modify the bus passed with the operation.

Terminal "con" with direction "Out" and contract I_DRAIN. Note: v-table, cardinality 1, floating, synchronous. If connected, DM_BSD sends an EV MESSAGE event containing the bus dump through this terminal. In this case no debug output is printed.
11.2. Events and notifications Outgoing Bus Notes Event EV MESSA B EV M DM BSD sends an EV MESSAGE
GE SG event containing the bus dump through the con terminal (if connected).
This allows the dump to be sent to mediums other than the debug console.
11.3. Special events, frames, commands or verbs None.
11.4. Properties Property "name" of type "ASCIIZ". Note: This is the instance name of DM BSD.
It is the first field printed before the bus dump. If the name is "", the instance name printed is "DM BSD". Default is "".
Property "enabled" of type "UINT32". Note: If TRUE, DM BSD will dump the call information to either the debug console or as an EV-MESSAGE event sent through the con terminal. If FALSE, DM-BSD will not output anything. It will just pass the operation call through the out terminal. Default is TRUE.
Property "bus descp" of type "UINT32". Note: This is the pointer to the operation bus descriptor used by DM-BSD. It describes the output format and the operation bus fields. This property must be set and contain a valid descriptor pointer.
This property is mandatory.

Property "dump-before" of type "UINT32". Note: If TRUE, DM_BSD will dump the operation bus before passing the call through the out terminal. Default is FALSE.
Property "dump-after" of type "UINT32". Note: If TRUE, DM_BSD will dump the operation bus after passing the call through the out terminal. Default is FALSE.
12. Encapsulated interactions None.
13. Specification 14. Responsibilities 3. Dump the values of the operation bus fields to an output medium according to the bus descriptor.
4. Pass all operation calls on the in terminal out through the out terminal.
15. Theory of operation 15.1. State machine None.
15.2. Main data structures DM-BSD uses an operation bus descriptor (supplied from outside by the property bus descp). This descriptor specifies the format strings and operation bus fields.
The descriptor is an array, of the following structure:
// entry types enum DM BSD ET

DM-BSD-ET- NONE _ _0, // no entry type specified DM-BSD-ET- FORMAT - 1, // format string DM BSD ET VALUE = 2, // value field DM BSD ET REF 3, // reference field =

DM BSD ET END = 4, // end of table ~;

// operation bus table entry typedef struct DM BSD BUS ENTRY
dword et ; // entry type [DM BSD ET XXX]
dword et ctx ; // entry type specific context dword sz ; // size of storage l0 } DM_BSD-BUS-ENTRY;
The entry type specifies the type of the field. There are three entry types:
4. format string - The format string describes the way the output will look. This entry contains a formatting string, identical to the one used by printf (i.e., "Int = %d, Char = %c\n").
5. value field - The value field represents an operation bus field that contains a value. An example would be a character, an integer or a pointer to a string.
6. reference field - The reference field represents an operation bus field that should be passed by reference (address of). Use this type to print the value of a string that is contained in the bus. Excluding strings, DM_BSD can dump only the value of a pointer, not the data referenced by the pointer.
The entry type context is either an offset to the storage of an operation bus field or a string reference. If the entry type is a format string, the context is a pointer to a string describing the output format. If the entry type is a value or reference field, the context is the offset of the field within the operation bus.
The size is only used by the value field entry type. This represents the size of the storage of the field within the operation bus.

DM_BSD defines several macros that aid in defining the operation bus descriptor.
The macros are defined below:
Macro Description DM_BSD-BUS-DUMP-DE Begin declaration of operation SC(name) bus descriptor DM-BSD-END-BUS-DUM End declaration of operation P-DESC bus descriptor dm bsd format(str) Define a format string entry dm bsd by val(bus,field) Define a value field dm bsd by ref(bus,field) Define a reference field DM-BSD defines several macros that aid in parameterizing the indicator. The macros are defined below:
Note: These macros must follow immediately the DM BSD part entry in the SUBORDINATES table.
Macro Description dm bsd dump(naHard parameterizes the "bus descp"

me) property to be the address of the declared bus descriptor dm bsd disableHard parameterizes the "enabled"

property to FALSE

dm bsd name(naHard parameterizes the "name"

me) property to name dm bsd dump_beHard parameterizes the "dump before"

fore property to TRUE

dm bsd dump Hard parameterizes the "dump of after"

ter property to TRUE

Here is an example of defining an operation bus descriptor:
DM BSD BUS DUMP DESC (B EXAMPLE BUS) dm- bsdformat Integer (" = %d, Character = %c, String = %s") dm bsdformat Pointer=
(" %1x, Buffer "%s"\n") dm- bsd_by val _EXAMPLE_BUS, integer ) (B

dm bsdby val EXAMPLE BUS, character ) (B

dm- bsdby val _EXAMPLE-BUS, string ) (B

dm- bsdby val -EXAMPLE-BUS, pointer ) (B

dm bsdby ref EXAMPLE BUS, buffer ) (B

DM BSD END BUS DUMP DESC
Here is the definition of B EXAMPLE BUS:
BUS (B EXAMPLE BUS) uint integer;
char character;
char string;
void *pointer;
char bufferf120];
END BUS
Here is an example of hard parameterizing DM_BSD in the subordinates table:
SUBORDINATES (PART NAME) part (ind 1, DM BSD) dm bsd name ("My example bus dumper name") dm bsd dump (B-EXAMPLE-BUS) dm bsd dump before dm-bsd dump after dm bsd disable // other parts . . .
END SUBORDINATES
15.3. Mechanisms Dumping an operation's bus contents DM-BSD will assemble the output into a buffer and then dump the entire buffer either to the debug console or by sending an EV-MESSAGE event through the con l0 terminal.
DM-BSD determines where to send the output by checking if the con terminal is connected on activation. If con is connected, DM BSD will send EV MESSAGE
events that contain the output. This enables the output to be sent to a different medium other than the debug console /i.e. serial port). If con is not connected, the output will always go to the debug console.
To dump the operation bus, DM-BSD executes two passes through the operation bus descriptor. During the first pass, DM_BSD will collect all format strings and concatenate them. During the second pass, DM-BSD will collect all the field values and will assemble them in a separate buffer. DM BSD will then use wvsprintf to format the final output string.
The size of the formatted output cannot exceed 512 bytes. If it does there will be a memory overwrite by wvsprintf. DM BSD will attempt to detect overwrites but it cannot prevent them. If an overwrite is detected DM-BSD will print a warning to the debug console.
The format of the output is:
< instance name > [# < instance id > ] (call # < re-enterance call # > ) < pre/post > \n < dump of operation bus > \n .\n Here is an example:

MyBSDDump [#31378912] (call #5) pre\n My Operation bus dump:\n bus.integer = 10\n bus.char - 'A'\n .\n Field Description instance name Unique name of DM-BSD supplied by user (name property).
instance id Unique instance id of DM BSD
(assembled by DM BSD).
re-enterance Value that uniquely identifies the call # operation call in case of recursive calls to other operations. This makes it easy to trace recursive operation calls.
pre\post This indicates whether the dump of the bus is before or after the operation call passed through out.
dump of This is the contents of the operation bus operation bus as defined by the bus descriptor (bus descp property).
15.4. Use Cases Tracingldebugging fhe program flow through connections (output sent to the debug consoieJ
7. Insert DM BSD between part A and part B. Part A's output terminal is connected to DM BSD's in terminal and Part B's input terminal is connected to DM-BSD's out terminal.
8. Parameterize DM BSD with an instance name and bus descriptor (instance name IS is optional).

9. Activate DM BSD.
10.As Part A invokes operations through its output terminal connected to DM
BSD, the operation calls come to DM-BSD's in terminal. DM-BSD dumps the formatted operation bus contents to the debug console.
1 1.The operation call is passed out through DM_BSD's out terminal and the operation on part B's input terminal is invoked. The return status from the operation call is returned to the caller.
Tracingldebugging the program flow through connections (output sent to other mediums) 1 . Insert DM-BSD between part A and part B. Part A's output terminal is connected to DM BSD's in terminal and Part B's input terminal is connected to DM BSD's out terminal.
2. Connect DM BSD's con terminal to Part C's in terminal.
3. Parameterize DM BSD with an instance name and operation names (instance and operation names are optional).
4. Activate DM BSD.
5. As Part A invokes operations through its output terminal connected to DM
BSD, the operation calls come to DM BSD's in terminal. DM BSD sends an EV-MESSAGE event through the con terminal containing the formatted operation bus contents.
6. Part C receives the EV_MESSAGE event and sends the bus dump out a serial port to another computer.
7. The operation call is passed out through DM-BSD's out terminal and the operation on part B's input terminal is invoked. The return status from the operation call is returned to the caller.
Synchronization Parts Details Desynchronizers DM FDSY - Fundamental Desynchronizer Fig. 81 illustrates the boundary of the inventive DM-FDSY part.

DM-FDSY de-couples the flow of control from the operation flow, a mechanism known as desynchronization. DM_FDSY desynchronizes all operations received on its in terminal. The operation buses are not interpreted by DM FDSY. DM FDSY
enqueues the operation and its bus; the queue keeps the operations in the same order as they are received. As EV IDLE/EV PULSE events are received on its ctl input, DM-FDSY dequeues all the pending operations and sends them through the out terminal (one operation is dequeued for each EV IDLE/EV PULSE event received).
The size of the queue used by DM-FDSY is dynamic and may be limited by a property called queue sz.
DM-FDSY issues EV REQ ENABLE and EV REa DISABLE requests through its ctl terminal in order to control the pulse generation. The issuing of these requests can be disabled through the property disable ctl req.
1. Boundary 1.1. Terminals Terminal "in" with direction "In" and contract I POLY. Note: v-table, infinite cardinality, floating, synchronous. DM-FDSY desynchronizes the operations received on this terminal. The bus passed with the operation call is not interpreted by DM_FDSY. This terminal is unguarded. DM-FDSY does not enter its guard at any time.
Terminal "out" with direction "Out" and contract I POLY. Note: v-table, cardinality 1, synchronous. DM-FDSY sends all desynchronized queued operations out through this terminal (when it receives EV IDLE/EV PULSE events from ctl). The bus passed with the operation call is not interpreted by DM-FDSY and is passed directly through the out terminal. The outgoing operations are in the same order as they were received from in.
Terminal "ctl" with direction "Plug" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous. EV IDLE/EV PULSE events are received through this terminal so DM FDSY can dequeue operations and send them through the out terminal (one operation is dequeued for each EV IDLE/EV PULSE event received). DM_FDSY
generates pulse enable/disable requests through this terminal (unless the disable ctl req property is TRUE). This terminal is unguarded. DM FDSY does not enter its guard at any time.
1.2. Events and notifications Incoming Event Bus Notes EV_RESET CMEVENT This event is received on the ctl terminal.
-HDR In response, DM-FDSY flushes its operation queue. No operations are invoked through the out terminal.
EV IDLE CMEVENT This event is received on the ctl terminal.
-HDR In response, DM_FDSY dequeues an operation and invokes it through out.
If there are no elements on the queue, DM FDSY will return CMST-NO ACTION even if disable ctl-req property is set to TRUE.
EV PULSE CMEVENT This event is the same as EV IDLE.
HDR
Outgoing Event Bus Notes EV-REQ_ENABL CMEVENT DM_FDSY sends this request through ctl when an operation HDR is invoked on the in terminal and the operation queue was empty.
DM FDSY sends this event only if disable ctl req property is FALSE.
EV REQ DISAB CMEVENT DM FDSY sends this request through ctl if the operation LE HDR queue is empty (after receiving EV-IDLE/EV PULSE and dequeueing the last operation).
DM-FDSY sends this event only if disable ctl req property is FALSE.
1.3. Special events, frames, commands or verbs None.

1.4. Properties Property "queue sz" of type "UINT32". Note: This is the number of events that the operation queue can hold. If 0, the queue will extend itself when it gets full (the number of operations the queue can hold is limited only by available memory).
Default is 0.
Property "disable ctl-req" of type "UINT32". Note: Boolean. If FALSE, DM-FDSY
sends requests through ctl to enable/disable the pulse generation when needed.
If TRUE, requests are never sent through ctl. Default is FALSE.
Property "ok stat" of type "UINT32". Note: This specifies the status that DM-FDSY
returns on calls through in if the operation was successfully enqueued. This status is also used to determine if operations passed through out succeeded. Default is CMST OK.
Property "disable diag" of type "UINT32". Note: Boolean. This determines whether DM-FDSY prints debug output indicating that a call through ctl or out failed.
A call through ctl fails if the return status is not equal to CMST OK. A call through out fails if the return status is not equal to ok stat. This property affects only the checked build of DM FDSY. Default is FALSE.
2. Specification 3. Responsibilities 1. Desynchronize all incoming operations received through the in terminal and return the appropriate status.
2. When an EV IDLE/EV PULSE event is received from the ctl terminal, dequeue and invoke an operation through the out terminal.
3. Do not interpret or modify the operation bus passed with operation calls received on the in terminal.
4. Depending on the value of the disable ctl req property, generate enable/disable requests through ctl when needed.
5. Depending on the value of disable diag, print debug output if operations invoked through out or ctl fail (checked builds only).

4. Theory of operation 4.1. Main data structures DM_FDSY uses a DriverMagic queue to store all desynchronized operations and their buses.
4.2. Mechanisms Desynchronization of incoming operations DM-FDSY desynchronizes all operations invoked through the in terminal.
DM-FDSY enqueues the operation and its bus and returns to the caller. The return status is ok stat (if enqueing of the operation succeeded; otherwise a failure status is returned). DM-FDSY then requests pulse generation (if the disable ctl-req property is FALSE and the queue was empty) by sending an EV-REQ ENABLE event through the ctl terminal.
For each EV IDLE/EV PULSE event received from the ctl terminal, DM FDSY
dequeues one operation and invokes it through out. If the disable ctl_req property is FALSE and the queue is empty, DM-FDSY requests to disable the pulse generation by sending an EV_REQ DISABLE event through ctl.
The operation bus received on the in terminal is not interpreted, modified or valchked by DM_FDSY. The operation bus passed through out is the exact same bus received with the operation invoked through the in terminal.
All enable/disable pulse generation events sent through ctl are allocated on the stack and sent with the CMEVT A SYNC ANY and CMEVT A SELF CONTAINED
attributes.
Event handling on the ctl terminal All self-owned events received on the ctl terminal are freed by DM FDSY only if the processing of that event is successful (CMST OK is returned).
All unrecognized events are not processed by DM-FDSY and a CMST NOT SUPPORTED status is returned.
If an EV IDLE or EV PULSE event is received when the operation queue is empty, DM FDSY returns CMST NO ACTION.

4.3. Use Cases Desynchronizing operations 1 . The counter terminal of in invokes an operation through in and the call is received by DM FDSY.
2. Unless the disable ctl req property is TRUE, an EV REQ ENABLE event is sent through the ctl terminal.
3. The operation is enqueued and the flow of control is returned to the caller. The return status is ok stat.
4. Steps 1 and 3 may be repeated several times.
S. DM FDSY receives an EV IDLE/EV PULSE event from its ctl terminal.
6. DM-FDSY dequeues one operation and invokes it through the out terminal passing the same operation bus as received on the in terminal.
7. If the return status from the operation call is not equal to ok-stat and disable diag is FALSE, DM_FDSY prints debug output indicating that the operation call failed.
8. Steps 5 through 7 are repeated many times.
9. If the disable ctl req property is FALSE an EV-RED. DISABLE event is sent through the ctl terminal to stop the pulse generation (when the operation queue becomes empty).
5. Notes 1. DM-FDSY assumes that buses passed with operations invoked through the in terminal are not allocated on the caller's stack.
2. DM-FDSY does not interpret, modify or valchk the operation buses received on the in terminal. The bus passed through the out terminal is exactly the same as the bus received on the in terminal (it is the original bus pointer).
DM DSY - Desynchronizer Fig. 82 illustrates the boundary of the inventive DM-DSY part.
DM-DSY desynchronizes and forwards events received at its in input. The input event will be desynchronized only if the input event's attributes specify that it may be distributed asynchronously and it is self-contained. If the input event is not self-owned, DM-DSY will output a copy of the event.
6. Boundary 6.1. Terminals Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, infinite cardinality, synchronous This terminal receives all the incoming events for DM
DSY.
Terminal "out" with direction "Out" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous DM_DSY sends all de-synchronized events out through this terminal.
6.2. Events and notifications Incoming Bus Notes Event EV XXX CMEVENT All incoming events on in are de-synchronized and -HDR sent out through out.
/CMEvent 6.3.
Outgoing Bus Notes Event EV_XXX CMEVENT All incoming events on in are de-synchronized and -HDR sent out through out.
/CMEvent 6.4. Special events, frames, commands or verbs None.
6.5. Properties None.
7. Encapsulated interactions None.
8. Specification 9. Responsibilities 2. Desynchronize all incoming events received from in and send them out through out.

10. Theory of operation 10.1. State machine None.
10.2. Main data structures None.
10.3. Mechanisms Desynchronization of incoming events DM-DSY desynchronizes an input event by first examining the event attributes.
If the event can be distributed only synchronously or is not self-contained, DM DSY
will not desynchronize the event and return error status. If the event is not self-owned, DM DSY will allocate a new event control block and copy the input event into it.
Next, DM_DSY uses a built-in CIassMagic mechanism to desynchronize the event and returns to the caller. At a later time, usually when the application or the system is idle, DM_DSY passes the event through its out output.
Note The desynchronized event may be distributed in thread different than the one that posted it. This may impose additional limitations if thread-local storage is used.
10.4. Use Cases Desynchronization of incoming events that are not self owned 1. The counter terminal of in sends an event to DM DSY.
2. DM DSY receives the event.
3. If the event is not desynchronizable, the call fails; DM DSY returns CMST REFUSE.
4. DM DSY allocates a new event control block and copies the input event into it.
Note that the input event may have been allocated on the stack or on the heap;
DM DSY handles these cases correctly.
5. The event is enqueued and the control is returned back to the caller.
6. When DM DSY receives control from the CIassMagic desynchronizer, the event is sent through the out output synchronously.

7. The counter terminal of out processes the event and returns control back to DM DSY.
8. DM-DSY returns control back to the CIassMagic desynchronizer.
DM DSYR - Desynchronizer for Requests Fig. 83 illustrates the boundary of the inventive DM-DSYR part.
DM DSYR de-couples the flow of control from the request flow, a mechanism known as desynchronization. DM-DSYR desynchronizes all requests received on its in terminal. DM DSYR enqueues the request; the queue keeps the requests in the same order as they are received. For each EV IDLE or EV PULSE event received on its ctl input, DM-DSYR dequeues one pending request and sends it through the out terminal. The size of the queue used by DM_DSYR is dynamic and may be limited by a property called queue sz.
DM-DSYR issues EV REQ ENABLE and EV REQ DISABLE requests through its ctl terminal in order to control the pulse generation. The issuing of these requests can be disabled through the property disable ctl req.
DM-DSYR expects that the incoming request can complete asynchronously. If the request does not have the CMEVT A ASYNC CPLT attribute set, DM-DSYR fails the request with CMST REFUSE.
DM DSYR assumes that the requests are not allocated on the caller's stack.
11. Boundary 11.1. Terminals Terminal "in" with direction "Plug" and contract I_DRAIN. Note: v-table, infinite cardinality, floating, synchronous. DM-DSYR desynchronizes the requests received on this terminal. This terminal is unguarded. DM-DSYR does not enter its guard at any time.
Terminal "out" with direction "Plug" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous. DM-DSYR sends all desynchronized queued requests out through this terminal (when it receives EV IDLE/EV PULSE events from ctl). The outgoing requests are in the same order as they were received from in.

Terminal "ctl" with direction "Plug" and contract I_DRAIN. Note: v-table, cardinality 1, synchronous. EV IDLE/EV PULSE events are received through this terminal so DM-DSYR can dequeue requests and send them through the out terminal (one operation is dequeued for each EV IDLE/EV PULSE event received). DM DSYR
generates pulse enable/disable requests through this terminal (unless the disable ctl req property is TRUE). This terminal is unguarded. DM_DSYR does not enter its guard at any time.
11.2. Events and notifications Incoming Event Bus Notes EV RESET CMEVENT This 'event is received on the ctl terminal.
-HDR In response, DM-DSYR flushes its request queue. No requests are sent through the out terminal.
EV IDLE CMEVENT This event is received on the ctl terminal.
-HDR In response, DM-DSYR dequeues a request and sends it through out.
If there are no elements on the queue, DM DSYR will return CMST-NO ACTION even if disable ctl-req property is set to TRUE.
EV PULSE CMEVENT This event is the same as EV IDLE.
HDR
Outgoing Event Bus Notes EV_REQ_ENABL CMEVENT DM_DSYR sends this request through ctl when a request E -HDR is received on the in terminal and the request queue was empty.
DM_DSYR sends this event only if disable ctl req property is FALSE.

Outgoing Event Bus Notes EV_REQ-DISAB CMEVENT DM-DSYR sends this request through ctl if the request LE -HDR queue is empty (after receiving EV IDLE/EV PULSE and dequeueing the last request).
DM-DSYR sends this event only if disable ctl req property is FALSE.
11.3. Special events, frames, commands or verbs None.
11.4. Properties Property "queue sz" of type "UINT32". Note: This is the number of events that the request queue can hold. If 0, the queue will extend itself when it gets full (the number of requests the queue can hold is limited only by available memory).
This property is redirected to the FDSY subordinate. Default is 0.
Property "disable ctl_req" of type "UINT32". Note: Boolean. If FALSE, DM-DSYR
l0 sends requests through ctl to enable/disable the pulse generation when needed. If TRUE, requests are never sent through ctl. This property is redirected to the FDSY
subordinate. Default is FALSE.
Property "disable diag" of type "UINT32". Note: Boolean. This determines whether DM_DSYR prints debug output indicating that a call through ctl or out failed.
A call through ctl fails if the return status is not equal to CMST OK. A call through out fails if the return status is not equal to CMST PENDING. This property affects only the checked build of DM-DSYR. This property is redirected to the FDSY subordinate.
Default is FALSE.
Property "cplt s offs" of type "UINT32". Note: Offset in bytes of the completion status in the request bus. This property is redirected to the ACT subordinate.
Mandatory.
12. Encapsulated interactions None.

13. Specification 14. Responsibilities Desynchronize all incoming requests received through the in terminal and return the appropriate status.
If the CMEVT A ASYNC CPLT attribute is not set on the incoming request fail with CMST REFUSE.
When an EV IDLE/EV PULSE event is received from the ctl terminal, dequeue and invoke a request through the out terminal.
Depending on the value of the disable ctl_req property, generate enable/disable requests through ctl when needed.
Depending on the value of disable diag, print debug output if requests sent through out or ctl fail (checked builds only).
15. Internal Definition Fig. 84 illustrates the internal structure of the inventive DM-DYSR part.
16. Theory of Operation DM DSYR is an assembly built entirely of DriverMagic parts.
DM DSYR is based mainly on DM FDSY. Please see the DM FDSY data sheet for more information.
Requests received on in pass through bsp_in and go to iflt. If the request does not have the CMEVT A ASYNC CPLT attribute set, iflt sends the request out through aux where its consumed by stp. stp returns CMST-REFUSE and the status is propagated back to the original caller.
Requests that can complete asynchronously are forwarded to fdsy where they are enqueued in the request queue. fdsy returns CMST PENDING to indicate that the request will be processed asynchronously.
Requests received on in are continuously enqueued by fdsy until DM DSYR
receives an EV IDLE or EV PULSE event on its ctl terminal. These events are forwarded to fdsy. In response, fdsy dequeues one request and sends it out through the out terminal. The request is then passed to bsp act and forwarded to act.

Requests received by act are forwarded through the out terminal. If the request is completed asynchronously, the completion event is simply forwarded through bsp act, bsp-in and then through DM-DSYR's in terminal. If the request is completed synchronously, act creates a completion event, stores the completion status in the event, and sends it out through bsp act. Thus, all requests send through DM-DSYR are gurenteed to be completed with a completion event sent through the back channel of DM-DSYR's in terminal.
17. Subordinate's Responsibilities 17.1. DM BSP - Bi-directional Splitter ~ Split event flow between a single bi-directional interface and an input/output interface pair.
17.2. DM IFLT - Filter by Integer Value ~ If the operation filter integer value received on the in terminal is between min and max, pass, operation through the aux terminal (auxiliary flow).
~ If the operation filter integer value received on the in terminal is not between min and max, pass operation through the out terminal (main flow).
17.3. DM STP - Operation Stopper 1. Consume all operations received on its terminal.
17.4. DM FDSY - Fundamental Desynchronizer 2. Desynchronize all incoming operations received through the in terminal and return the appropriate status.
17.5. DM ACT - Asynchronous Completer 3. Transform synchronous completion of an outgoing event into asynchronous completion of the incoming event that generated the former.

18. Dominant's Responsibilities 18.1. Hard parameterization of subordinates Subordinate Property Value iflt offset offsetof (CMEVENT HDR, attr) iflt mask CMEVT A ASYNC CPLT

iflt min 0 iflt max 0 stp ret s CMST REFUSE

fdsy ok-stat CMST PENDING

18.2. Distribution of Properties to the Subordinates Property NameType Dist To queue sz UINT32 Redir fdsy.queue sz disable ctl UINT32 Redir fdsy.disable ctl req req disable diag UINT32 Redir fdsy.disable diag cplt s offs UINT32 Redir act.cplt s offs 18.3. Use Cases Desynchronizing requests 1 . A part sends a request to the in terminal of DM DSYR.
2. Unless the disable ctl req property is TRUE, an EV REQ ENABLE
event is sent through the ctl terminal.
3. The request is enqueued and the flow of control is returned to the caller. The return status is ok stat.
4. Steps 1-3 may be repeated several times.
5. DM DSYR receives an EV IDLE or EV PULSE event from its ctl terminal.
6. DM DSYR dequeues one request and sends it out through the out terminal.

7. When the request has completed, the same request with the CMEVT A COMPLETED attribute set is sent out through 'the back channel of the in terminal.
8. Steps 5-7 are repeated many times.
9. If the disable ctl req property is FALSE an EV-REQ DISABLE event is sent through the ctl terminal to stop the pulse generation (when the request queue becomes empty).
Notes 1. DM-DSYR assumes that requests sent through the in terminal are not allocated on the caller's stack and their memory block is valid at least until DM DSYR sends the completion event.
DM DW1 - Desynchronizes with Idle Input Fig. 85 illustrates the boundary of the inventive DM-DWI part.
DM DWI de-couples the flow of control from the event flow, a mechanism known as desynchronization. DM-DWI desynchronizes all events received on its in terminal.
The input event is desynchronized only if the input event's attributes specify that it may be distributed asynchronously and it is self-contained. DM DWI enqueues the event; the queue keeps the events in the same order as they are received. As EV IDLE events are received on its idle input, DM-DWI dequeues all the pending events and sends them through the out terminal (one event is dequeued for each EV IDLE event received). The size of the queue used by DM-DWI is dynamic and may be limited by a property called queue sz.
DM-DWI issues EV REQ ENABLE and EV REa DISABLE requests through its idle terminal in order to control the idle generation. The issuing of these requests can be stopped through the property disable idle req.
19. Boundary 19.1. Terminals Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, infinite cardinality, floating, synchronous. DM-DWI desynchronizes the events received on this terminal.

Terminal "out" with direction "Out" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous. DM-DWI sends all de-synchronized queued events out through this terminal (when it receives EV IDLE from idle). The outgoing events are in the same order as they were received from in.
Terminal "idle" with direction "Bi" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous. EV IDLE events are received through this terminal so DM DWI can dequeue events and send them through the out terminal (one event is dequeued for each EV IDLE event received). DM-DWI generates idle enable/disable requests through this terminal (unless the disable idle req property is TRUE).
19.2. Events and notifications Incoming Event Bus Notes EV XXX CMEVENT All incoming events received from in are desynchronized _HDR and sent out through out.
/CMEvent Outgoing Bus Notes Event EV XXX CMEVENT All incoming events received from in are desynchronized -HDR and sent out through out.
/CMEvent The outgoing events are in the same order as they are received at in.
19.3. Special events, frames, commands or verbs Special Bus Notes Incoming Event EV RESET CMEVENT This event is received on the idle terminal.
HDR/CME In response, DM DWI will flush its event queue. The vent events will be consumed .by DM DWI.

Special Bus Notes Incoming Event EV IDLE CMEVENT This event is received on the idle terminal.
_HDR/CME In response, DM_DWI will dequeue an event and send it vent through out.
If there are no elements on the queue, DM DWI will return CMST_NO ACTION even if disable_idle_req property is set to TRUE.
Special Bus Notes Outgoing Event EV-REQ-ENABL CMEVENT DM-DWI will send this request out through idle when an E HDR/CME event is received on the in terminal and the queue was vent empty.

DM_DWI will send this event only if disable idle req property is FALSE.

EV-REQ-DISAB CMEVENT DM-DWI will send this request out through idle if the LE -HDR/CME event queue is empty (after receiving EV
IDLE and vent dequeueing the last event).

DM-DWI will send this event only if disable-idle req property is FALSE.

19.4. Properties Property "queue sz" of type "UINT32". Note: Default is 0. This is the number of events that the queue can hold. If 0, the queue will extend itself when it gets full (the number of events the queue can hold is limited only by available memory).
Property "disable_idle_req" of type "UINT32".'Note: Default is FALSE. If FALSE, DM DWI will send requests to enable/disable the idle generation when needed.
20. Encapsulated interactions None.

21. Specification 22. Responsibilities 1 . Desynchronize all incoming events received through the in terminal.
2. When an EV IDLE event is received from the idle terminal, dequeue and send an event out through the out terminal.
3. Depending on the value of the disable idle req property, generate , enable/disable requests through idle.
23. Theory of operation 23.1. State machine None.
23.2. Main data structures DM DWI uses a queue to store all desynchronized events.
23.3. Mechanisms Desynchronization of incoming events DM DWI starts by first examining the event attributes. If the event is not distributed asynchronously or is not self-contained, DM_DWI will not desynchronize the event and return CMST REFUSE. If the event is not self-owned, DM DWI will make a copy and mark it as self-owned.
DM DWI will then enqueue the event and return to the caller. DM DWI will then request the idle generation (if the disable idle req property is FALSE and the queue was empty). It does this by sending an EV_REQ ENABLE event out through idle terminal.
For each EV-IDLE event received through its idle terminal, DM-DWI will dequeue one event from the queue and send it out through out. If the disable_idle-req property is FALSE and the queue is empty, DM-DWI will request to disable the idle generation by sending an EV REQ DISABLE event through idle.
23.4. Use Cases Desynchronizing events 10.The counter terminal of in sends an event to DM DWI.

11 .Unless the disable idh req property is TRUE, an EV REO.-ENABLE event will be sent out through the idle terminal.
12.The event is enqueued and the flow of control is returned to the caller.
13. Steps 1 and 3 may be repeated several times.
14.DM DWI receives an EV IDLE event from its idle terminal.
15. DM-DWI dequeues one event and sends it out through the out terminal.
1 6.Steps 5 and 6 are repeated.
17.1f the disable idle req property is FALSE an EV-REQ DISABLE event will be sent out the idle terminal (when the event queue becomes empty).
DM DWl2 - Desynchronizer with Idle Input Fig. 86 illustrates the boundary of the inventive DM_DW12 part.
DM-DW12 de-couples the flow of control from the event flow, a mechanism known as desynchronization. DM-DWI2 desynchronizes all events received on its in terminal. The input event is desynchronized only if the input event's attributes specify that it may be distributed asynchronously and it is self- contained.
DM DW12 enqueues the event; the queue keeps the events in the same order as they are received. As EV-IDLE events are, received on its idle input, DM_DW12 dequeues all the pending events and sends them through the out terminal lone event is dequeued for each EV-IDLE event received). The size of the queue used by DM-DWI2 is dynamic and may be limited by a property called queue-sz.
DM-DWI2 issues EV-REO.-ENABLE and EV-REQ-DISABLE requests through its idle terminal in order to control the idle generation.
The difference between DM DWI2 and DM DWI is that when DM DW12 is disabled (i.e. it hasn't issued an EV REQ ENABLE event out idle) it returns CMST NO ACTION for all events it receives on its idle terminal and does not emit EV REO. DISABLE event out idle terminal.

24. Boundary 24.1. Terminals Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, infinite cardinality, floating, synchronous. DM_DWI2 desynchronizes the events received on this terminal.
Terminal "out" with direction "Out" and contract I DRAIN. Note: v-table, cardinality 1, synchronous. DM-DWI sends all de-synchronized queued events out through this terminal (when it receives EV-IDLE from idle. The outgoing events are in the same order as they were received from in.
Terminal "idle" with direction "Bi" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous. EV-IDLE events are received through this terminal so DM_DWI can dequeue events and send them through the out terminal lone event is dequeued for each EV-IDLE event receivedl. DM-DWI generates idle enable/disable requests through this terminal 24.2. Events and notifications Incoming Event Bus Notes EV XXX CMEVENT All incoming events received from in are desynchronized HDR and sent out through RXW.
Outgoing Event Bus Notes EV XXX CMEVENT All incoming events received from in are desynchronized HDR and sent out through out.
The outgoing events are in the same order as they are received at in.
24.3. Special events, frames, commands or verbs Speciallncoming Bus Notes Event EV RESET CMEVENT This event is received on the idle terminal.
-HDR In response, DM_DW12 will flush its event queue. The events will be consumed by DM DWI2.
EV IDLE CMEVENT This event is received on the idle terminal.
HDR In response, DM DWI2 will dequeue an event and send' it through out.
If there are no elements on the queue, DM DW12 will return CMST NO ACTION
Special Outgoing Bus Notes Event EV-REQ-ENABL CMEVENT DM-DWI2 will send this request out through idle when E HDR an event is received on the in terminal and the queue was empty.
EV-REa_DISABL CMEVENT DM-DWI2 will send this request out through idle if the E _HDR event queue is empty (after receiving EV-IDLE and dequeueing the last event).
24.4. Properties Property "queue-sz" of type "UINT32". Note: Default is 0. This is the number of events that the queue can hold. If 0, the queue will extend itself when it gets full (the number of events the queue can hold is limited only by available memory).
25. Internal Definition Fig. 87 illustrates the internal structure of the inventive DM-DWI2 part.
DM DWI2 is a pure assembly and has no functionality of its own. Refer to the DM DWI Data Sheet for a detailed functional overview of the desynchronizer with idle input.

26. Subordinate's Responsibilities 26.1. DWI - Desynchronizer with Idle Input 1. Implement an event queue that can be pumped with EV IDLE
events.
2. Clear the event queue on receipt of an EV RESET event 26.2. BSP - Bi-directional Splitter 1. Provide plumbing to enable connection of a bi-directional terminal to an unidirectional input or output.
26.3. STP - Event Stopper l0 1. Terminate the event flow by returning a specified status (e.g., CMST OK).
26.4. MUX - Event-Controlled Multiplexer 1 . Implements a switch between its out1 and out2 outputs that is controlled by event input on its ctl terminal.
26.5. RPL - Event Replicator 1. Duplicates events coming on in, send the duplicates to aux, and send the original event to out.
27. Distribution of Properties Property Distr. Subordinate queue sz Redirecte dwi.queue sz d 28. Subordinate Parameterization Part Property Value dwi disable idle req FALSE
rpl aux first TRUE
mux ev out1 EV REQ DISABLE
ev out2 EV REQ ENABLE
spl ret s CMST-NO ACTION
DM DVIIT, DM DOT - Desynchronizers With Thread Fig. 88 illustrates the boundary of the inventive DM-DWT AND DM-DOT part.

DM_DWT desynchronizes and forwards events received on its in input. The input event is desynchronized only if the input event's attributes specify that it may be distributed asynchronously, otherwise DM DWT returns an error. Each instance of DM_DWT uses its own thread to de-queue the events queued through in and send them to out.
Before an input event is queued, DM DWT checks the self-owned attribute of the event (CMEVT A_SELF OWNED). If it is set, the event is queued as-is, otherwise a copy of the event is queued. In any case the output is called with the self-owned attribute cleared'. DM_DWT frees the event memory after the call to out returns.
DM DOT has the same functionality, but it provides a single bi-directional terminal to receive the input events and send the de-synchronized events. It can be used in cases when a part needs to postpone the processing of an event and/or request to be called back in a different thread of execution in order to perform operations that it cannot do in its current execution context.
Note The desynchronized event may be distributed in a thread different than the one that posted it. This may impose additional limitations if thread-local storage is used.
29. Boundary 29.1. Terminals (DM DWT) Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, infinite cardinality, synchronous This terminal receives all the incoming events for DM_DWT.
Events that require synchronous distribution are rejected with CMST REFUSE
status.
Such events are those that have only the CMEVT A_SYNC attribute set. In general, all the events to be desynchronized by DM-DWT should have both the CMEVT A SYNC and the CMEVT A ASYNC attribute set.
Terminal "out" with direction "Out" and contract I DRAIN. Note: v-table, cardinality 1, synchronous DM DSY sends all de-synchronized events out through this terminal.
' This may change in a future release.

This output is called in a dedicated worker thread created by DM-DWT (a separate thread is created by each instance of DM DWT).
29.2. Terminals (DM DOT) Terminal "dsy" with direction "I/O" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous This terminal receives all the incoming events for DM-DOT.
Events that require synchronous distribution are rejected with CMST REFUSE status.
Such events are those that have only the CMEVT A_SYNC attribute set. In general, all the events to be desynchronized by DM-DWT should have both the CMEVT A-SYNC
and the CMEVT A ASYNC attribute set. The de-synchronized events are sent out through the same terminal. The output is called in a dedicated worker thread created by DM DOT (a separate thread is created by each instance of DM DOT).
29.3. Events and notifications Incoming Bus Notes Event EV XXX CMEVENT DM-DWT: All incoming events on in are de-_HDR synchronized and sent out through out.
/CMEvent DM_DOT: All incoming events on dsy are de-synchronized and sent back through dsy.
29.4.
Outgoing Bus Notes Event EV XXX CMEVENT All incoming events on inldsy) are de-synchronized and _HDR sent out through out(dsy).
/CMEvent is 29.5. Special events, frames, commands or verbs None.

29.6. Properties Property "queue sz" of type "UINT32". Note: This is the number of events that the event queue can hold. If 0, the queue will extend itself when it gets full (the number of events the queue can hold is limited only by available memory). This property is redirected to the EST subordinate. Default is 0.
Property "thread priority" of type "UINT32". Note: Specifies the priority of the worker thread. The values for this property depend on the environment. It is used directly to call the environment specific function that sets the thread priority (SetThreadPriority in Win32, KeSetPriorityThread in WDM, etc.). This property is l0 redirected to the EST subordinate.
30. Encapsulated interactions The DM EST part used in the DM DWT and DM DOT assemblies uses the following operating system services:
~ Thread functions ~ Synchronization functions Note that these functions are different in each operating environment. For details, please refer to the DM EST data sheet.
31. Specification Fig. 89 illustrates the. internal structure of the inventive DM-DWT part.
Fig. 90 illustrates the internal structure of the inventive DM DOT part.
32. Responsibilities 1. Desynchronize all incoming events received from in/dsy and send them out through out/dsy.
2. Use a dedicated worker thread to call the out/dsy terminal.
33. Theory of operation DM_DWT and DM-DOT are assemblies built entirely of DriverMagic parts.
For simplicity, the description below refers to DM DWT only. The same description is valid for DM_DOT, except that DM_DWT has separate input and output while DM-DOT has a single bi-directional terminal for both input and output (see the diagrams above).

An event that enters DM-DWT is enqueued by DM-DWI and control returns to the caller immediately with CMST-OK (if DM-DWI fails to enqueue the event -i.e., the queue is full or the event does not qualify as de-synchronizable, an error status is returned).
If this is the first event enqueued, DM-DWI sends an enable request to its idle terminal. This request is translated by DM-IES to an ,"arm" operation sent to DM-EST, which in turn unblocks the worker thread created by DM-EST. When the worker thread receives control, DM-EST calls "fire" on its output continuously, until disabled. The "fire" operations are translated by DM-IES into EV-IDLE events used by DM DWI to de-queue events from its queue and send them to out.
When the queue becomes empty, DM-DWI sends a disable request (translated to "disarm" on DM EST), which causes the worker thread to be blocked until a new event is enqueued.
34. Subordinate Parameterization Subordinate Property Value DM EST force defaults TRUE
auto arm FALSE
continuous TRUE
34.1. Use Cases De-synchronizing events with DM DWT
Fig. 91 illustrates an advantageous use of the inventive DM-DWT part.
Fig. 92 illustrates an advantageous use of the inventive DM-DWT part.
If one or more event sources are connected to a single event recipient and all the event sources produce only de-synchronizable2 events, DM-DWT may be placed in Z An event is de-synchronizable if it satisfies all of, the following requirements:
a) the event data buffer is not in any way bound to the execution context of the caller (e.g., is not allocated on the caller's stack and does not use or refer to thread-specific data) or it may be safely copied (i.e., has no references to volatile data, like automatic or heap-allocated buffers that can become unavailable when the event is de-queued);
b) the event source does not need to receive a return status or data placed in the event data buffer from the processing of the event;

front of the recipient it a direct connection is undesirable for any of the following reasons (or other similar considerations):
~ The event sources) do not execute in a normal thread context, while the recipient requires normal thread context to run.
~ The event sourcels) may not be blocked for any reason, while the recipient calls (or is expected to call) system functions that can block the thread and/or its outputs when it receives an event.
~ If there is a direct or indirect loopback path from the event recipient to the event source - to avoid re-entering the source and causing an infinite loop or recursion l0 that may oveflow the call stack.
Note that since an instance of DM-DWT.uses a single thread, the de-synchronized events are also serialized, i.e., the part connected to DM DWT's output will receive them in sequence and will never be re-entered from this connection with a new event until it has returned from the previous one. If serialization of events from multiple sources is undesirable, a separate instance of DM-DWT may be used to de-synchronize events from each of the sources.
Serializing and/or postponing processing of events generated inside a part with DM DOT
Fig. 93 illustrates an advantageous use of the inventive DM-DOT part.
Some parts interact with sources of asynchronous events ("Asynchronous event"
here does not necessarily refer to a CIassMagic event, but to any type of ,entry into the part that is asynchronous, e.g., a callback from the operating system or an embedded interaction), which may come in an execution context that is restricted in some way, e.g.:
~ the part's guard cannot be acquired;
~ access to some system services is restricted;
~ the event requires lengthy processing and the current thread of execution may not be blocked or delayed.
c) the event source can continue execution whether or not the event was actually delivered.

~ the execution context may not be suitable for calling the part's outputs, because parts connected to these outputs cannot enter their guard and/or cannot call system APIs at that time.
In such cases the part needs to defer part or all processing of asynchronous events and request to be re-entered in a normal thread context. To do this it should have a bi-directional I-DRAIN terminal (dsy - see diagram) connected to an instance of DM DOT. When it 'needs to postpone an event, it fills in a CIassMagic event structure with all the information required to process the event later and sends it through dsy. DM-DOT will later call it back through the same terminal with the posted event structure - in the context of its working thread.
DM DWP DM DOP - Desynchronizers With DriverMagic Pump Fig. 94 illustrates the boundary of the inventive DM-DWP and DM-DOP parts.
DM DWP desynchronizes and forwards operation requests received on its in input. DM-DWP uses the DriverMagic pump to desynchronize the operations received through in and send them to out. The operation requests are dispatched in the execution context of the DriverMagic pump thread.
DM-DOP has the same functionality, but it provides a single bi-directional terminal to receive the input requests and send the de-synchronized requests. It can be used in cases when a part needs to postpone the processing of an event and/or request to be called back in a different thread of execution in order to perform operations that it cannot do in its current execution context.
Note The desynchronized operation request may be distributed in a thread different than the one that posted it. This may impose additional limitations if thread-local storage is used.
35. Boundary 35.1. Terminals (DM DWP) Terminal "in" with direction "In" and contract I POLY. Note: v-table, infinite cardinality, synchronous This terminal receives all the incoming operation requests for DM DWP.

Terminal "out" with direction "Out" and contract I-POLY. Note: v-table, cardinality 1, synchronous DM-DWP sends all de-synchronized operation requests out through this terminal. This output is called in the thread context of the DriverMagic pump.
35.2. Terminals (DM DOP) Terminal "dsy" with direction "Plug" and contract I POLY. Note: v-table, cardinality 1, synchronous This terminal receives all the incoming operation requests for DM_DOP. This output is called in the thread context of the DriverMagic pump.
35.3. Events and notifications None.
35.4. Special events, frames, commands or verbs None.
35.5. Properties Property "queue sz" of type "UINT32". Note: This is the number of operation requests that the operation queue can hold. If 0, the queue will extend itself when it gets full (the number of operations the queue can hold is limited only by available memory). Default is 0.
Property "ok stat" of type "UINT32". Note: This specifies the status that DM DWP/DM DOP returns on calls through in if the operation request was successfully enqueued. This status is also used to determine if operation requests passed through out succeeded. Default is CMST OK.
Property "disable diag" of type "UINT32". Note: Boolean. This determines whether DM_DWP/DM_DOP prints debug output indicating that a call through out failed. A
call through out fails if the return status is not equal to ok stat. This property affects only the checked build of DM DWP/DM DOP. Default is FALSE.
36. Encapsulated interactions DM DWP and DM DOP use the DriverMagic pump in order to desynchronize the operation requests.
37. Specification Fig. 95 illustrates the internal structure of the inventive DM_DWP part.
Fig. 96 illustrates the internal structure of the inventive DM-DOP part.

38. Responsibilities 1. Desynchronize all incoming operation requests received from in/dsy and send them out through out/dsy.
39. Theory of operation DM-DWP and DM-DOP are assemblies built entirely of DriverMagic parts.
For simplicity, the description below refers to DM-DWP only. The same description is valid for DM-DOP, except that DM-DWP has separate input and output while DM-DOP has a single bi-directional terminal for both input and output (see the diagrams above).
An operation request that enters DM-DWP is enqueued by DM-FDSY and control returns to the caller immediately with CMST OK (if DM-FDSY fails to enqueue the request - i.e., the queue is full; an error status is returned).
If this is the first request enqueued, DM-FDSY sends an enable request to its ctl terminal. This request is translated by DM-IES to an "arm" operation sent to DM-ESP, which in turn posts a message to itself. When the message is dispatched by the DriverMagic pump, DM-ESP calls "fire" on its output continuously, until disabled. The "fire" operations are translated by DM-IES into EV-IDLE events used by DM FDSY to de-queue requests from its queue and send them to out.
When the queue becomes empty, DM FDSY sends a disable request (translated to "disarm" on DM-ESP), which causes DM-ESP to no longer post messages to itself until a new operation request is enqueued.
40. Distribution of Properties Property Distr. Subordinate queue sz Redirecte fdsy.queue sz d ok stat Redirecte fdsy.ok stat d disable diag Redirecte fdsy.disable diag d 41. Subordinate Parameterization Subordinate Property Value DM ESP force defaults TRUE
auto arm FALSE
continuous TRUE
DM FDSY disable ctl req FALSE
DM DWW, DM DOW - Desynchronizers With Window Fig. 97 illustrates the boundary of the inventive DM-DWW and DM_DOW parts.
DM-DWW desynchronizes and forwards events received on its in input. The input event is desynchronized only if the input event's attributes specify that it may be distributed asynchronously, otherwise DM DWW returns an error. Each instance of DM-DWW uses its own window to de-queue the events queued through in and send them to out. The events are dispatched in the same thread in which DM DWW
was created.
Before an input event is queued, DM-DWW checks the self-owned attribute of the event (CMEVT A SELF OWNED). If it is set, the event is queued as-is, otherwise a copy of the event is queued. In any case the output is called with the self-owned attribute cleared'. DM DWW frees the event memory after the call to out returns.
DM_DOW has the same functionality, but it provides a single bi-directional terminal to receive the input events and send the de-synchronized events. It can be used in cases when a part needs to postpone the processing of an event and/or request to be called back in a different thread of execution in order to perform operations that it cannot do in its current execution context.
DM DWW and DM DOW are only available in the Win32 environment.
Note The desynchronized event may be distributed in a thread different than the one that posted it. This may impose additional limitations if thread-local storage is used.
' This may change in a future release.

42. Boundary 42.1. Terminals (DM DWW) Terminal "in" with direction "In" and contract I DRAIN. Note: v-table, infinite cardinality, synchronous This terminal receives all the incoming events for DM
DWW.
Events that require synchronous distribution are rejected with CMST-REFUSE
status.
Such events are those that have only the CMEVT A-SYNC attribute set. In general, all the events to be desynchronized by DM DWW should have both the CMEVT A SYNC and the CMEVT A ASYNC attribute set.
Terminal "out" with direction "Out" and contract I-DRAIN. Note: v-table, cardinality l0 1, synchronous DM_DWW sends all de-synchronized events out through this terminal. This output is called in the same thread context of its window, which is the same thread in which DM-DWW was created in. (a separate window is created by each instance of DM DWW).
42.2. Terminals (DM DOW) Terminal "dsy" with direction "I/O" and contract I-DRAIN. Note: v-table, cardinality 1 , synchronous This terminal receives all the incoming events for DM-DOW.
Events that require synchronous distribution are rejected with CMST-REFUSE status.
Such events are those that have only the CMEVT A SYNC attribute set. In general, all the events to be desynchronized by DM-DWW should have both the CMEVT A-SYNC
and the CMEVT A ASYNC attribute set. The de-synchronized events are sent out through the same terminal. The output is called in the same thread context of its window, which is the same thread in which DM DWW was created in. (a separate widnow is created by each instance of DM_DOW).

42.3. Events and notifications Incoming Bus Notes Event EV XXX CMEVENT DM-DWW: All incoming events on in are de-_HDR synchronized and sent out through out.
/CMEvent DM_DOW: All incoming events on dsy are de-synchronized and sent back through dsy.
42.4.
Outgoing Bus Notes Event EV XXX CMEVENT All incoming events on inldsy) are de-synchronized and -HDR sent out through out(dsy).
/CMEvent 42.5. Special events, frames, commands or verbs None.
42.6. Properties Property "thread-priority" of type "INT32". Note: Specifies the priority of the worker thread. The values for this property depend on the environment. It is used directly to call the environment specific function that sets the thread priority (SetThreadPriority in Win32, KeSetPriorityThread in WDM, etc.).
43. Encapsulated interactions The DM-ESW part used in the DM_DWW and DM DOW assemblies uses the' following Win32 APIs to control its event window and timers:
~ RegisterClass() ~ DeregisterClassl) ~ CreateWindow() ~ DestroyWindow() ~ SetTimer() ~ KiIITimer() ~ PostMessagel) 44. Specification Fig. 98 illustrates the internal structure of the inventive DM-DWW part.
Fig. 99 illustrates the internal structure of the inventive DM-DOW part.
45. Responsibilities 1. Desynchronize all incoming events received from in/dsy and send them out through out/dsy in the same thread context in which it was created.
46. Theory of operation DM-DWW and DM-DOW are assemblies built entirely of DriverMagic parts.
For simplicity, the description below refers to DM-DWW only. The same description is valid for DM-DOW, except that DM-DWW has separate input and output while DM-DOW has a single bi-directional terminal for both input and output (see the diagrams above).
An event that enters DM DWW is enqueued by DM DWI and control returns to the caller immediately with CMST OK (if DM-DWI fails to enqueue the event -i.e., the queue is full or the event does not qualify as de-synchronizable, an error status is returned).
If this is the first event enqueued, DM-DWI sends an enable request to its idle terminal. This request is translated by DM IES to an "arm" operation sent to DM ESW, which in turn posts a message to its window. When the window receives the message, DM-ESW calls "fire" on its output continuously, until disabled.
The "fire" operations are translated by DM-IES into EV-IDLE events used by DM-DWI
to de-queue events from its queue and send them to out.
When the queue becomes empty, DM DWI sends a disable request (translated to "disarm" on DM-ESW), which causes DM ESW to no longer post messages to its window until a new event is enqueued.

47. Subordinate Parameterization Subordinate Property Value DM ESW force defaults TRUE
auto arm FALSE
continuous TRUE
Notes Some parts interact with sources of asynchronous events (embedded interactions), which may come in an execution context that is restricted in some way, e.g.:
~ the part's guard cannot be acquired;
~ access to some system services is restricted;
~ the event requires lengthy processing and the current thread of execution may not be blocked or delayed.
~ the execution context may not be suitable for calling the part's outputs, because parts connected to these outputs cannot enter their guard, and/or cannot call system APIs at that time.
~ All outgoing events must be sent in the same thread that the DM-DOW was created.
In such cases the part needs to defer part or all processing of asynchronous events and request to be re-entered in a normal thread context. To do this it should have a bi-directional I-DRAIN terminal (dsy - see diagram) connected to an instance of DM DOW. When it needs to postpone an event, it fills in a CIassMagic event structure with all the information required to process the event later and sends it through dsy. DM-DOW will later call it back through the same terminal with the posted event structure - in the thread context in which it was created.
1. In order for DM DOW and DM DWW to work correctly, the application that contains the parts must provide a message dispatch loop as defined by Windows.
This allows the messages for an application to be dispatched to the aprpropriate window. Please see the Win32 documentation for more information.

2. As Win32 requires that windows be destroyed in the same thread in which they are created, DM-DOW and DM-DWW also must be destroyed in the same thread in which they were created. Failure to do so will typically fail to destroy the window.
DM RDNlT - Request Desynchronizer With Thread Fig. 100 illustrates the boundary of the inventive DM-RDWT part.
DM-RDWT desynchronizes and forwards requests received on its in input. The input request is assumed not to be allocated on the caller's stack. Each instance of DM-RDWT uses its own thread to de-queue the requests queued through in and l0 sends them to out. The desynchronized requests sent through out are in the context of DM RDWT's worker thread.
If the incoming request does not have the CMEVT A ASYNC CPLT attribute set DM-RDWT fails with CMST-REFUSE. For each request, there is garenteed to be a completion event sent back through in.
All events received on out are forwarded through in without modification (synchronously).
48. Boundary 48.1. Terminals Terminal "in" with direction "Plug" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous This terminal receives all the incoming requests for DM-RDWT.
Completion events for asynchronously completed requests are received from out and are forwarded out through in.
Terminal "out" with direction "Plug" and contract I-DRAIN. Note: v-table, cardinality 1, synchronous DM-DSY sends all de-synchronized requests out through this terminal. This output is called in a dedicated worker thread created by DM
RDWT (a separate thread is created by each instance of DM_RDWT). Completion events for asynchronously completed requests are received by this terminal and are forwarded out through in.

48.2. Events and notifications Incoming Bus Notes Event EV XXX CMEVENT All incoming requests on in are de-synchronized and -HDR sent out through out.

/CMEvent 48.3.

Outgoing Bus Notes Event EV XXX CMEVENT All incoming events on in are de-synchronized and sent -HDR out through out.
/CMEvent 48.4. Special events, frames, commands or verbs None.
48.5. Properties Property "thread-priority" of type "UINT32". Note: Specifies the priority of the worker thread. The values for this property depend on the environment. It is used directly to call the environment specific function that sets the thread priority (SetThreadPriority in Win32, KeSetPriorityThread in WDM; etc.). This property is redirected to the EST subordinate.
Property "queue sz" of type "UINT32". Note: This is the number of requests that the request queue can hold. If 0, the queue will extend itself when it gets full (the number of events the queue can hold is limited only by available memory). This property is redirected to the DSYR subordinate. Default is 0.
Property "disable diag" of type "UINT32". Note: Boolean. This determines whether DM RDWT prints debug output indicating that a call through out failed. A call through out fails if the return status is not equal to ok stat. This property affects only the checked build of DM_RDWT. This property is redirected to the DSYR
subordinate.
Default is FALSE.

Property "cplt s offs" of type "UINT32". Note: Offset in bytes of the completion status in the request bus. This property is redirected to the DSYR
subordinate.
Mandatory.
49. Encapsulated interactions The DM-EST part used in the DM-RDWT assembly uses the following operating system services:
Thread functions Synchronization functions Note that these functions are different in each operating environment. For details, please refer to the DM-EST data sheet.
50. Specification Fig. 101 illustrates the internal structure of the inventive DM-RDWT part.
51. Responsibilities 1. Desynchronize all incoming requests received from in and send them through out.
2. Use a dedicated worker thread to call the out terminal.
52. Theory of Operation DM-RDWT is an assembly built entirely of DriverMagic parts.
A request that enters DM RDWT is enqueued by DM DSYR and control returns to the caller immediately with CMST OK (if DM DSYR fails to enqueue the request -i.e., the queue is full an error status is returned).
If this is the first request enqueued, DM DSYR sends an enable request to its ctl terminal. This request is translated by DM-IES to an "arm" operation sent to DM EST, which in turn starts issuing "fire" calls in its own thread. The "fire"
operations are translated by DM-IES into EV-IDLE events used by DM-DSYR to de-queue requests from its queue and send them to out.
When the queue becomes empty, DM-DSYR sends a disable request (translated to "disarm" on DM-EST), which causes the DM-EST to stop firing until a new request is enqueued.

53. , Subordinate's Responsibilities 53.1. DM DSYR - Desynchronizer for Requests Desychronize incoming requests on in and send them through out.
53.2. DM IES - Idle to Event Source Adapter Convert EV REQ ENABLE and EV REQ DISABLE requests on the idle terminal into arm and disarm operations on the evs terminal respectively.
In response to fire operation calls through the evs terminal, generate EV IDLE requests through idle until CMST NO ACTION is returned from the idle processing or an EV-REQ-DISABLE request is received.
53.3. DM EST - Event Source by Thread Issue "fire" calls within the context of its own thread.
54. Dominant's Responsibilities 54.1. Hard parameterization of subordinates Subordinate Property Value DM DSYR disable ctl req FALSE
DM EST force defaults TRUE
auto arm FALSE
continuous TRUE
54.2. Distribution of Properties to the Subordinates Property Name Type Dist To thread priority UINT3 Redir est.thread priority queue sz UINT3 Redir dsyr.queue sz disable diag UINT3 Redir dsyr.disable diag cplt s offs UINT3 Redir dsyr.cplt s offs 55. Notes The desynchronized requests are distributed in a thread different than the one that posted it. This may impose additional limitations if thread-local storage is used.
Resynchronizers DM RSY DM RSB - Re-synchronizers Fig. 102 illustrates the boundary of the inventive DM-RSB part.
Fig. 103 illustrates the boundary of the inventive DM-RSY part.
1. Overview DM RSY is an adapter that converts a Request Event that is expected to complete synchronously into a Request Event that may complete either synchronously or asynchronously.
By doing this, DM-RSY provides the part connected to its out terminal with the option to either complete the request immediately or return CMST PENDING and delay the actual completion of the request for a future time.
At the same time DM_RSY ensures that the part connected to the in terminal will receive control back (DM-RSY will return from raise operation) only after the processing of the request has actually been completed.
DM RSY is parameterized with the event ID of the Request Event, which needs to be adapted for asynchronous processing. Addional properties control details of how the adapting procedure is performed.
DM RSB has the same functionality as DM RSY, but allows bi-directional connections to its in terminal. The back channel of the in terminal is used to transparently forward all events received on the back channel of the out terminal, allowing DM-RSB to be inserted in bi-directional connections.
2. Details DM RSY uses a specialized protocol to accomplish the process of resynchronization. DM-RSY sets an attribute (the value of this attribute is a property) on the incoming event, indicating that the request can be completed asynchronously, and forwards the event to its out terminal.

The part connected to that terminal may complete the processing immediately (synchronously) or may decide to delay the processing and return CMST-PENDING.
If the request was completed synchronously, DM-RSY returns immediately to the originator. If the processing was delayed (CMST PENDING was returned) however, DM-RSY will block the originator of the event and wait for an event to come from the back channel of the out terminal (the event ID is a property) indicating that the request has been completed. After DM RSY receives such event, it will return to the Request Event originator (restoring the original attributes).
3. Boundary 3.1. Terminals (DM RSY) Terminal "in" with direction "Input" and contract I DRAIN. Note: v-table, infinite cardinality, synchronous, activetime The req ev id event is expected to be received on this terminal. If req ev id is EV NULL, any event may be received on this terminal.
15. Terminal "out" with direction "Bidir (plug)" and contract I DRAIN. Note: v-table, cardinality 1, synchronous, unguarded The cplt ev-id event is expected to be received on this terminal.
3.2. Terminals (DM RSB) Terminal "in" with direction "Bidir (plug)" and contract I_DRAIN. Note: v-table, cardinality 1, synchronous The req ev_id event is expected to be received on this terminal. If req ev id is EV NULL, any event may be received on this terminal.
Terminal "out" with direction "Bidir (plug)" and contract I DRAIN. Note: v-table, cardinality 1, synchronous, unguarded The cplt ev-id event is expected to be received on this terminal.
3.3. Events and notifications The re-synchronizers recognize two specific events: req ev id and cplt ev-id.
The event IDs for these two events are specified as properties and are described in the tables below:
Incoming Event Bus Notes req ev-id CMEVENT- The event that requests a synchronous or asynchronous HDR operation.
or extended This event ID is specified as a property on the re-synchronizers..
This event is expected to be received on the in terminal.
If req ev_id is EV-NULL, any event may be re-synchronized.
This event may be the same as cplt ev id.
cplt ev id CMEVENT- The event that signifies that an asynchronous HDR operation, requested by a preceding req ev id, has or extended completed.
This event ID is specified as a property on the re-synchronizers. °
This event is expected to be received on the out terminal.
This event may be the same as req ev id.
all others CMEVENT- All incoming events received from the in terminal are HDR forwarded through out.
or extended DM-RSB: Unrecognized events received from the out terminal are forwarded through in if the re-synchronizer is not expecting to receive a completion notification.
Otherwise, the event is refused.
DM-RSY: Unrecognized events received from the out terminal are not processed by DM RSY and CMST NOT CONNECTED is returned.
3.4.
3.5.
Outgoing Bus Notes Event req ev-id CMEVENT- The event that requests a synchronous or asynchronous HDR operation.
or extended This event ID is specified as a property on the re-synchronizers.
This event, when received on the in terminal, is passed through the out terminal.
all others CMEVENT_ All incoming events received from the in terminal are HDR forwarded through out.
orextended 3.6. Special events, frames, commands or verbs None.
3.7. Properties Property "req ev id" of type "UINT32". Note: This is the ID of the event that requests the operation that needs to be completed asynchronously. If req ev id is EV_NULL, any event may be re-synchronized. This event is expected to be received on the in terminal. This event may be the same as cplt ev_id. Default is EV-NULL.
Property "cplt ev id" of type "UINT32". Note: This is the ID of the event that signifies the completion of the asynchronous operation. This event is expected to be received on the out terminal. If cplt ev id is EV NULL, the completion event must be the same as req ev id, otherwise it may be a different event. Default is EV
NULL.
Property "async cplt attr" of type "UINT32". Note: This is the event-specific attribute to be set on the req ev id event in order to signify that the requested operation can be completed asynchronously. The attribute value may be 0.
Default is CMEVT A ASYNC CPLT.
Property "cplt attr" of type "UINT32". Note: This is the event-specific attribute to be set on the cplt ev id event in order to signify that the asynchronous operation has completed. This attribute is used only if req ev-id is the same as cplt ev_id.
The attribute value may be 0. Default is CMEVT A COMPLETED.

Property "copy cplt data" of type "BOOL". Note: If TRUE, the re-synchronizer copies the completion data from the completion event bus to the event bus of the originator of the request. Default is FALSE.
Property "extract cplt s" of type "BOOL". Note: If TRUE, the re-synchronizer extracts the completion status from the completion event bus and return it to the originator of the request. Default is FALSE.
Property "cplt s offset" of type "UINT32". Note: This is the offset from the beginning of the completion event bus (in bytes), where the completion status is stored. This property is ignored if extract cplt s is FALSE. Default is OxOC.
4. Encapsulated interactions DM-RSY uses the synchronization services (Events) of the operating system to block the thread that requests the operation which is desynchronized.
5. Dependencies DM_RSY requires DM_BSP and DM-RSB to be available.
6. Specification 7. Responsibilities 1. Pass all events received from the in terminal through the out terminal.
2. DM-RSB: Pass all unrecognized events received from the out terminal through the in terminal (only if the re-synchronizer is not expecting to receive a completion notification; otherwise the event is refused).
3. DM RSY: Ignore unrecognized events received from the out terminal.
4. If an req ev_id event is received on the in terminal, forward the event through out and block the caller (if needed) until the cplt ev_id event is received on the out terminal. If an req ev_id is EV_NULL, allow any event to be re-synchronized.
5. When an asynchronous operation completes, return the results and control back to the caller.
8. Theory of operation Fig. 104 illustrates the internal structure of the inventive DM_RSY part.

8.1. Interior DM_RSB is a coded part.
DM RSY is a static assembly.
8.2. Mechanisms Handling operation requests from the in terminal When the re-synchronizer receives an req ev id event (or any event if req ev-id is EV NULL) from the in terminal, it sets the asynchronous completion attribute (specified by async cplt attr) and forwards the event through the out terminal.
If any status other than CMST OK or CMST_PENDING is returned from the event processing, this is considered an error and the status is returned to the caller.
If the return status is CMST OK (or any status other than CMST PENDING) the operation completed synchronously. In this case, the re-synchronizer returns control back to the caller and does nothing else.
If the return status is CMST PENDING, the operation will complete asynchronously. The re-synchronizer blocks the caller (using an event synchronization object) until it receives an cplt ev_id event on its out terminal. When an cplt ev-id event is received, the event object is signaled and control is returned back to the caller.
In all cases, before the control is returned back to the caller, the event-specific attributes (possibly modified by the re-synchronizer) are restored to their original values.
The re-synchronizers pass all other events from the in terminal through the out terminal without modification.
Notification of asynchronous operation completion The re-synchronizer blocks the caller (as described in the mechanism above) until it receives an cplt ev id event on its out terminal. This event indicates that the asynchronous operation is complete.
If the completion event (cplt ev id) is the same as the operation request event (req ev_id), the re-synchronizer expects that the completion attribute (cplt attr) is set. If not, the re-synchronizer returns CMST REFUSE.

When the asynchronous operation has completed, the caller is unblocked by signaling the event object. The re-synchronizer uses the values of the properties copy cplt data and extract cplt s to determine if it should copy the completion event bus and/or return the completion status to the caller. The caller receives the results of the asynchronous operation and continues execution as if the requested operation had completed synchronously.
If an unrecognized event is received on the out terminal and the re-synchronizer is not expecting to receive a completion notification, it will pass the event through the in terminal. If a completion event is expected, the event is refused.
Extraction of the completion status When the asynchronous operation has completed, the re-synchronizer uses the value of the extract cplt s property to determine whether the completion status is returned to the caller.
If extract cplt s is TRUE, the re-synchronizer uses the value of cplt s offset to determine where the completion status is stored in the completion event bus.
The status is extracted and returned to the caller.
If extract cplt s is FALSE, the re-synchronizer returns CMST-OK to the caller.
8.3. Use Cases Fig. 105 illustrates an advantageous use of the inventive DM_RSY part.
Fig. 106 illustrates an advantageous use of the inventive DM_RSB part.
Requested operation completes synchronously 1. The structures in figures 3 and 4 are created, connected, and activated.
2. At some point, the re-synchronizer receives an req ev_id event on its in terminal.
3. The re-synchronizer sets the asynchronous attribute (async cplt attr) in the event bus to indicate that the operation can complete asynchronously if needed.
4. The event is passed through the out terminal.

5. The part connected to the re-synchronizer's out terminal receives the event and completes the operation synchronously. Control is returned back to the re-synchronizer.
6. The re-synchronizer returns control back to the caller.
7. Steps 2-6 may be executed many times.
8. The re-synchronizer is deactivated, disconnected, and destroyed.
Requested operation completes asynchronously 1 . The structures in figures 3 and 4 are created, connected, and activated.
2. At some point, the re-synchronizer receives an req ev id event on its in l0 terminal.
3. The re-synchronizer sets the asynchronous attribute (async cplt attr) in the event bus to indicate that the operation can complete asynchronously if needed.
4. The event is passed through the out terminal.
5. The part connected to the re-synchronizers out terminal receives the event and returns CMST_PENDING indicating that the operation will complete asynchronously.
6. The re-synchronizer blocks the caller by waiting on an event synchronization object.
7. At some later point, the re-synchronizer receives a cplt ev_id event on its out terminal.
8. If the copy cplt data property is TRUE, the re-synchronizer copies the completion data into the event bus of the blocked caller.
9. If the extract cplt s property is TRUE, the re-synchronizer extracts the completion status from the completion data and saves it in its instance data.
10.The re-synchronizer unblocks the caller by signaling the event.
1 1.1f the extract cplt s property is TRUE, the saved completion status is returned to the caller, otherwise CMST OK is returned.
12.Steps 2-1 1 may be executed many times.
13.The re-synchronizer is deactivated, disconnected, and destroyed.

Unrecognized events received on in terminal 1 . DM RSB/DM RSY is created, connected, and activated.
2. At some point, the re-synchronizer receives an unrecognized event on its in terminal (any event other than req ev id).
3. The re-synchronizer forwards the event through the out terminal and returns the results back to the caller.
4. Steps 2-3 may be executed many times.
5. The re-synchronizer is deactivated, disconnected, and destroyed.
Unrecognized events received on out terminal 1 . DM RSB/DM RSY is created, connected, and activated.
2. At some point, the re-synchronizer receives an unrecognized event on its out terminal (any event other than cplt ev id).
3. If the re-synchronizer is expecting to receive a completion notification, it returns CMST-REFUSE. Otherwise, DM-RSB forwards the event through the in terminal and returns the results back to the caller. DM RSY returns CMST NOT CONNECTED.
4. Steps 2-3 may be executed many times.
5. The re-synchronizer is deactivated, disconnected, and destroyed.
Using cascaded re-synchronizers Fig. 107 illustrates an advantageous use of the inventive DM_RSB and DM-RSY
parts.
The structure in the figure above is used if there is a need to resynchronize different operations along the same channel. In this example, 3 resynchronizers are cascaded - one for each of 3 events that can be made to complete asynchronously.
1. The structure in figure 5 is created, parameterized, and activated.
2. Part A sends an event (e.g., the one that is parameterized on the second resynchronizer) to the first resynchronizer. The resynchronizer passes it through the out terminal.
3. The second resynchronizer receives the event and passes it through the out terminal.

4. The third resynchronizer receives the event and passes it through the out terminal.
5. Part B receives the event and returns CMST_PENDING indicating that the operation will complete asynchronously. Control is returned to the second resynchronizer.
6. The second resynchronizer blocks the caller by waiting on an event synchronization object.
7. The asynchronous operation is completed the same way as in the above use cases.
l0 8. The second resynchronizer returns control back to Part A.
9. Notes 1. If any of the resynchronizers receive cplt ev id on its out terminal while it is not expecting asynchronous completion, it will return CMST REFUSE.
2. If an event is sent to the resynchronizers in terminal while the resynchronizer is waiting for asynchronous completion, the caller will be blocked until the pending asynchronous operation completes.
3. DM RSY does not enforce the contract ID of the in terminal. The counter terminal of in is expected to be I-DRAIN.
4. If an unrecognized event is received on the resynchronizer's out terminal (while it is not waiting for an asynchronous operation to complete), different situations can occurr. DM_RSY will always return CMST-NOT CONNECTED and DM-RSB will always pass the event through the in terminal.
5. The asynchronous operation may be completed by sending the completion event to the resynchronizer while in the context of the operation request.

Buffers DM SEB - Synchronous Event Buffer Fig. 108 illustrates the boundary of the inventive DM SEB part.
DM-SEB is a synchronous event buffer with flow control on its output terminal, out. Events are received synchronously at in and are either passed through to out or are buffered internally until the output is enabled via ctl.
The output is enabled or disabled when the EV REQ ENABLE and EV REQ DISABLE events are received at ctl, respectively.
When the output is enabled, an event received at in is passed through, un-interpreted and un-buffered, to out and runs in the thread of the sender to in. If the output is disabled, all events received by in are buffered until an EV REQ
ENABLE is received at ctl. On the EV REQ ENABLE event, all buffered events are sent out the out terminal in the thread of the EV REO. ENABLE sender.
DM SEB's output is enabled on activation.

1. Boundary 1.1. Terminals Terminal "in" with direction "In" and contract I-DRAIN. Note: Input for any type of event to be either buffered or passed through. The event is not interpreted by DM SEB.
Terminal "out" with direction "Out" and contract I DRAIN. Note: Output for events received at in. Events are output only if the output is enabled.
Terminal "ctl" with direction "In" and contract I DRAIN. Note: Output control.
Responds to EV-REQ_ENABLE and EV_REQ-DISABLE events in order to enable or disable the output.
1.2. Events and notifications Incoming Event Bus Notes EV_REQ-ENAB CMEVENT_ Changes the state of the output to enabled.
LE HDR All events received by in after this event are passed through, un-interpreted, to out.
EV-REQ-DISA CMEVENT- Changes the state of the output to disabled.
BLE HDR All events received by in after this event are buffered on an internal queue and not sent out.
DM SEB has no outgoing events.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "reset ev-id" of type "UINT32". Note: Event ID that will reset DM SEB
before the event is forwarded or buffered. This is a redirected property.
2. Encapsulated interactions None.

3. Internal Definition Fig. 109 illustrates the internal structure of the inventive DM_SEB part.
DM SEB is an assembly that is built entirely out of DriverMagic library parts.
It is comprised of a "Desynchronizer with Idle Input" (DW1), which provides the event queue for the assembly, an "Idle Generator Driven by Event" (IEVx) that provides idle events to dequeue events buffered in DWI, a "Event Notifier" (NFY) to reset DWI on a high priority input event and a "Stackable Critical Section" (CRTx), which guard DM SEB's inputs, since it has no input operations of its own.
Events received at in pass through NFY and IEV1 to be enqueued in DWI. If an EV-REO._ENABLE event has been previously received at ctl, then IEV1 will generate EV IDLE events to the event bus, which is parameterized to send the event out its dom terminal first. DWI receives the EV IDLE event from the event bus and de-queues its events in response.
The output is disabled when an EV_REQ-DISABLE event is received at ctl. IEV2 passes this event to the event bus, which in turn passes it to both IEV1 and IEV2 at their idle terminals, disabling them. Any future events received at in will pass through NFY and IEV1 to DWI to be buffered as before, but no EV-IDLE events will be generated by IEV2 or IEV2.
NFY gives DM SEB the ability to pass "reset" events immediately to its output.
It maps an input event, specified by its reset ev_id property, to an EV-RESET
event that it sends out its aux terminal, in order to clear DWI's event queue before it is forwarded to DWI and subsequently out DM-SEB's out terminal. DWI is guaranteed to receive this event with an empty queue. The effect of DM SEB receiving this event is that it will be passed through to the output immediately, even if DWI
had other events already enqueued. The reset event is passed through DM SEB's out terminal only if DM SEB is enabled.

4. Subordinate's Responsibilities 4.1. CRTx 1. Provide a common critical section for all the inputs to the assembly.
DM SEB is a pure assembly and has no guarded input operations of its own.
4.2. IEVx 1. Generate EV-IDLE events out its idle terminal in response to any event it receives on its in terminal, if enabled.
2. Provide the mechanism to enable and disable idle generation on l0 EV REO. xxx events.
4.3. DWI
1. Implement an event queue that can be consumed with EV IDLE
events.
2. Clear the event queue on receipt of an EV RESET event 4.4. NFY
1. Map an input event at its in terminal to an event sent out aux. The input event is forwarded out out either before or after the mapped event is sent out aux.
5. Subordinate Parameterization Subordinate Property Value DWI queue sz 0 (default) disable idle-reqTRUE (default) IEV1 and IEV2idle first FALSE (default) ~

~CRT1 and attr CMCRT A NONE (default) TNFY ~ trigger ~ EV-NULL (default) ev ~

pre_ev _.____.. EV_RESET -_-.___ _-_.~__._,_..__.

__post_...eV._-__-_--EV NULL~(default) ____-_____-.....__..__~__........-___..___...-___._ __ E V g__.-__Sy n c _.-_ T R U E __....-____ _._____ _ _ ~.____..._ Subordinate Property Value _..._.___...__...__.._..__.....___...........__~__..
dom first TRUE

do pview FALSE (default) pview st ok CMST OK (default) detect FALSE (default) enforce FALSE (default) 6. Dominant's Responsibilities , DM SEB is a pure assembly; it does not have responsibilities of its own.
7. Internal Interfaces All internal interfaces are of type I DRAIN.
8. Theory of operation 8.1. Mechanisms Event buffering DWI implements an event queue to buffer incoming events. Events buffered by DWI will be sent out out while it receives EV IDLE events. If the EV IDLE
events have been disabled, DWI will simply add any incoming events to its queue.
Idle generation Both IEV1 and IEV2 are responsible for generating EV_IDLE events for DM SEB.
IEV1 generates idle events in response to events received at DM SEB's in terminal and IEV2 generates idles events in response to the EV_REQ-ENABLE event being received at the ctl terminal. In either case, all EV IDLE events are sent to the event bus for distribution. DWI receives the EV_IDLE events from the bus and sends any enqueued events out DM SEB's out terminal in response.
Idle generation control Idle generation is enabled or disabled on EV-REQ xxx events received at DM-SEB's ctl terminal. Both IEV1 and IEV2 must be parameterized to generate idle events after passing the input event through.

When DM-SEB's output is disabled, an EV-REQ-DISABLE event is received at ctl that passes through IEV2 to the event bus where it is distributed to both IEV1 and IEV2, disabling both. No subsequent idle generation can occur.
When an EV-REQ_ENABLE event is received at ctl, it is passes through IEV2 to the event bus and is distributed to IEV1 and IEV2's idle terminal, enabling both.
When IEV2 receives control back from the event bus, it generates EV IDLE
events until DWI's queue is emptied and is shut off by DWI. Any subsequent events received at DM SEB's in terminal will be enqueued by DWI and will start IEV1's EV-IDLE generator to dequeue the event just received by DWI, effectively passing it through.
Handling reset events NFY is parameterized to map an input event to an EV-RESET event that it will send out its aux terminal. When this input event is received, NFY first sends an EV RESET event out aux to clear the event queue in DWI and then forwards the event out its out terminal, where it eventually is received by DWI. This clears the way for the input event to be passed immediately out DM-SEB's out terminal, regardless of how many events have been previously buffered. The reset event is passed through DM SEB's out terminal only if DM SEB is enabled.
DM SEBP - Synchronous Event Buffer with Postpone Fig. 1 10 illustrates the boundary of the inventive DM SEBP part.
DM SEBP is a synchronous event buffer with postpone capability and flow control on its output terminal, out. It contains two queues; (a) main queue -queue for buffered events when output is disabled and (b) postponed queue - queue for events that have been postponed.
Events are received synchronously at in and are either passed through to out or are buffered internally on one of SEBP's queues.
The output is enabled or disabled when the EV-REQ_ENABLE and EV REQ DISABLE events are received at ctl, respectively.
When the output is enabled, an event received at in is passed through, un-interpreted and un-buffered, to out and runs in the thread of the sender to in. If the call returns CMST-POSTPONE, the event is buffered and placed on the postpone queue.
If the output is disabled, all events received by in are buffered on the main queue until an EV REQ ENABLE event is received at ctl. On the EV REQ ENABLE event, all buffered events are sent out the out terminal in the thread of the EV REQ
ENABLE
sender.
If an EV-FLUSH event is received at ctl, the buffered events on the postpone queue are moved to the front of the main queue and are sent out the out terminal in the thread of the EV FLUSH sender.
When the output is disabled, a single event may be dequeued from the main queue and sent out the out terminal by sending an EV-IDLE event to the ctl terminal.
The event is sent out the out terminal in the thread of the EV IDLE sender.
DM SEBP's output is enabled on activation.
9. Boundary 9.1. Terminals Terminal "in" with direction "In" and contract I_DRAIN. Note: Input for any type of event to be either buffered or passed through. The event is not interpreted by DM SEBP.
Terminal "out" with direction "Out" and contract I_DRAIN. Note: Output for events received at in. Events are output only if the output is enabled or an EV FLUSH
or EV IDLE event is received on ctl.
Terminal "ctl" with direction "In" and contract I_DRAIN. Note: Input for output control events.

9.2. Events and notifications The following events are recognized on the in terminal:
Incoming Event Bus Notes (reset ev id) CMEVENT DM SEBP is parameterized with this event via its -HDR reset ev_id property.
When this event is received, DM SEBP empties both of its queues and forwards the event to out (if it is enabled). If DM SEBP is disabled, the event is placed on the main queue.
This event does not affect the enabledldisabled state of DM SEBP
The following events are recognized on the ctl terminal:
Incoming Event Bus Notes EV REQ ENABL CMEVENT Changes the state of the output to enabled.
E -HDR All events received on in, after this event, are passed through, un-interpreted, to out.
EV-REQ-DISABL CMEVENT Changes the state of the output to disabled.
E HDR All events received by in after this event are buffered on the main queue and not sent out.
EV-FLUSH CMEVENT Move postponed events to the beginning of the main HDR queue and if enabled, send all events to out.
This event does not affect the enabledldisabled state of SEBP
EV_IDLE CMEVENT Remove a single event from the main queue and send it HDR to out. The return status is CMST OK or CMST NO ACTION.
This event does not affect the enabledldisabled state of SEBP.

Incoming Event Bus Notes EV RESET CMEVENT Empty the main and postpone queues (i.e., lose the HDR events).
This event does not affect the enabledldisabled state of SEBP.
DM SEBP has no outgoing events.
9.3. Special events, frames, commands or verbs None.
9.4. Properties Property "reset ev id" of type "UINT32". Note: Event ID that will reset DM
SEBP
before the event is forwarded or buffered. This is a redirected property.
10. Internal Definition l0 Fig. 1 1 1 illustrates the internal structure of the inventive DM-SEBP
part.
11. Functional Overview DM SEBP is an assembly whose behavior is built entirely, without specific code, by assembling DriverMagic library parts.
Events received at in pass through NFY1 and IEV1 to be enqueued in the main desynchronizer, DW11. If an EV-REQ-ENABLE event has been previously received at ctl, then IEV1 will generate EV-IDLE events to the event bus, which is parameterized to send the event out its dom terminal first. DW11 receives the EV IDLE event from the event bus, dequeues its events in response, and sends subsequent events out.
When the status returned from out is CMST POSTPONE, DSV interprets this status to mean the event was not serviced and sends the event to its out2 terminal, resulting in the event being enqueued in the postpone desynchronizer, DWI2.
The output is disabled when an EV REQ DISABLE event is received at ctl. The event is passed to IEV2, which passes this event to the event bus, which in turn passes it to IEV1, IEV2, and IEV3 at their idle terminals, disabling them. Any future events received at in will pass through NFY1 and IEV1 to DW11 to be buffered as before, but no EV_IDLE events will be generated by IEV1.
When an EV-REQ-ENABLE event is received at ctl, it is passed to IEV2, which is parameterized to forward it out its out terminal before sending EV-IDLE events out its idle terminal. The event passes to the main desynchronizer, DW11, and enables it.
IEV2 then generates EV-IDLE events out its idle terminal resulting in DWI1 sending each of its queued events out.
When an EV-FLUSH event is received at ctl, it is passed to IEV3, which is parameterized to forward it to its out terminal before sending EV IDLE events out its idle terminal. The event passes to NFY2, which recognizes it and generates an EV-REQ-DISABLE event resulting in MUX switching its output to out2. The EV-FLUSH event is then sent to IEV4, which generates EV-IDLE events causing DW11 to dequeue all of its buffered events. The dequeued events pass through MUX
and are subsequently enqueued in DWI2. IEV4 then passes the event to NFY3, which issues an EV-REQ-ENABLE event out its aux terminal to switch MUX's output back to out1. NFY3 then passes the EV-FLUSH to IEVS, which generates EV_IDLE
events and causes DW12 to dequeue all of its events into DW11. As a result, all prevously-postponed events are placed at the head of the queue in DW11. When the EV-FLUSH event returns to IEV3, If DM SEBP is enabled, IEV3 generates EV-IDLE
events to the event bus causing DWI1 to dequeue all of its events.
When DM-SEBP receives the event specified by its reset ev id property, NFY1 generates an EV-RESET event to the event bus, causing DWI1 and DWI2 to empty their queues before the event is passed on. If DM-SEBP is disabled, the event that generated the "reset" event will be enqueued in DWI1.
12. Subordinate's Responsibilities 12.1. CRT - Stackable Critical Section 1. Provide a common critical section for all the inputs to the assembly.
DM-SEBP is a pure assembly and has no guarded input operations of its own.

12.2. SPL - Event Splitter 1 . Filters out specified events' and send them out its aux terminal. All other events are sent out its out terminal.
12.3. NFY - Event Notifyier 2. Generates an event out aux when a specific event is received on in.
The input event is forwarded out out either before or after the genereated event is sent out aux.
12.4. IEV - Idle by Event 1. Generate EV IDLE events out its idle terminal in response to any event it receives on its in terminal, if enabled.
2. Provide the mechanism to enable and disable idle generation on EV-REQ XXX
events.
12.5. DWI - Desynchronizer with Idle Input 1. Implement an event queue that can be pumped with EV IDLE
events.
2. Clear the event queue on receipt of an EV-RESET event 12.6. BSP - Bi-directional Splitter 1. Provide plumbing to enable connection of a bi-directional terminal to an unidirectional input or output.
12.7. STP - Event Stopper 1. Terminate the event flow by returning a specified status (e.g., CMST OK).
12.8. MUX - Event-Controlled Multiplexer 1. Implements a switch between its out1 and out2 outputs that is controlled by event input on its ctl terminal.
12.9. DSV - Distributor for Service 1. Forwards incoming operation to out2 if the operation is not serviced by out1.
13. Distribution of Properties Property Distr. Subordinate Property Distr. Subordinate reset ev-id Redirecte nfy1.trigger ev d 14. Subordinate Parameterization Part Property Value crt1, attr CMCRT A NONE (default) crt2 s1 ret s CMST NOT SUPPORTED

s2, s3 ret s CMST OK

spl1 ev-min EV-RESET

ev max EV RESET

spl2 ev-min EV_IDLE

ev max EV IDLE

spl3 ev min EV REQ ENABLE

ev max EV REQ DISABLE

spl4 ev_min EV-FLUSH

ev max EV FLUSH

nfy1 trigger EV_NULL (exposed as reset ev-id) ev pre ev EV RESET

post ev EV-NULL

nfy2 trigger EV_FLUSH
ev pre ev EV-REQ-DISABLE

post ev EV NULL

nfy3 trigger EV-FLUSH
ev pre ev EV_REQ-ENABLE

post ev EV NULL

iev1 idle first FALSE

iev2 idle first FALSE

iev3 idle first FALSE

iev4 idle first TRUE

iev5 idle first TRUE

Part Property Value dwi queue sz 0 (default) disable idle req TRUE (default) evb sync TRUE
dom first TRUE
do preview FALSE (default) mux ev out1 EV REQ ENABLE
ev out2 EV REO. DISABLE
dsv hunt stat CMST POSTPONE
hunt if_match TRUE
15. Internal Interfaces All internal interfaces are of type I DRAIN.
16. Theory of operation 16.1. Mechanisms Event buffering DWI implements an event queue to buffer incoming events. Events buffered by DWI will be sent out out while it receives EV IDLE events. If the EV IDLE
events have been disabled, DWI will simply add any incoming events to its queue.
When the queue in DWI is empty, it will return CMST-NO ACTION, causing the l0 EV-IDLE generation to be stopped.
Idle generation All of the IEVx parts are responsible for generating EV-IDLE events for DM-SEBP.
IEV1 generates idle events in response to events received at DM SEBP's in terminal.
IEV2 generates idles events in response to the EV-REQ-ENABLE event being received at the ctl terminal. IEV3 generates idle events to empty DWI1's queue after an EV FLUSH event has been received on ctl. IEV4 generates idle events to move the contents of DWI2's queue to DW11 after an EV_FLUSH event, and IEV5 generates the idle events to move the contents of DW11's queue to the end of DWI2's queue after an EV FLUSH event has been received on ctl.

In all cases, all EV IDLE events are sent to the event bus for distribution.

receives the EV-IDLE events from the bus and sends any enqueued events out DM SEBP's out terminal in response. DW12 receives EV-IDLE events only from IEVS.
Idle generation control Idle generation is enabled or disabled on EV REQ ENABLE/DISABLE events received at DM SEBP's ctl terminal. When DM SEBP's output is disabled, an EV_REQ-DISABLE event is received at ctl that passes through IEV2 to the event bus where it is distributed to IEV1, IEV2, and IEV3, disabling all. No subsequent idle generation can occur. When an EV_REO.-ENABLE event is received at ctl, it passes through IEV2 to the event bus and is distributed to IEV1, IEV2 and IEV3's idle terminal, enabling all. When IEV2 receives control back from the event bus, it generates EV-IDLE events until DW11's queue is emptied and is shut off by DWI1 .
Any subsequent events received at DM SEBP's in terminal will be enqueued by DWI
and will start IEV1's EV_IDLE generator to dequeue the event just received by DW11, effectively passing it through.
Flushing Postponed Events When an EV-FLUSH event is received at ctl, it is passed through IEV3, which passes to IEV4 via NFY2. IEV4 generates EV-IDLE events until DW11's queue is emptied into DWI2's queue. The event is then passed to IEV5 which generates EV_IDLE events until DW12's queue is emptied back into DW11's (i.e. moving contents of DW12 in front of DW11 ). When IEV3 regains control, it generates EV_IDLE events, if it is enabled, to the event bus until DWI1's queue is emptied and is shut off by DWI1.
Postponing Operations When a forwarded event returns CMST POSTPONE, that event is enqueued onto DW12's queue until an EV FLUSH event is received on ctl. When the EV FLUSH
event is received, the contents of DWI2's queue are moved to the front of DWI1's queue and all events are sent out out if DM SEBP is enabled.
16.2. Use Cases Fig. 1 12 illustrates an advantageous use of the inventive DM SEBP part.

Preventing Re-entrancy When PART1 does not wish to receive events on in terminal while processing an event, it can disable its event input by sending an EV-REQ-DISABLE event out its ctl terminal. When PART1 is finished processing the event, it sends an EV REQ ENABLE event out its ctl terminal to re-enable its event input before returning.
Postponing Operations If PART1 is in a state where it cannot process certain events, it doesn't want them discarded, and it does not want to prevent further events from coming in, it can postpone delivery of those events by returning a CMST_POSTPONE status.
This causes DM SEBP to enqueue the event on its postpone queue. PART1 is able process the postponed events, it sends an EV-FLUSH event out its ctl terminal.
This causes DM SEBP to dequeue each of the postponed events one at a time and send them to PART1's in terminal.
DM ASB - Asymmetrical Synchronous Buffer Fig. 1 13 illustrates the boundary of the inventive DM ASB part.
DM ASB is an asymmetrical synchronous event buffer. Flow control is provided for events moving in the forward direction %e.g., from in to out). The flow of events out of out can be disabled by sending EV-REQ-ENABLE and EV-REQ_DISABLE
events to ctl. While disabled, events sent to DM ASB in the forward direction are buffered until the output is re-enabled.
All events sent to DM ASB in the reverse direction are immediately passed through without any buffering.

17. Boundary 17.1. Terminals Terminal "in" with direction "Bidir" and contract I DRAIN . Note: Forward event I/O terminal.
Terminal "out" with direction "Bidir" and contract I DRAIN. Note: Reverse event I/O
terminal.
Terminal "ctl" with direction "In" and contract I DRAIN . Note: Flow control.
Responds to EV-REQ-ENABLE and EV_REQ-DISABLE events in order to enable or disable the output.
17.2. Events and notifications Incoming Event Bus Notes EV_REa-ENAB CMEVENT- Changes the state of the output to enabled.
LE HDR All forward events are passed through, un-interpreted, to out.
EV-REQ-DISA CMEVENT- Changes the state of the output to disabled.
BLE HDR All forward events are buffered on an internal queue and not sent out.
DM ASB has no outgoing events.
17.3. Special events, frames, commands or verbs None.
17.4. Properties Property "reset ev-id" of type "UINT32". Note: Event ID that will reset DM ASB
before the event is forwarded or buffered. This is a redirected property.
18. Internal Definition Fig. 1 14 illustrates the internal structure of the inventive DM ASB part.
DM ASB is a pure assembly and has no functionality of its own. Refer to the DM SEB Data Sheet for a detailed functional overview of the event buffer.

19. Subordinate's Responsibilities 19.1. BSP - Bi-directional Splitter Split event flow between a single bi-directional interface and an input/output interface pair.
19.2. SEB - Synchronous Event Buffer See the description of DM SEB for a detailed functional overview of the event buffer.
DM ASBR, DM ASBR2 - Asymmetrical Synchronous Buffer for Requests Fig. 1 15 illustrates the boundary of the inventive DM ASBR2 part.
DM ASBR/DM ASBR2 are asymmetrical synchronous buffers for requests. Flow control is provided for requests moving in the forward direction /e.g., from in to out).
The flow of events out of out can be disabled by sending EV REa ENABLE and EV REQ DISABLE events to ctl. While disabled, requests sent to DM ASBR/DM ASBR2 in the forward direction are buffered until the output is re-enabled When DM ASBR/DM ASBR2 stores a request in self, it sends back status CMST PENDING. This status notifies the sender of the request that the request will be completed later by sending the same request back with CMEVT A-COMPLETED
attribute set.
DM ASBR/DM ASBR2 always completes the incoming requests with a completion event. If the part connected to out completes the event synchronously, DM ASBR/DM ASBR2 generates a completion event and returns CMST-PENDING.
DM ASBR/DM ASBR2 always use an incoming event - either from in or from ctl to send queued events to out.
All request completions sent in the reverse direction are immediately passed through without any buffering.
Note that DM ASBR/DM ASBR2 assumes without assertion that the CMEVT A ASYNC CPLT bit is set on incoming events.

DM ASBR2 should be used in all new designs. DM ASBR does not comply with the proper event completion disipline and is provided only for compatibility for older projects.
20. Boundary 20.1. Terminals Terminal "in" with direction "Bidir" and contract I DRAIN. Note: Forward event I/O
terminal.
Terminal "out" with direction "Bidir" and contract I DRAIN. Note: Reverse event I/O
to terminal.
Terminal "ctl" with direction "In" and contract I_DRAIN. Note: Flow control.
Accepts to EV REQ ENABLE and EV REQ DISABLE events in order to enable or disable the output.
20.2. Events and notifications The following events can be received on the ctl terminal:
Incoming Bus Notes Event EV REQ ENA CMEVENT Changes the state of the output to enabled.
BLE -HDR All forward events are passed through out.
..__.. __.__..._....___.._._--__-__...................._....__........._.......____..
.........._....._...___._.._................._._....__.__~._...................
_.__.._..____.___........ ............._._._.__.._...__...__._.. . .
EV-REQ-DISA CMEVENT Changes the state of the output to disabled.
BLE HDR All forward events are buffered on an internal queue and not sent out.
All events received on the in terminal are eventually forwarded to out. All events (typically request completions) received on the out terminal are immediately sent through the in terminal.
20.3. Special events, frames, commands or verbs None.

20.4. Properties (DM ASBR) Property "reset ev_id" of type "UINT32". Note: Event ID that will reset DM
ASBR
before the event is forwarded or buffered. Not available on DM ASBR2. Default is EV NULL.
Property "cplt s offs" of type "UINT32". Note: Offset in bytes of the completion status in the event bus. Mandatory.
21. Encapsulated interactions None.
22. Internal Definition (DM ASBR2) Fig. 1 16 illustrates the internal structure of the inventive DM ASBR2 part.
DM ASBR2 is an assembly that is built entirely out of DriverMagic library parts.
It comprises a "Fundamental Desynchronizer" (FDSY), which provides the event queue for the assembly; two "Idle Generator Driven by Event" (IEVx) that provide idle events to dequeue events buffered in FDSY; a "Stackable Critical Section"
(CRTx), which guards DM ASBR2's inputs, since it has no input operations of its own;
and an "Asynchronous Completer" (ACT) used to convert synchronous completions to asynchronous.
Events received at in pass through iev in to be enqueued in FDSY. If an EV_REQ-ENABLE event has been previously received at ctl, then iev in will generate EV IDLE events to the event bus, which is parameterized to send the event out its dom terminal first. FDSY receives the EV IDLE event from the event bus and de-queues its events in response.
The output is disabled when an EV-REQ_DISABLE event is received at ctl. iev ctl passes this event to the event bus, which in turn passes it to both iev in and iev ctl at their idle terminals, disabling them. Any future events received at in will pass through IEV1 to FDSY to be buffered as before, but no EV-IDLE events will be generated by iev in or iev ctl.

23. Subordinate's Responsibilities 23.1. DM BSP - Bi-directional Splitter 1 . Split event flow between a single bi-directional interface and an input/output interface pair.
23.2. DM ACT - Asynchronous Completer 1 . Transform synchronous completion of an outgoing event into asynchronous completion.
23.3. DM CRT - Stackable Critical Section 1. Provide a common critical section for all the inputs to the assembly.
DM ASBR2 is a pure assembly and has no guarded input operations of its own.
23.4. DM IEV - Idle by Event 1. Generate EV-IDLE events out its idle terminal in response to any event it receives on its in terminal, if enabled.
2. Provide the mechanism to enable and disable idle generation on EV REO. xxx events.
23.5. DM FDSY - Fundamental Desynchronizer 1. Implement an event desynchronizer which sends out queued events when it receives EV IDLE or EV PULSE on its control terminal.
2. Clear the event queue on receipt of an EV RESET event 23.6. DM SPL - Event Flow Splitter 1. Split the incoming event flow into a main flow and an auxilary flow.
23.7. DM DST - Drain Stopper 1. Consume all events received on its terminal.
24. Dominant's Responsibilities 24.1. Hard parameterization of subordinates Subordinate Property Value FDSY ok stat CMST PENDING
disable ctl req TRUE

Subordinate Property Value SPL ~~~" ev min EV REQ ENABLE ~ ~ -__-_.___._._..___ .._.____.__.._._....._.........._.._..._____..._._.....__.._._._._.._._.._.....
_...._____~.___.___.__...._._...................._.....__.._.__........._..-__..................__...._.__.....__........_...._._..._..._......_.._.....
ev max EV REQ DISABLE
_._ACT__.._._...__..__.._~...________enforce asyn~~...__ TRUE _.__-__...___.___.._.._..............._~__._...__........._......__.........__..._..
._....._..___ E V B ~~-.~~_....__.___ Sy n c _.-.__~...-._ T R U E .... .
____.__.__.__~_..__._....._- ___~ ____...__~_...__._...__~
dom first TRUE
24.2. Distribution of Properties to the Subordinates Property "cplt s offs" of type "UINT32". Note: redir act.cplt s offs 25. Theory of operation 25.1. Mechanisms Event buffering FDSY implements an 'event queue to buffer incoming events. Events buffered by FDSY will be sent out out when it receives EV IDLE events. If the EV IDLE
events have been disabled, FDSY will simply add any incoming events to its queue.
Idle generation Both iev-in and.iev ctl are responsible for generating EV-IDLE events for DM ASBR2. iev-in generates idle events in response to events received at DM ASBR2's in terminal and iev ctl generates idles events in response to the EV_REQ-ENABLE event being received at the ctl terminal. In either case, all EV-IDLE
events are sent to the event bus for distribution. FDSY receives the EV IDLE
events from the bus and sends any enqueued events out DM ASBR2's out terminal in response.
Idle generation control Idle generation is enabled or disabled on EV-REa xxx events received at DM ASBR2's ctl terminal. Both iev in and iev ctl must be parameterized to generate idle events after passing the input event through.
When DM ASBR2's output is disabled, an EV-REQ-DISABLE event is received at ctl that passes through iev ctl to the event bus where it is distributed to both iev-in and iev ctl, disabling both. No subsequent idle generation can occur.

When an EV-REQ-ENABLE event is received at ctl, it is passed through iev ctl to the event bus and is distributed to iev-in and iev ctl's idle terminal, enabling both.
When iev ctl receives control back from the event bus, it generates EV-IDLE
events until FDSY's queue is emptied and is shut off by FDSY. Any subsequent events received at DM ASBR2's in terminal will be enqueued by FDSY and will start iev-in's EV-IDLE generator to dequeue the event just received by FDSY, effectively passing it through.
26. Functional overview of the DM ASBR buffer Fig. 1 17 illustrates the internal structure of the inventive DM ASBR part.
Refer to the DM SEB Data Sheet for a detailed functional overview of the event buffer.
27. Subordinate's Responsibilities 27.1. DM BSP - Bi-directional Splitter Split event flow between a single bi-directional interface and an input/output interface pair.
27.2. DM ACT - Asynchronous Completer Transform synchronous completion of an outgoing event into asynchronous completion of the incoming event that generated the former.
27.3. DM ERC - Event Recoder Remap incoming event IDs and attributes and pass them out.
27.4. DM STX - Status Recoreder 1. Re-code the event processing return status s1 (from the out terminal) to s2 2. Forward all events received from the in terminal through the out terminal.
27.5. DM RPL - Event Replicator 1 . Pass all events coming on in to out 2. Duplicate events coming on in and send the duplicates to aux.

28. Dominant's Responsibilities 28.1. Hard parameterization of subordinates Part Property Value stx s1 CMST OK

_ __.._s 2 C~M S T P E N D I N G
_.._._._ -..._....._..._._.. ~_ __ __.

act enforce asyncFALSE

seta in base 0 out base 0 n events OxFFFFFFFF

or attr CMEVT A ASYNC CPLT

and attr ~ CMEVT A SELF OWNED

clra in base 0 out base 0 n events OxFFFFFFFF

or attr CMEVT A SELF OWNED

and attr ~ CMEVT A ASYNC CPLT

rpl s1 CMST PENDING
stx s2 CMST OK

rpl ret s CMST OK
stp 28. 2.
28.3. Distribution of Properties to the Subordinates Property Type Dist To Name reset ev id UINT32 redir seb.reset ev id ~P _~ .._.~_.................._.....___....____...
~_.._..______..._..........:..._.._.___.___ _._ It s -___.....___.__............_._~..
c It s offs UINT32 redir act.cp _ offs Interaction Serializers DM ESL - Event Seiializer Fig. 1 18 illustrates the boundary of the inventive DM-ESL part.
DM-ESL serializes a flow of IRP events whenever these events are processed asynchronously. DM-ESL does not send the next event through its output until the processing of the preceding one is complete.
While asynchronous events sent through the out terminal are being processed, the events, coming at the in terminal, are buffered until the completion event arrives at the back channel of out.
In case the completion of the output event is synchronous, the next event from the buffer (if any) is sent to out immediately and the same procedure is commenced.
Effectively, DM-ESL ensures that there is only one event sent to the out terminal that awaits completion. In the meantime all incoming events are buffered for further processing.
Note: This part cannot be used (fed) with events that are not allowed to complete asynchronously. If necessary, insert an instance of DM-RSB at the front, which will effectively eliminate this limitation. For more information, refer to the DM
RSB data sheet.
1. Boundary 1.1. Terminals Terminal "in" with direction "Plug" and contract I-DRAIN. Note: Incoming IRP
events (EV REQ IRP). The back channel of this terminal is used for completion events only. Can be connected at Active Time.
Terminal "out" with direction "Plug" and contract I-DRAIN. Note: All events that are not processed are passed through here. The back channel receives the completion events (if completed asynchronouslyl.

1.2. Events and notifications passed through the "in" terminal Incoming Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
P needs processing.
Outgoing Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
P processing has completed.
This event is the same event that was processed asynchronously with CMEVT A COMPLET
ED attribute set.
1.3. Events and notifications passed through the "out" terminal Outgoing Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
P needs processing.

Incoming Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
P processing has completed.
This event usually is the same event as (or a copy of) the event that was processed asynchronously with CMEVT A COMPLET
ED attribute set.
1.4. Special events, frames, commands or verbs None.
1.5. Properties None.
2. Encapsulated interactions DM ESL is an assembly and does not have encapsulated interactions. Its subordinates, however, may have such depending on their implementation. For more information on the subordinates, please refer to the data sheets of:
l0 DM BSP
D M STX
DM ASB
DM EPP
DM ACT
3. Internal Definition Fig. 1 19 illustrates the internal structure of the inventive DM-ESL part.
4. Theory of operation DM_ESL is an assembly. It contains an asynchronous event buffer (DM ASB), Event Popper (DM-EPP) and Asynchronous Completer (DM ACT).

The parts in Block B implement the main functionality in this assembly - event buffering and serialization on completion.
DM-EPP disables (shuts off) the event flow coming to its in terminal after passing an event to out and awaits for an event to come on the back channel, upon which it enables the input flow again.
This procedure when used in conjunction with DM ASB (as shown above) ensures that incoming events are properly buffered during the processing of the event.
Parts in Block A and DM ACT condition/transform the bi-directional event flow, to ensure that the whole assembly operates normally. DM ACT transforms synchronously completed events on its out terminal into events completed asynchronously on the in terminal.
The purpose of Block A is to recode the event distribution status returned by the in terminal of DM ASB into CMST-PENDING for the purposes of asynchronous event completion.
For more details on DM ASB, DM ACT and DM EPP, refer to their data sheets.
4.1. Subordinate Parameterization Subordinat Property Value a STX s1 CMST OK
s2 CMST PENDING
ACT cplt s offs offsetof (B EV IRP, cplt s) DM RSL - Request Serializer ' Fig. 120 illustrates the boundary of the inventive DM-RSL part.
DM RSL is a serializer for asynchronous requests. It is used in cases where it is necessary to guarantee that a server of asynchronous requests is not going to receive a new request until it has completed the previous one.

DM-RSL is limited to serializing a single type of requests, the request type (event ID) that it accepts is programmable through a property. The inputs of DM RSL
are callable only in normal thread time. A caller's thread may be blocked if another thread has already entered the assembly. Since DM-RSL may call its outputs while its critical section is acquired, the possibility of deadlocks should be considered when using this part - see the Specification section below for details.
DM RSL is an assembly made entirely of standard DriverMagic library parts, as shown on the diagram. It may be used in any operating environment supported by DriverMagic. The Specification section below describes in detail the operation of l0 DM RSL.
5. Boundary 5.1. Terminals Terminal "in" with direction "i/o" and contract I DRAIN. Note: Request input.
Requests on this input may arrive in any order, whether or not previous requests have been completed. All requests sent to this input must have the event ID
specified by the evt id property and must be desynchronizable - i.e., they should have the CMEVT A ASYNC CPLT attribute set and should not be allocated on the stack.
Note that a side effect of the operation of DM-RSY is that all requests submitted to in complete asynchronously.
Terminal "out" with direction "i/o" and contract I DRAIN. Note: Serialized request output. Requests received from in are sent to out one by one, a second request is not sent until the previous one has completed.
5.2. Properties Property "evt id" of type "uint32". Note: Specifies the value of the id field of the requests sent to in..Note that requests with a different ID or other events should not be sent to DM RSL's in terminal. Default value: EV REQ IRP
Property "cplt s offs" of type "uint32". Note: Specifies the offset in the request bus where the completion status is stored. Default value: offsetof(B-EV-IRP, cplt s).

6. Encapsulated interactions None.
7. Specification Fig. 121 illustrates the internal structure of the inventive DM-RSL part.
8. Responsibilities Serialize asynchronous requests coming on the in terminal and forward them to out, so that a part attached to out does not receive more than one request at a time.
Use a queue to store additional requests, while one is pending on the out terminal.
9. Theory of operation The state of DM-RSL is kept by the DM MUX part:
ON state (this is the initial state) - DM MUX has out1 enabled; this state represents tha case when there are no pending requests being processed by the part connected to DM RSL's out terminal. A request that comes to in in this state is forwarded directly to out.
OFF state - DM MUX has out2 enabled; this state represents the case when there is a pending request. In, this state, new requests that come to in are queued by DM RSL in the DM FDSY part.
The operation of DM-RSL is illustrated by the following two cases.
9.1. Case 1: requests come on the in terminal in sequence The first request that enters DM-RSL comes when the assembly is in the ON
state - the request bypasses the DM FDSY queue and is forwarded to out.
On its way it passes through the OFF event generator - DM NFY, programmed to emit an EV-REQ-DISABLE event, which causes DM-MUX to switch to out2 (DM RSL enters the OFF state).
The completion of the request goes through the "completed" event generator -DM-NFY, programmed to emit an EV-PULSE event after the request completion has been sent back to DM RSL's in terminal. The EV PULSE event goes first through the ON event generator that sends an EV-REQ-ENABLE to the DM-MUX, switching it back to the ON state, and then goes to the queue (DM FDSY). Since there are no requests queued the latter has no effect.
Now DM-RSL has returned to its original state and can process the next incoming request in the same manner.
9.2. Case 2: new requests come on the in terminal before the first one has completed When the first request comes, the events that take place in DM RSL are the same as described in the 1 S' step in Case 1 above.
When a second request comes on in before the first one has completed, l0 DM RSL is in its OFF state - DM MUX has its out2 opened, so the incoming request is enqueued in DM-FDSY and CMST-PENDING is returned to the client.
If more requests come before the first one has completed, they are enqueued as well.
When the completion of the request comes on out (or is generated by DM ACT), it goes through the "completed" event generator - DM-NFY, programmed to emit an EV-PULSE event after the request completion has been sent back to DM-RSL's in terminal. The EV-PULSE event goes first through the ON event generator that sends an EV-REQ_ENABLE to the DM-MUX, switching it back to the ON state, and then goes to the queue (DM FDSY). DM FDSY dequeues one request and sends it out.
The dequeued request immediately switches DM-RSL back to its OFF state.
The above two steps are repeated until there are no more requests in the queue.
The completion of the last request switches DM-RSL to its ON state, exactly as in step #2 of Case 1 above. DM-RSL remains in this state until new requests come to the in terminal.
9.3. Critical Section Guard in DM RSL
The group of parts in DM-RSL that keeps its state (DM-MUX and DM-FDSY) is guarded by the two connected DM CRT parts, which act as a single critical section that surrounds this group. This is done to guarantee that the sequence of execution is always going to be as described in the two cases above, even if a second thread of execution enters DM RSL.
Note that the thread of execution that goes to the out terminal always owns DM-RSL's critical section. DM-RSL calls out in' the following two different situations, in both cases within its critical section:
with a request that came on in while DM RSL was in the ON state with a dequeued request when called on out with the completion of the previous request - in this case the part connected to out is re-entered in the same thread of execution that it used to send the previous reqeust's completion.
A request completion coming on out is forwarded to in first without entering DM-RSL's guard - see diagram. However, DM_RSL may call back in with a request completion while its guard is acquired if that completion happens in the thread of the original request (e.g., if the completion is generated by DM ACT).
10. Subordinate Parameterization Subordinate Property Value mux ev out1 EV REQ ENABLE

(DM MUX) ev out2 ' EV REQ DISABLE

_...._........._._____._......____........_.__-...-_.....__...-._...._....__...._...____..._...........-_ _.....________..................._._.._._ que disable ctl-reqTRUE

(DM FDSY) ok stat ' CMST
PENDING

_._.-......__.._._._..__............._......._.._....._..__..._-.._........._..__......_......._____..___.._.._-..._.............._.._.....__.......__..._....._.._........
off trigger ev EV- REQ-IRP

(DM NFY) pre ev DM REQ DISABLE

on ~~ trigger ev EV_ PULSE

(DM NFY) pre ev DM REa ENABLE

cplt ~ trigger ev EV- REO.-IRP
~~~ ~

(DM NFY) Subordinate Property Value post ev EV PULSE
....._.....-_..._..__......___...._................___-........___._....._....._._............._...._.-.__.___.................__._..._._._._.........__.............._.
act cplt s offs offsetof(B-EV-IRP,cp (DM ACT) It s) DM EPP - Event Popper Fig. 122 illustrates the boundary of the inventive DM-EPP part.
DM EPP is an IRP event popper. It uses an external flow control to disable and enable the incoming flow of events, so that there is only one IRP event, which awaits completion.
DM-EPP expects that all events sent through out will complete asynchronously.
Naturally, DM EPP also expects that the incoming events will be allowed to complete asynchronously. If any of these conditions are not satisfied, the proper operation of DM-EPP cannot be guaranteed3.
DM-EPP sends requests to enable or disable the event flow through the flw terminal and expects that the part connected there will always succeed to do that 11. Boundary 11.1. Terminals Terminal "in" with direction "Plug" and contract I-DRAIN. Note: Incoming IRP
events (EV REQ IRP). The back channel of this terminal is used for completion events only. Can be connected at Active Time.
Terminal "out" with direction "Plug" and contract I-DRAIN. Note: All events that are not processed are passed through here. The back channel receives the completion events (if completed asynchronously).
' This is not a serious limitation. Inserting DM_RSB and connecting its output to the in terminal will guarantee that asynchronous completion of the events is allowed; connecting DM_ACT to out will ensure that all events complete asynchronously.

11.2. Events and notifications passed through the "in" terminal Incoming Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
. P needs processing.
Outgoing Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
P processing has completed.
This event is the same event that was processed asynchronously with CMEVT A COMPLET
ED attribute set.
11.3. Events and notifications passed through the "out" terminal Outgoing Event Bus Notes EV REa IRP B EV IR Indicates that IRP
P needs processing.

Incoming Event Bus Notes EV REQ IRP B EV IR Indicates that IRP
P processing has completed.
This event usually is the same event as (or a copy of) the event that was processed asynchronously with CMEVT A COMPLET
ED attribute set.
11.4. Special events, frames, commands or verbs None.
11.5. Properties None.
12. Encapsulated interactions DM EPP is an assembly and does not have encapsulated interactions. Its subordinates, however, may have such depending on their implementation. For more information on the subordinates, please refer to the data sheets of:
DM BSP
DM STX
DM ASB
DM EPP
DM ACT
i5 13. Internal Definition Fig. 123 illustrates the internal structure of the inventive DM-EPP part.

14. Theory of operation DM-EPP is an assembly. It is based on parts included in the Advanced Part Library (APL). DM_EPP implements its functionality using two Notifiers (DM-NFY) connected as shown on the diagram.
The notifiers are parameterized to issue EV REQ DISABLE / EV REQ ENABLE
before (NrWa) or after (Nbck) event is received.
Each IRP event going in the forward direction causes Nfwd to issue EV REa DISABLE before the event is forwarded out.
This in turn disables the input flow until a completion event comes through the back channel of out terminal. The completion event will cause Nbck to issue EV REQ ENABLE after it passes it back to in.
15. Subordinate Parameterization Subordinat Property Value a Nfwd trigger ev EV_ REQ-IRP

pre ev EV REQDISABLE

Nbck trigger ev EV- REQ-IRP

post ev EV REQDISABLE

16. Use Cases 16.1. IRP event comes in The IRP event arrives at the in terminal, which is forwarded to the splitter 1 .
Splitter1 forwards it to Nfwd, which issues EV-REO._DISABLE before it passes the event out. EV-REQ-DISABLE is forwarded out through flw terminal, which in turn disables the input flow.
Nfwd finally sends the event out, which passing through splitter 2 is sent out through the out terminal. At this point DM-EPP expects that the event will be completed asynchronously and will wait for a completion event to come through the back channel if out.

16.2. Completion Event comes in When the completion event comes through the back channel of out terminal (even within the output operation to the out terminal), splitter 2 forwards it to Nbck.
Nbck first sends it out through the back channel of in terminal (passing splitter 1 ) and then issues EV-REQ-ENABLE, which gets forwarded out through the flw terminal. This last action restores the state of the input event flow.
Property Space Suport Property Exposers DM PEX - Property Exposer Fig. 124 illustrates the boundary of the inventive DM-PEX part.
DM PEX is a part that can be used to manipulate properties of the assembly it is included into. DM-PEX allows properties of the assembly to be manipulated through its prop terminal, making it convenient.
DM PEX does not have state. It redirects all the operations it implements to the assembly that contains it.
1. Boundary 1.1. Terminals Terminal "prop" with direction "In" and contract I A-PROP. Note: Direct access to properties of the assembly by name. The entity id is not used and must be 0.
1.2. Events and notifications None.
1.3. Special events, frames, commands or verbs None.
1.4. Properties None.
2. Encapsulated interactions None.

3. Specification 4. Responsibilities 23.Implement interface for manipulation of assembly's properties.
5. Theory of operation None.
5.1. State machine None.
5.2. Main data structures None.
5.3. Mechanisms Accessing properties of the host assembly Most parts don't need to know the OID of their host assembly /host, or parent assembly is the assembly in which a given part is created as subordinate).
DM_PEX needs to operate on its host assembly. DM-PEX identifies itself as part that has such need either by calling, an API function or by placing a specific value in its part descriptor.
DM-PEX can access the properties of the host assembly by using any mechanism. Two possible mechanisms are described below:
1. DM-PEX can obtain the OID of its host assembly by calling an API
function and then use the standard cm-prp get and cm-prp set, etc., property API functions.
DM PEX can obtain an internal, private interface to the host assembly. That private interface provides at least the property operations needed by DM PEX.
Property Containers DM VPC - Virtual Property Container Fig. 125 illustrates the boundary of the inventive DM VPC part.
DM VPC is a property container that provides storage and standard property services for virtual (dynamic) properties.
DM VPC implements all of the operations specified in the I A PROP interface and imposes the restriction that there be only one open property query at a time.

DM VPC provides support all of the standard DriverMagic property types and has no self-imposed restriction as to the size of the property value, provided there is enough system memory.
1. Boundary 1.1. Terminals Name Dir Contract Notes fac In I-PRPFA v-table, infinite cardinality, C synchronous This terminal is used to create, destroy, and reinitialize virtual properties.
.................................._..........._................................
............................._...........
........................................._........
...............................................................................
.............
prp In I A-PRO v-table, infinite cardinality, P synchronous This terminal is used to get, set, check and enumerate virtual properties in the container.
1.2. Events and notifications None.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "max container sz" of type "UINT32". Note: Specifies the maximum number of properties to store in the container. Set to 0 to indicate no limit.
Default:

2. Encapsulated interactions None.

3. Specification 4. Responsibilities 24. Maintain dynamic property container for virtual properties.
25. Provide property factory services on the property container.
26. Provide standard property operations for properties stored in the property container.
5. Theory of operation 5.1. Main data structures Property Container DM VPC uses the CIassMagic handle manager services to implement its property container. With each handle, DM VPC stores a pointer to a virtual property structure as context. Each virtual property structure contains information about a particular property.
5.2. Mechanisms Creating and destroying properties When DM VPC receives a request to create a new property, it first searches the container to ensure that the property doesn't already exist. DM VPC then creates a virtual property structure for the property, creates a handle and stores a pointer to the structure as a context.
When DM VPC receives a request to destroy a single property, it finds the property in the property container, frees the virtual property structure, and frees the handle. If the destroy operation specifies that all properties are to be destroyed, DM VPC enumerates the property container, freeing each virtual property structure and handle.
DM REP - Hierarchical Repository Fig. 126 illustrates the boundary of the inventive DM-REP part.
DM REP is a hierarchical repository with notifications. It implements a hierarchical data storage in memory. The repository provides functionality to store, query and retrieve data by hierarchical "data paths". The data paths are strings of up to 256 characters, which are constructed using identifiers and array indices (the terms used as defined by the C programming language). Both identifiers and indices are referred to as "pets" - short for "path element".
Data paths are constructed using no more than 16 pets, i.e. the total number of identifiers and indices in a valid data path cannot exceed 16. Each data path corresponds to a piece of data (data element) with a variable size. This data can be stored and retrieved through DM_REP terminals item and list.
DM_REP does not have a notion of data types; it supports variable size binary data only. However, for each data element, DM REP provides a 32-bit external context that can be manipulated in parallel with the data. This context is frequently used to store and retrieve identification of the actual data type.
DM_REP supports queries on the data paths (query terminal). The query criteria are defined using query strings. DM-REP supports up to 16 general queries simultaneously.
DM-REP supports serialization of the repository data to a binary file or the system registry (serialize terminal). It also supports deserialization from a binary file, system registry or INI file.
DM_REP also provides an interface for data path manipulation (dpath terminal).
This allows data paths to be joined together or split apart into "pels".
DM-REP generates notifications when a data item is changed, added or deleted.
All notifications are sent out through the nfy terminal. The notifications are sent with an event that describes which data path was affected.
This part is available only in Win32 User Mode environment.
6. Boundary 6.1. Terminals Terminal "item" with direction "In" and contract I ITEM. Note: v-table, infinite cardinality, active-time, synchronous. Repository data item manipulation.
Terminal "list" with direction "In" and contract I LIST. Note: v-table, infinite cardinality, active-time, synchronous. Repository data list manipulation.
Terminal "query" with direction "In" and contract I QUERY. Note: v-table, infinite cardinality, active-time, synchronous. Repository path queries.

Terminal "serialize" with direction "In" and contract I SERIAL. Note: v-table, infinite cardinality, active-time, synchronous. Repository serialization.
Terminal "death" with direction "In" and contract I DPATH. Note: v-table, infinite cardinality, active-time, synchronous. Repository path manipulation.
Terminal "nfy" with direction "Out" and contract I-DRAIN. Note: v-table, cardinality 1, floating, synchronous. All notifications from the repository are sent out through this terminal.
6.2. Events and notifications No incoming events.
Outgoing Event Bus Notes EV REP NFY DATA CHA EV REP This event is sent NGE out through the nfy terminal when a data item is changed,added, or deleted.
6.3. Special events, frames, commands or verbs None.
6.4. Properties None.
7. Encapsulated interactions None.
8. Specification 9. Responsibilities 1. Provide functionality for data storage and retrieval through item and list terminals.
2. Provide functionality for queries on the data path namespace.
3. Provide functionality for serialization of the repository to a file or the registry.
4. Provide functionality for deserialization of the repository from a file, registry, or INI file.

5. Provide functionality for data path manipulation.
6. Generate notifications through the nfy terminal when a data item is changed, added, or deleted.
10. Theory of operation 10.1. Data Path Syntax The data path syntax is very similar to the syntax for specifying data structures in programming languages like C. Here are a few examples of typical data paths:
customer[1 ].name Sensor. Value matrix[1 ][2][3]
10.2. INI File Structure (Deserialization) Here is the INI file structure expected on deserialization of the repository:
< data path > _ < context > [: { < data > ~ < fileref > } ]
The expression on the right side of the equal sign can be continued on a new line by placing backslash (\) on the incomplete line (like in C preprocessor).
Here are somewhat informal definitions of the items above:
< data > .. < datum > [, < data > ]
<datum> .._ {[-]<number>[~~S~BI ~ "<text>" ~ 'text'}
< fileref > :. _ @ < filename >
< context > :. < number >
<number> .. .<dec> ~ Ox<hex> ~ 0<oct>
Here is an example of an INI file demonstrating the syntax:
[rep data]
image.name - 1: "Sample"
image.author = 2: 'John Doe' image.size.x = 3: 640 image.size.y = 4: 480 cast[0] = 5: @c:\external.dat cast[Ol.alias = 6: "Conan"
cast[0].type = Ox7f: 'Barbarian' cast[0].data - 1: -2S, 24L, 2558, 'a text', \
"More text"
Here are the possible data types for numbers. If type is not explicitly specified with a suffix, the repository automatically assigns the smallest data type in which the value fits. Supported number suffixes:
S = Short 116 bit) L = Long (32 bit) B = Byte 18 bit) The difference between. strings with single quotes and strings with double quotes is that for double-quoted strings, the repository automatically includes a 0 to terminate the string. Single-quoted strings are stored as is, with the exact length and no terminator. To illustrate, the following two paths will contains the same values, of 5 bytes each:
customer[0].name - 1: "Name"
customer[1 ].name - 1: 'Name', 0 Finally, the < context > value in front of the colon sign is the value that will be associated with the data item. It can be obtained together with the item, using the I ITEM interface.
10.3. Binary File Structure The following is the binary structure of the DM-REP serialized image:
The header and footer signatures are as follows:
Header: Object Repository Data Format Version 2.0\r\n\x1 a Footer: \r\n[end]\r\n\x1 a 10.4. Mechanisms Data storagelretrieval through l ITEM interface Through the item terminal, single data paths are retrieved, set and deleted from the repository. The operations supported by item are get, set and remove.
The get operation retrieves the current value of the data path. The set operation sets the value of a data path. If the data path doesn't exist in the repository when setting data, it is created. The remove operation deletes the data item. from the repository.
The data path is either absolute or relative to a current item in a specified query.
All changes generate notifications through nfy.
Data storage/retrieval through. l LIST interface Through the list terminal, elements of data arrays are added to and removed from the repository. The operations supported are add and remove.
DM REP maintains arrays of data paths. The array consists of one or more data path names and indexes (e.g., customer[1 ], customer[1 ].name, customer[1].phone[0], etc.) When adding a new element to the array, the caller specifies only the base name (e.g., customer or customer[1 ].phone). DM REP
chooses the next available index for the data path. The data path is constructed by DM REP and returned to the caller for later reference.
It is possible for a data array to have missing elements. When an element is deleted, it is marked as available. Eventually through addition of new elements, the previously deleted elements are reused.
The index range supported by the repository is 0 to 16383.
The data path is either absolute or relative to a current item in a specified query.
All changes to a data path or its value will generate a data change notification through nfy. Unlike I-ITEM, when a data array item is removed, any items that are within its subtree are also removed.

Queries on the data path namespace DM-REP provides a way to query the data path namespace of the repository.
The data path namespace consists of all the existing data paths in the repository (single items and arrays).
DM-REP supports up to 16 data path queries simultaneously. The query criteria is defined with query strings constructed by the following rules:
1. Single question mark can replace a single path element (e.g. "a.?.b") 2. Asterisk can replace zero or more path elements /e.g. "a. ~" ") 3. There cannot be more than one asterisk in the query string (e.g. "*.~" is wrong) 4. Asterisk must be the last path element (e.g. "~".?", "a.~".b" are wrong) The query terminal is used to execute queries on the data path namespace. A
query must first be opened using the open operation. DM_REP supports a full set of query operations including get first, get-next, get_prev, get-last, and get curr.
Seriaiizationldeseriaiization of the repository DM-REP allows serialization of the repository to a binary file or the system registry. DM_REP allows deserialization of the repository from a binary file, system registry or an INI file.
Data item notifications DM-REP will generate events which are notifications that a data item was changed, added or deleted. This notification is called EV REP NFY DATA-CHANGE.
This notification is sent out of the nfy terminal.
The notification describes which data path was affected. Notifications are issued when a data path value is changed, or a data path is added or deleted to/from the repository.
The event that comes out through nfy can be distributed either synchronously or asynchronously. The event is self-owned and self-contained. Note that recipients of the event may need to free it; see I DRAIN and CMEVENT HDR for details.

10.5. Use Cases Working with the repository 1 . A new repository is created or is loaded from secondary storage using DM REP's serialize terminal.

2. The user adds/deletes data items or data item arrays using DM REP's item and list terminals.

3. The repository may be saved to secondary storage using DM-REP's serialize terminal.

Querying the repository 1 . A new repository is created or is loaded from secondary storage using DM REP's serialize terminal.

2. The user adds/deletes data items or data item arrays using DM REP's item and list terminals.

3. The user opens a new query on the repository.

4. The data items are enumerated using DM_REP's query terminal (get first, get_next, get-last, get prev, get curry. The data items matching the query are returned by the operations.

5. The user closes the query on the repository.

6. The repository may be saved to secondary storage using DM_REP's serialize terminal.

Receiving repository notifications 1. A new repository is created or is loaded from secondary storage using DM REP's serialize terminal.

2. The user adds/deletes data items or data item arrays using DM REP's item and list terminals.

3. For each change made in the previous step, the repository sends an EV REP NFY DATA CHANGE notification sent out through its nfy terminal (if connected), along with an event data describing the event and which data path was affected.

The recipient may check the data path and perform any operations it needs; at the end it frees the event (if the CMEVT A SELF OWNED attribute is set). See EV REP for details on the notification data.
Parameterizers DM PRM - Parameterizer (From Registry) Fig. 128 illustrates the boundary of the inventive DM_PRM part.
DM-PRM is a generic Registry-based parameterizer. This part can be used for parameterizing part instances in part arrays.
This part is available only in Windows NT/95/98 Kernel Mode environments.
Deserialization of the properties from the registry is triggered when the property with a particular name (specified by the reg prop name property on DM-PRM) is set through terminal i prp. The "trigger" property is expected to be of type CMPRP T UNICODEZ for Windows NT and CMPRP T ASCIZ for Windows 95/98 Kernel Modes. The value of the "trigger" property is the actual path from which the deserialization is performed.
All other property operations on the i prp input are passed unchanged to o-prp.
This allows DM-PRM to be inserted between two parts connected through an I A-PROP interface. DM-PRM transparently passes all operations on its i fac input to o fac as well.
The event that triggers DM-PRM to begin serialization is a successful deactivation of a part performed through o fac terminal. On this event DM-PRM updates the registry.
1. Boundary 1.1. Terminals Terminal "i-prp" with direction "In" and contract I A-PROP. Note: Input part array property interface. All operations are passed transparently to o prp.
Terminal "o-prp" with direction "Out" and contract I A-PROP. Note: All property operations on the i-prp input are passed transparently to this output.
Terminal "i fac" with direction "In" and contract I A-FACT. Note: Input part array factory interface. All operations are passed transparently to o fac.

Terminal "o fac" with direction "Out" and contract I A FACT. Note: Calls to i fac are passed to this output. DM-PRM assumes that the array that is connected to this output is the same as the one connected to the o-prp output. This output may remain unconnected if i fac terminal is not connected (floating).
1.2. Events and notifications None.
1.3. Special events, frames, commands or verbs None 1.4. Properties Property "reg prop name" of type "ASCIZ". Note: Name of property to monitor on i prp.set operations. The default vale is "reg-root"
Property "reg hive" of type "UINT32". Note: A registry key to use as the root for all registry operations. The default value is NULL (absolute) for Windows NT and HKEY LOCAL MACHINE for Windows 95/98 Kernel Mode environments.
Property "enforce out prop" of type "UINT32". Note: Ensure that the o-prp.set operation on the property specified by reg prop-name is successful. The default value is FALSE.
Property "reg_path suffix" of type "UNICODE". Note: Sub-path to be added to value set on reg-prop-name when reading/setting values in the registry. This value is also removed from the property value when a i-prp.get operation is invoked for the property specified by reg-prop-name. The default value is "".
Property "serialize" of type "UINT32". Note: Serialize properties when I A FACT.deactivate received. The default value is FALSE.
Property "ser query" of type "ASCIZ". Note: Query string to use when serializing properties. The default value is "~ ".
Property "ser attr_mask" of type "UINT32". Note: Attribute mask to use when performing query operation to serialize properties. The default value is CMPRP A PERSIST.

Property "ser attr val" of type "UINT32". Note: Attribute value to use when performing query operation to serialize properties. The default value is CMPRP A PERSIST.
Property "ser existing only" of type "UINT32". Note: Serialize only those properties that already exist in the registry. The default value is FALSE.
Property "buf sz" of type "UINT32". Note: Initial size fin bytes] of buffer to allocate for reading values from the registry. The default value is 512 bytes. This value is treated as a lower limit - DM-PRM may round it up and allocate more memory if the given value is too small.
Property "buf-realloc" of type "UINT32". Note: Reallocate buffer if it becomes too small. The default value is TRUE.
2. Encapsulated interactions DM-PRM uses the Windows NT/95/98 Kernel Mode Registry API.
3. Specification 4. Responsibilities 1. Deserialize properties when the property specified by reg_prop name is set through DM-PRM's i-prp input.
2. Serialize properties after a successful o fac.deactivate call if serialization is enabled.
3. Map or convert between registry data types and CIassMagic property value types.
4. Pass all operations from i-prp to o-prp.
5. Pass all operations from i fac to o fac.
5. Theory of operation 5.1. State machine None.
5.2. Main data structures None.

5.3. Mechanisms Deserialization of properties When DM_PRM receives a call on its i prp.set operation, it checks if the property being set matches the name specified by its reg prop_name property. If the property matches, DM_PRM forms a registry path from the property value and its reg-path suffix property. DM-PRM opens the registry key; enumerates its values, and for each value found, validates that the property types are compatible between CIassMagic and the registry, and invokes its o_prp.set output if the types are compatible. If the property types are not compatible, DM-PRM logs an error message and does not set the property. When all values have been enumerated, DM-PRM then forwards the original i-prp.set operation with the added suffix, to its o prp output.
The following table describes the valid CIassMagic property type for each registry type in Windows NT Kernel Mode environment:
Registry Valid Type CIassMagic Property types) REG DWORD or CMPRP UINT32 or T

EN T

DIAN

REG SZ or CMPRP
T ASCIZ
or REG EXPAND SZ CMPRP UNICODEZ
T

REG DWORD BIG ENDIACMPRP BINARY
T

N

REG BINARY CMPRP MBCSZ, T

CMPRP BINARY, T

CMPRP UCHAR
T

REG MULTI SZ, CMPRP BINARY
T

REG LINK, or REG RESOURCE LIST

The same for Windows 95/98 Kernel Mode environment:
Registry Type Valid CIassMagic Property types) REG DWORD or CMPRP T UINT32 or N
REG SZ or REG EXPAND CMPRP ASCIZ
SZ T

REG DWORD BIG ENDIAN CMPRP BINARY
T

REG BINARY CMPRP UNICODEZ, T

' CMPRP MBCSZ, T

CMPRP BINARY, T

CMPRP UCHAR
T

REG MULTI SZ, REG LINK,CMPRP BINARY
T

or RE G RESOURCE LIST

Serialization of properties When DM PRM receives a call on its l fac.deactivate operation, it first forwards the call out its o fac output. If the call is successful and DM PRM's serialize property has been set to TRUE, DM-PRM calls o_prp.get with its reg-prop-name property to retrieve the Registry path that was set. It then opens the Registry key and opens a query on its o-prp output based upon its ser query, ser attr mask, and ser attr val properties.
For each property that is returned, DM-PRM first validates that the types are compatible between CIassMagic and the Registry. If the types are compatible, DM-PRM saves the value in the registry using the current registry type. If the types are not compatible, DM-PRM logs an error message, and saves the value in the registry with a preferred type based upon the property value. The table below describes the valid registry types, and the preferred registry type for each CIassMagic type. If the property does not currently exist in the registry, DM PRM saves the value with the preferred registry type.
If DM-PRM's ser existing only property is set to TRUE, DM_PRM will save only those properties that currently exist in the Registry. The mapping between property types is described in the following tables.
For Windows NT Kernel Mode environment:
CIassMagic Valid Registry Types Preferred Type Registry Type CMPRP T UINT REG DWORD or REG DWORD
32 or REG DWORD LITTLE
CMPRP T SINT ENDIAN

CMPRP T ASCI REG SZ or REG SZ
Z or REG EXPAND SZ
CMPRP T UNIC
ODEZ
CMPRP T UCH REG BINARY REG BINARY
AR or CMPRP T MBC
SZ
CMPRP T BINA REG BINARY, REG BINARY
RY REG DWORD BIG EN
DIAN, REG LINK, REG RESOURCE LIST
or REG MULTI SZ
For Windows 95/98 Kernel Mode environment:
l0 CIassMagic Type Valid Registry Types Preferred Registry Type CMPRP T UINT3 REG DWORD or REG DWOR
2 or REG DWORD LITTLE E D

CMPRP ASCIZ REG SZ or REG SZ
T

REG EXPAND SZ

CMPRP UCHA REG BINARY REG BINAR
T

R, Y

CMPRP UNICO
T

DEZ, or CMPRP MBCS
T

Z

CMPRP BINAR REG BINARY, REG BINAR
T

Y REG DWORD BIG END Y

IAN, REG LINK, REG RESOURCE LIST, or REG MULTI SZ

DM PRM transparently passes all other calls on its i fac input to its o fac output.
Buffer allocation and reallocation DM-PRM allocates a data buffer upon activation to be used for retrieving property values from the registry or from a part. If any of the operations return ERROR_INSUFFIENT-BUFFER (registry API) or CMST OVERFLOW (CIassMagic), DM PRM will reallocate the buffer to the needed size as returned by the operation.
DM PRM frees the buffer when it is deactivated.

Handling other property operations (get, chk~
When DM-PRM receives a call on i-prp.chk, and the property name matches its reg-prop name, DM-PRM appends the value of, its reg-path suffix property to the incoming value before forwarding the operation.
When DM_PRM receives a call on i prp.get, and the property name matches its reg prop name, DM_PRM forwards the call to its o prp output and upon a successful return, strips the reg path suffix from the value before returning from the call.
All other operations on DM-PRM's i-prp input are passed transparently to DM-PRM's o_prp output.
to Serializers DM SER - Serializes (to registryl Fig. 129 illustrates the boundary of the inventive DM SER part.
DM SER is used to serialize a part's internal state (properties) to the system registry.
When DM SER receives a specific event from the in terminal (specified through a property), DM SER enumerates all the properties of_the part connected to the prp terminal and saves them to the registry. The serialization event received from in .is also passed through the out terminal.
DM-SER may be parameterized to serialize a part before or after the completion of the serialization event passed through out.
The events sent through out can be completed either synchronously or asynchronously - DM SER takes care of the proper completion and necessary cleanup.
Unrecognized events received on in or aux are passed out through the opposite terminal without modification. This enables DM-SER to be inserted in any event flow and provides greater flexibility.
This part is available only in Windows NT and Windows 95/98 Kernel Mode environments.

1. , Boundary 1.1. Terminals Terminal "in" with direction "Plug" and contract I DRAIN. Note: Synchronous, v-table, cardinality 1 This teminal receives the (ev serialize) event that serializes the part connected to the prp terminal. This event is also passed through the out terminal. All unrecognized events received from this terminal are passed out through aux without modification.
Terminal "out" with direction "Plug" and contract I DRAIN. Note: Synchronous, v-table, cardinality 1 DM-SER passes the serialization event (ev serialize) through this 1o terminal.
Terminal "prp" with direction "Out" and contract I A-PROP. Note: Synchronous, v-table, cardinality 1 Serialization terminal. DM SER uses this terminal to enumerate the properties of a part in order to serialize its state to the registry.
Terminal "aux" with direction "Plug" and contract I-DRAIN. Note: Synchronous, v-table, cardinality 1, floating Auxiliary terminal. All events received from this terminal are passed through in without modification. All unrecognized events received from in are passed out through aux without modification.
1.2. Events and notifications The following events are recognized on the in terminal:
Incoming Event Bus Notes (ev serialize) CMEVENT This event triggers HDR DM SER to serialize the state of the part connected to the prp terminal.

The following events are recognized on the out terminal:
Outgoing Event Bus Notes (ev serialize) CMEVENT This event is passed -HDR through the out terminal when received on the in terminal.
The order between sending this event and serialization is determined by the ser disc property.
This event may be processed synchronously or asynchronously.
(ev cleanup) CMEVENT This is the cleanup event _HDR that is sent through the out terminal if serialization fails.
This event may be processed synchronously or asynchronously.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "ev serialize" of type "UINT32". Note: Event ID of the serialization event received on the in terminal. When this event is received on in, DM SER
serializes the state of the part connected to the prp terminal. If EV-NULL, DM SER passes all events received on the in terminal out through the aux terminal. Default is EV
NULL.

Property "ev cleanup" of type "UINT32". Note: Event ID of the cleanup event sent through the out terminal if the serialization fails. If EV NULL, no cleanup event is sent through the out terminal. Default is EV_NULL.
Property "ser disc" of type "ASCIZ". Note: Distribution of the serialization event.
Can be one of the following values: fwd ignore - send serialization event through out first then serialize part's state. bwd-ignore - serialize part's state first then send serialization event through out. fwd cleanup - send serialization event through out first then serialize part's state. If serialization fails, send cleanup event through out.
See the Mechanism section for more information. Default is fwd-ignore.
Property "async cplt attr" of type "UINT32". Note: Value of the attribute that signifies that the serialization event received from in can be processed asynchronously. The default is: CMEVT A ASYNC CPLT
Property "cplt attr" of type "UINT32". Note: Value of the attribute that signifies that the processing of the serialization event passed through the out terminal has been completed. When the serialization event passed through out is processed asynchronously, the completion event passed back to DM SER is expected to have this attribute set. The default is: CMEVT A COMPLETED
Property "cplt s offs" of type "UINT32". Note: Offset in completion event bus for the completion status. The size of the storage must be at least sizeof (cmstat).
Default is OxOC. (first field in event bus after standard fields id, sz and attr) Property "reg-prop-name" of type "ASCIZ". Note: Name of the property that contains the registry path used to serialize a parts state. This property is expected to be of type UNICODE. Before serialization, DM_SER reads the value of this property (prp.get) and uses the value as the location to store the parts state in the registry.
Default is "reg-root".
Property "reg-hive" of type "UINT32". Note: A registry key to use as the root for registry serialization operations. The default value is NULL (absolute) for Windows NT/WDM and HKEY LOCAL MACHINE for Windows 95/98 (VxD) Kernel Mode environments.

Property "ser attr-mask" of type "UINT32". Note: Attribute mask to use when performing query operations to serialize properties. Default is CMPRP A
PERSIST.
Property "ser attr value" of type "UINT32". Note: Attribute value to use when performing query operations to serialize properties. Default is CMPRP A
PERSIST.
Property "ser existing only" of type "UINT32". Note: TRUE to serialize only those properties that already exist in the registry. Default is FALSE.
Property "buf sz" of type "UINT32". Note: Initial size fin bytesl of buffer to allocate for reading property values from the part connected to the prp terminal. This value is treated as a lower limit. DM SER may round it up and allocate more memory if the given value is too small. Default is 512 bytes.
Property "buf realloc" of type "UINT32". Note: TRUE to reallocate property value buffer if it becomes too small. Default is TRUE.
2. Encapsulated interactions DM PRM uses the Windows 95/98 and Windows NT Registry API (kernel-mode).
3. Internal Definition Fig. 130 illustrates the internal structure of the inventive DM-SER part.
4. Subordinate's Responsibilities 4.1. SEt3 - Event Sequencer Distribute incoming events received on in to the parts connected to the out1 and out2 terminals.
Allow both synchronous and asynchronous completion of the distributed events.
Pass all unrecognized events received on the in terminal through the aux terminal.
Pass all events received on the aux terminal through the in terminal.
4.2. BSP - Bi-directional Splitter Provide plumbing to enable connection of a bi-directional terminal to an unidirectional input or output.
4.3. ADP - Activation/Deactivation Adapter Convert deactivation events received on the evt terminal into fac.deactivate operation calls.

4.4. PRM - Parameterizer Serialize properties to the registry on a i fac.deactivate operation call.
Map or convert between registry data types and CIassMagic property types.
4.5. UST - Universal Stopper Stub all operations invoked through the in terminal and return CMST OK.
5. Distribution of Properties Property Distr. Subordinate ev serialize Group seq.ev[0].ev id ev serialize Group adp.ev deactivate ev cleanup Redirecteseq.ev[0].cleanup id d ser disc Redirecteseq.ev[0].disc d async cplt Redirecteseq.async cplt attr attr d cplt attr Redirecteseq.cplt attr d cplt s offs Redirecteseq.cplt s offs d reg_prop-name Redirecteprm.reg prop name d reg hive Redirecteprm.reg-hive d ser attr mask Redirecteprm.ser attr mask d ser attr val Redirecteprm.ser attr val d ser existing Redirecteprm.ser existing only only d Property Distr. Subordinate buf sz Redirecte prm.buf sz d buf_realloc Redirecte prm.buf realloc d 6.
7. Subordinate Parameterization Part Property Value adp pid ofs -1 prm serialize TRUE
ust in is drain FALSE
ust ret s CMST OK
8. Theory of operation 8.1. Mechanisms Serialization Event Distribution DM SER serializes a parts state when it receives an ev serialize event from the in terminal. The disciplines defined below are used to determine whether this serialization event is passed through the out terminal before or after the actual part serialization. They also determine whether serialization errors are considered and if a cleanup event should be sent through the out terminal.
The serialization disciplines defined below are specified through the ser disc property (ASCII strings):
fwd ignore: The serialization event is passed through the out terminal before DM SER serializes the part connected to the prp terminal. All errors are ignored.
bwd-ignore: The serialization event is passed through the out terminal after DM SER serializes the part connected to the prp terminal. All errors are ignored.

fwd cleanup: Same as fwd ignore except if the part serialization fails, DM SER sends the cleanup event ev cleanup through the out terminal.
The serialization failure status is propagated back to the original caller.
Serialization of properties When DM SER receives an ev serialize event from the in terminal, it first calls o-prp.get with its reg-prop-name property to retrieve the registry path of where to store the parts properties in the registry. It then opens the registry key and opens a query on its prp output based upon its ser attr_mask and ser attr val properties.
DM SER then enumerates all the properties of the part connected to the prp terminal.
If the property does not currently exist in the registry, DM SER saves the value with the preferred registry type. If the property does exist in the registry, DM SER
first validates that the types are compatible between CIassMagic and the registry. If the types are compatible, DM SER saves the.value in the registry using the registry type. If the types are not compatible, DM SER logs an error message, and saves the value in the registry with a preferred type based upon the property value. The table below describes the valid registry types, and the preferred registry type for each CIassMagic type.
If DM SER's ser existing only property is set to TRUE, DM SER will save only those properties that currently exist in the registry.
For Windows NT Kernel Mode/WDM environments:
CIassMagic Valid Registry TypesPreferred Type Registry Type CMPRP T UINT3 REG DWORD or REG DWOR

2 or REG DWORD LITTLE D
E

CIassMagic Valid Registry TypesPreferred Type Registry Type CMPRP T ASCIZ REG SZ or REG SZ

or REG EXPAND SZ

CMPRP T UNICO

DEZ

CMPRP T UCHA REG BINARY REG BINAR

R or Y

CMPRP T MBCS

Z

CMPRP T BINAR REG BINARY, REG BINAR

Y REG DWORD BIG END Y

IAN, REG LINK, REG RESOURCE LIST, or REG MULTI SZ

For Windows 95/98 VxD Kernel Mode environments:
CIassMagic Valid Registry TypesPreferred Type Registry Type CMPRP T UINT3 REG DWORD or REG DWOR

2 or REG DWORD LITTLE D
E

CMPRP T ASCIZ REG SZ or REG SZ

REG EXPAND SZ

CIassMagic Valid Registry Preferred Type Types Registry Type CMPRP UCHA REG BINARY REG BINAR
T

R, Y

CMPRP UNICO
T

DEZ, or CMPRP MBCS
T

Z

CMPRP BINAR REG BINARY, REG BINAR
T

Y REG DWORD BIG END Y

IAN, REG LINK, REG RESOURCE LIST, or REG MULTI SZ

Buffer allocation and reallocation DM SER allocates a data buffer upon activation to be used for retrieving property values from the registry or from a part. If any of the operations return ERROR-INSUFFIENT-BUFFER (registry API) or CMST OVERFLOW (CIassMagic), DM SER reallocates the buffer to the needed size as returned by the operation.
DM SER frees the buffer when it is deactivated.
DM SERADP - Activation/Deactivation Adaptor Fig. 131 illustrates the boundary of the inventive DM SERADP part.
DM SERADP is an adaptor that converts specific events received on the evt l0 terminal into fac.activate and fac.deactivate operation calls.
The activation and deactivation event IDs are specified as properties on DM SERADP. These events are always processed synchronously.
DM SERADP extracts the part ID that identifies the part to be activated/deactivated from the bus that comes with the event. The offset of the part ID storage is specified through a property.
DM-SERADP consumes all unrecognized events and returns CMST-OK.

9. Boundary 9.1. Terminals Terminal "evt" with direction "In" and contract I DRAIN. Note: Synchronous, v-table, infinite cardinality This terminal receives the (ev activate) and (ev deactivate) events which are converted into I A-FACT activate and deactivate operations (sent out through the fac terminal). This terminal is ungaurded.
Terminal "fac" with direction "Out" and contract I A-FACT. Note: Synchronous, v-table, cardinality 1 DM SERADP invokes the life-cycle operations activate and deactivate through this terminal when it receives the (ev activate) and l0 (ev deactivate) events from the evt terminal respectively.
9.2. Events and notifications Incoming Event Bus Notes (ev activate) CMEVENT_ Activate part.
HDR This event is converted into a activate operation call through the fac terminal.
This event is always processed synchronously.
(ev deactivate) CMEVENT- Deactivate part.
HDR This event is converted into a deactivate operation call through the fac terminal.
This event is always processed synchronously.
9.3.
9.4. Special events, frames, commands or verbs None.

9.5. Properties Property "ev activate" of type "UINT32". Note: ID of the event that is converted into a activate operation call through the fac terminal. If EV NULL, DM SERADP does not convert any events received on evt into fac.activate operation calls. In this case DM SERADP consumes the event and returns CMST OK. Default is EV NULL.
Property "ev deactivate" of type "UINT32". Note: ID of the event that is converted into a deactivate operation call through the fac terminal. If EV-NULL, DM-SERADP
does not convert any events received on evt into fac.deactivate operation calls. In this case DM SERADP consumes the event and returns CMST OK. Default is EV NULL.
Property "pid ofs" of type "UINT32". Note: Offset of the part ID in the event bus (specified in bytes). This ID identifies the part that needs to be activated or deactivated. DM SERADP,extracts the part ID from the event bus and passes it to the activate/deactivate operation on the fac terminal. The size of the part ID
storage is expected to be sizeof (DWORD). If -1, DM SERADP passes NO CMOID for the part ID. Default is OxOC (first field after the common event bus fields: sz, id and attr). ' 10. Encapsulated interactions None.
11. Specification 12. Responsibilities 1. Convert the (ev activate) event (received on the evt terminal) into a fac.activate operation call. Extract the part ID from the event bus and pass it with the call.
2. Convert the (ev deactivate) event (received on the evt terminal) into a fac.deactivate operation call. Extract the part ID from the event bus and pass it with the call.
3. Consume all unrecognized events received on the evt terminal and return CMST OK.

13. Theory of operation 13.1. Main data structures None.
13.2. Mechanisms Event to Life-cycle conversion DM SERADP converts the (ev activate) and (ev deactivate) events received on the evt terminal into fac.activate and fac.deactivate operation calls respectively.
Before invoking.the operation, DM-SERADP uses the pid ofs property to extract the part ID from the event bus. This ID is passed as an argument to the operation call - it identifies the part instance that should be activated or deactivated.
The return status of the part activation/deactivation is propagated back to the caller.
Property Interface Adaptors DM E2P - Event to Property Interface Converter Fig. 132 illustrates the boundary of the inventive DM-E2P part.
DM E2P converts EV PRP REQ events received on the evt terminal into operations of the I A-PROP interface and executes the operation synchronously.
It is assumed that EV PRP REO. can carry any operation of the property interface and that its bus is self-contained with possibly variable size, with the actual data value being the last field in the event bus. Please see E PROP.H for a detailed description of the EV PRP REQ event.
1. Boundary 1.1. Terminals Terminal "evt" with direction "In" and contract I DRAIN. Note: Process EV PRP
REQ
events. This terminal is ungaurded.
Terminal "prp" with direction "Out" and contract I A-PROP. Note: Request property operations. EV-PRP-REQ events received from the evt terminal are translated into property operations invoked through this terminal.

1.2. Events and notifications Incoming Event Bus Notes EV-PRP-REQ B-EV-PRP Request property operation.
1.3. Special events, frames, commands or verbs None.
1.4. Properties None.
2. Encapsulated interactions None.
3. Specification 4. Responsibilities l0 1 . Synchronously process EV-PRP-REa events by translating them into I A_PROP operations and invoking the operation out prp.
2. Refuse all other events.
3. Fill in the completion status of the event bus when the I A PROP
operation returns.
5. Theory of operation 5.1. State machine None.
5.2. Main data structures None.
5.3. Mechanisms Translation of EV PRP REQ into l A PROP operations When DM E2P receives an EV PRP REQ event, it determines the I A PROP
operation to call based on the opcode field of the B_EV-PRP bus. The translation is as follows:
PROP OP GET ~ get PROP OP SET ~ set PROP OP CHK -~ chk PROP OP-GET-INFO -~ get-info PROP- OP QRY OPEN ~ qry open PROP OP-QRY -CLOSE~ qry close PROP OP QRY FIRST ~ qry first PROP OP QRY -NEXT -~ qry next PROP OP QRY CURR ~ qry curr DM-E2P ses of e incoming B-EV-PRP bus to fill in u the th the fields for the fields B A PROP s tion and makes the call. When the bu without I A PROP
modifica operation returns, DM-E2P fills in the cplt s of the event bus with the return status and returns the same status as a return value.
DM P2E - Property to Event Adapter Fig. 133 illustrates the boundary of the inventive DM-P2E part.
DM-P2E is an adapter that converts the I A-PROP operations received on its input into EV PRP REa events, which are sent out its output. There is a one-to-one correspondence between the two interfaces. The events that DM-P2E generates are expected to be completed synchronously.
6. Boundary 6.1. Terminals Terminal "in" with direction "In" and contract I A-PROP. Note: Input for property operation requests. DM-P2E converts these requests into EV-PRP-REQ events and sends them out its out terminal.
Terminal "out" with direction "Out" and contract I DRAIN. Note: Output for synchronous EV PRP REO, events.

6.2. Events and notifications Outgoing Bus Notes Event EV PRP REa B EV PRP DM P2E sends this event out its out terminal in response to being invoked on its in terminal.
6.3. Special events, frames, commands or verbs None.
6.4. Properties None.
7. Encapsulated interactions None.
8. Specification 9. Responsibilities l0 3. Convert I A-PROP requests received on in to EV_PRP-REQ event requests and send them out the out terminal.
10. Theory of operation 10.1. State machine None.
10.2. Mechanisms None.
DM PSET and DM PSET8 - Property Setters Fig. 134 illustrates the boundary of the inventive DM-PSET part.
Fig. 135 illustrates the boundary of the inventive DM-PSET8 part.
DM PSET issues a property set request when it receives a trigger event on its input. The property name and type are given to DM-PSET as properties. DM-PSET
can also retrieve the value of the property from the event bus of the trigger event DM-PSET8 combines eight DM_PSETs to set up to eight properties on the trigger event. The parts have no state.

11. Boundary 11.1. Terminals Terminal "in" with direction "In" and contract I_DRAIN . Note: v-table, synchronous, infinite cardinality When the trigger event is received on this terminal, DM-PSET/DMPSET8 sends a property set request through the out terminal;
otherwise return CMST NOT SUPPORTED.
Terminal "out" with direction "Out" and contract I DRAIN . Note: v-table, synchronous, cardinality 1 Output for property set requests.
11.2. Events and notifications "out" terminal Outgoing Event Bus Notes EV-PROP REO. B-EV-PROP Request property set operation.
The event bus is dynamically allocated and has only the CMEVT A SYNC attribute set.
11,3y.......s.. ecial events ......frames... commands...or...verbs ..........................................
............................................. ... .. ...... . . .
........................... .....
p , , None.
11.4. Properties (DM PSET) Property "trigger" of type "UINT32". Note: Trigger event ID on which to set the property; 0 means any event. The default value is EV-PULSE.
Property "name" of type "ASCIZ". Note: Name of property to set; empty means don't set. The default value is "".
Property "type" of type "UINT32". Note: Type of property to set (CMPRP T XXX).
The default value is CMPRP T UINT32.
Property "value" of type "UINT32". Note: Value to set. For string and binary property types, 'value' should be set to a pointer to the string. This property is ACTIVETIME and the default value is 0. This property is used only if the offset property is -1.
Property "offset" of type "UINT32". Note: Offset of value in trigger event bus if the value is be retrieved from the bus. The default value is Oxfffffff (-1 ); do not retrieve value from bus; use the contents of the value property.

Property "by ref" of type "UINT32". Note: If TRUE, the value in the bus is by reference. If FALSE, the value is contained in the bus. Used only if offset is not -1.
The default value is FALSE.
Property "size" of type "UINT32". Note: Size of the property value [in bytes].
This property is used only for binary property types. The default value is 0.
11.5. Properties (DM PSETB) Property "trigger" of type "UINT32". Note: Trigger event ID on which to set the property; 0 means any event. The default value is EV-PULSE.
Property "p1.name ... p8.name" of type "ASCIZ". Note: Name of properties to set;
empty means don't set. The default value is ""
Property "p1.type ... p8.type" of type "UINT32". Note: Type of properties to set (CMPRP T XXX). The default value is CMPRP T UINT32.
Property "p1.value ... p8.value" of type "UINT32". Note: Values to set. For string and binary property types, 'value' should be set to a pointer to the string.
Each property is ACTIVETIME and the default value is 0. Each property is used only if the pX.offset property is -1.
Property "p1.offset ..: p8.offset" of type "UINT32". Note: Offset of value in trigger event bus if the value is be retrieved from the bus. The default value is Oxfffffff (-1 );
do not retrieve value from bus; use the contents of the value property.
Property "p1.by-ref ... p8.by-ref" of type "UINT32". Note: If TRUE, the value in the bus is by reference. If FALSE, the value is contained in the bus. Used only if pX.offset is not -1 . The default value is FALSE.
Property "p1.size ... p8.size" of type "UINT32". Note: Size of the property value [in bytes]. This property is used only for binary property types. The default value is 0.
12. Encapsulated interactions None.
13. Specification 14. Responsibilities 1. When trigger event is received, send EV-PROP-REQ event with CMEVT A-SYNC attribute set through the out terminal and return the status from the call. Note: DM-PSET8 returns the status of the first property operation; the status of the remaining operations is ignored.
2. Return CMST-NOT SUPPORTED for all unrecognized events.
15. Theory of operation 15.1. State machine None.
15.2. Mechanisms Determining property value When DM_PSET receives a trigger event, it looks at its offset property to l0 determine where from to retrieve the property value. If the offset property is Oxffffffff, then it retrieves the property value from its value property;
otherwise, it retrieves the value form the event bus.
Dereferencing values ('offset' not -7J
If the by ref property is FALSE, then the offset in the bus is treated as a byte location representing the first byte of the value. If the by_ref property is TRUE, then the offset is treated as a DWORD value that is converted into a pointer based on the property type.
Determining property size DM PSET determines the property size based on the property type and or its size property.
If the property type is CMPRP T-BINARY, the size property contains the value size, in bytes. The size property is only used for binary property types.
If the property type is CMPRP T-UINT32 or CMPRP T-SINT32, DM-PSET
assumes that the property size is 4.
If the property type is CMPRP T ASCIZ, CMPRP T-UNICODEZ, or CMPRP T-MBCSZ, the property size is the length of the string (in bytes) plus the terminating null character.
The CMPRP T UNICODEZ property type is not supported for VxD environment and the CMPRP T MBCSZ property type is only supported in W32 environment. All other types are supported in all environments.

15.3. Use Cases Property Value Latching The fact that the 'value' property is ACTIVETIME allows DM PSET to be used as a property value latch. The value may be set on DM PSET; and DM PSET will send it out when it receives the trigger event. Note: this usage is available only with UINT32 property type.
16. Dominant's Responsibilities (DM PSETB) 16.1. Hard Parameterization of Subordinates DM_PSET8 does not perform any hard parameterization of its subordinates.
16.2. Distribution of Properties to the Subordinates Property name Type Distr To trigger UINT32 bcast pX.trigger p1.name.. p8.name ASCIZ redir p1.name .. p8.name . .

p1.type. p8.type UINT32 redir p1.type p8.type .. ...

p1 .value.. p8.valueUINT32 redir p1.value . ...
p8.value p1.sizep8.size UINT32 redir p1.size p8.size ... ...

p1.offset... p8.offsetUINT32 redir p1.offset.. p8.offset .

p1.by ... p8.by UINT32 redir p1.by_ref... p8.by-ref ref ref Dynamic Container DM ARR - Part A~~ay DM ARR (hereinafter "the array"), is a part, which is a dynamic container for other parts. The set of parts can change dynamically at any time including when a DM ARR instance is active. Once added to the container, individual parts (called array elements or just elements) can be parameterized, connected or activated through specialized (controlling) terminals that DM ARR exposes.
Typical usage of the array is in an assembly (host) which maintains a dynamic set of parts of the same or similar classes. For example, in a device driver, all device instances can be maintained in a part array and the assembly can simply dispatch the input events to the proper instance.
The array utilizes the connection table of the host in order to establish connections to its elements. All connections to the array itself specified in that connection table are treated as connections to an element of the array and established when a~ new subordinate is added.
Fig. 136 illustrates the boundary of the inventive DM ARR part.
1.1. Key Benefits 1 . Connections to a dynamic set of parts can be specified in a static connection table and properly maintained. The benefit here is that having this static information eliminates the need of having code that maintains the same information.
2. Specialized parts can be developed that do most of the work pertinent to array elements creation, destruction, parameterization and connection, as well as dispatching, multiplexing and demultiplexing of connections, therefore eliminating the need to have this code in the host.
3. The one-to-many relationship and the dynamism of the structure are encapsulated into a single part. This allows restricting their proliferation into other portions of the design, which can become simpler.

1.2. More Information The elements of the array can be of different classes. The array supports a default class name, which will be used when new elements are added to create them. The creator has the option to override the default class name and supply a new one.
The array exposes properties and terminals of its elements at its own boundary, allowing the outer scope to connect to and parameterize them directly using the standard CIassMagic mechanisms available.
DM ARR implements a dynamic set of properties, which are synchronized l0 between all subordinates. This mechanism is analogous to the group property mechanism in CIassMagic. The difference is that in the array, the group is defined as all elements and changes whenever an element is added or removed. The storage for the property values is provided by the array.
1.3. Notes The connections to the array may be established to more than one element in the array. This means that terminals of objects outside the array that can be connected to terminals on the array land consecutively, to terminals of objects inside the array) have cardinality at least as high as the maximum number of objects that will be created in the array. As input-terminals normally have infinite cardinality, this note affects mostly outputs and bidirectional terminals. Such terminals are may be DriverMagic mux terminals or provide the required cardinality in another way.
The array acts on behalf its host for the purposes of memory allocation, connection table interpretation, etc. In order to accomplish this, the array is given an interface that allows the array to examine the connection table of its host assembly as well as the object identifiers of the specific part instances in this assembly. This allows the array to establish all described connections between a newly created element and parts in the host assembly, as those connections are described in the connection table of the host assembly. The way in which the array receives this information can be varied; different implementations are possible and are surely apparent to one skilled in the art to which the present invention pertains.

Specialized parts can be developed which, when connected to the controlling terminals, ensure the proper life cycle of the array elements. In this case the assembly needs to perform only instance dispatch. In most cases, even that can be avoided by having additional "dispatch" parts and a proper set of "interface adapter"
parts.
1.4. Usage DM ARR provides a special macro for easy inclusion of part array instances in the table of subordinates. To use this macro, include DM ARR.H header file after CMAGIC. H/CMAGIC. HPP.
l0 The syntax of this macro is described below.
array Description: Declares a subordinate of class DM ARR and hard-parameterizes this subordinate as necessary.
Syntax: array (name, dflt class, gen ids) Arguments: name name of the array; this name can be used to establish connections to/from the array dflt class default class name to use for new elements gen ids TRUE if the array is supposed to generate IDs for its elements; FALSE if the these are supplied from the outside Example: SUBORDINATES
part (P1, P1 CLASS) part (P2, P2 CLASS) part (controller, C CLASS) part (bus, CM_EVB) array (array, ELEMENT CLASS, CMARR GEN_KEYS) param (array, .repeated, "out2") param uint32 (array, prop1 , 5 ) END SUBORDINATES
CONNECTIONS
connect ( S, mux, array, in) connect (controller, fact, array, fact) connect IS, out, array, out2) connect (array, out1, P1, term) connect (array, nfy, bus, evt) END CONNECTIONS
Remarks: This macro is for use only within the table of subordinates.
Instead of using TRUE or FALSE as third argument, you can use CMARR GEN_KEYS or CMARR-USE_KEYS, which provide more meaningful record of how the array instance is used.
See Also: param, param xxx, connect The macro expands to a statement for a regular subordinate part in an assembly, specifying the class name of said subordinate as DM ARR. Here is the definition of the array macro:
#define arraylnm,cls,keys) \
part (nm, DM ARR) \
param (nm, . name , #nm ) param (nm, .class , #cls ) \
param (nm, .gen-keys, keys ) 2. Boundary 2.1. Terminals Terminal "fact" with direction "In" and contract I A FACT. Note: Subordinates factory. Allows creation, destruction, life cycle control and enumeration of subordinates.
Terminal "prop" with direction "In" and contract I A PROP. Note: Direct access to properties of subordinates by key.
Terminal "conn" with direction "In" and contract I A CONN. Note: Connections.
Allows connecting subordinates by key or name. Connection to/from terminals of the host are also possible.
2.2. Properties Property " sid" of type "UINT32". Note: Self ID of the host assembly. Used to retrieve information from the Radix (CIassMagic or DriverMagic) instance data including subordinates and connection tables. This property is mandatory.
Property " name" of type "ASCIZ". Note: Array instance name. This is the name of the array as known in the host. This property is mandatory.
Property ".auto activate" of type "BIN
(fixed size)". Note: Set to TRUE to make DM ARR automatically activate every new subordinate if it (DM ARR) is in active state. If FALSE, new subordinates can be activated explicitly, through the fact terminal. Default is FALSE.
Property ".class" of type "ASCIZ". Note: Default class name of the parts added to the array. Default means not specified. Default is "".
Property ".gen-keys" of type "BIN
(fixed size)". Note: Set to TRUE to make DM ARR generate keys for each part created in the part array. Set to FALSE to make DM ARR associate an externally provided key for each part created in the part array. This property is mandatory.
Property " fact" of type "ASCIZ". Note: Name of the subordinates factory terminal (1 A FACT) Default is "fact".
Property " prop" of type "ASCIZ". Note: Name of the subordinates property terminal (1 A PROP) Default is "prop".

Property " conn" of type "ASCIZ". Note: Name of the subordinates connections terminal (I A CONN) Default is "conn".
Property ".repeated" of type "ASCIZ". Note: Custom implemented property. Used to define the names of repeated (virtual) terminals visible at the boundary of the array.
Get operation is not supported. Check operation is supported and will determine if a terminal can be successfully added.
The properties . fact, . prop and . conn allow renaming of the controlling terminals of the array, so that an instance of the array can be created as an element in another instance of the array and its controlling terminals can be connected.
The property .repeated is a property that can be set multiple times. The array accumulates the values set in this property (instead of replacing the value with the last set value). The array preferably keeps a list of all values set in the .repeated property on its instance.
3. Responsibilities It is important to realize that a major portion of the functionality - and consequent benefit - of the array comes through functionality that the array provides on its component boundary, and not only the from the functionality the array exposes through its terminals.
In addition to the functionality made available through its controlling terminals (fact, prop, and conn), the array provides advantageous functionality on its component boundary. As a component in the DriverMagic component object model, the array receives requests to establish connections on its terminals, to get and set properties, to enumerate properties, to activate and deactivate itself, and many others. A responsibility of the array is to implement these operations in a way that allows the host assembly to view the array of dynamically changeable set of parts as a static part with terminals of multiple cardinality. Most of the advantageous functionality of the array is preferably provided through this boundary.
Another responsibility of the array is to provide all its mechanisms in a way that is independent of any specific part class that will be contained.
Additional responsibilities of the array include:

1. Maintain a dynamic set of parts (subordinates) which may change at all times.
2. Expose all terminals on subordinates as terminals on the array essentially maintaining a dynamic set of terminals.
3. Support a static set of properties for the purposes of regular parameterization.
Support one custom property for the purposes of defining virtual terminals.
4. Redirect all property operations for properties qualified with [ < key value in hex. or dec. > ] at the beginning to the respective subordinate identified by the key extracted from the name. Strip the qualifier before redirecting.
5. Support a dynamic set of virtual group properties, where the group is defined as all current and future subordinates. Create a new group property every time the outer scope attempts to set a new property on the array, which cannot be redirected.
6. Expose controlling terminals: factory for subordinates, connection of subordinates to other parts (incl. other subordinates) and manipulation of properties on subordinates by key. Support mechanism for renaming these terminals through properties.
7. Support virtual terminals for connecting to redirected or repeated outputs on the host. Use property mechanisms to define the names of these terminals.
Enforce that these terminals are simple outputs with cardinality 1.
8. Reject all connections to non-virtual terminals as NOP (no operation) if attempted from the array's outer scope. Establish manually all connections to a subordinate upon its creation using the information from the connection table in the host. Interpret connections to the array as connections to the subordinates.
4. Theory of operation DM ARR maintains a dynamic set of subordinates preferably using the available Part Array API in the CIassMagic engine. All functionality pertinent to the maintenance and operation of this set is delegated to this entity. The part array API
provides a simple means for holding a number of part instances, creating and destroying them dynamically, and performing connection and property operations on them. All that it does is keep a list (or array) of part object identifiers (oid) for created objects, and when an operation is requested, the part array API locates the specific part instance and forwards the operation to the normal CIassMagic API (or component model API as it may be the case in other systems). The functionality of the part array API is documented in detail the CIassMagic and DriverMagic Reference manuals. Implementations of said API or implementing DM ARR without using this API is surely apparent to one skilled in the art to which the present invention pertains.
DM ARR adds value to this functionality primarily by making possible to access terminals and properties of these subordinates as if they were terminals and properties on the DM ARR itself, and by automatically establishing all connections described in the connection table of the host between elements of the array and other parts in the assembly. This allows a dynamic set of subordinates to be included as a static part in an assembly (by inserting DM ARR in place of the dynamic set and connecting it with all the connections that would be required from each element of the dynamic set).
In addition DM ARR provides specialized terminals for programmatic control of the Part Array container (controlling terminals). The implementation of these terminals essentially is delegated to the Part Array entity as well.
DM ARR implements the following basic mechanisms in order to accomplish what it does.
4.1. Virtual Terminals Virtual terminals are simple output terminals with cardinality 1 exposed on the boundary of the DM ARR instance (the array). The purpose of these terminals is to collect the connection information when a connection to them is established.
This information is used to repeat the connection attempt (replicate) to all subordinates, current and future.
The set of such terminals is explicitly specified by the array's outer scope and is communicated to the array through properties. This set does not change throughout the life scope of an array instance. Virtual terminals cannot be removed until the instance is destroyed. The outer scope can establish the set of virtual terminals for a particular array instance through hard parameterization.
Connections to virtual terminals can be established at all times and these are replicated immediately to all currently existing subordinates. When a new subordinate is created, all currently established connections to all virtual terminals are attempted to this subordinate and if any of them fails for whatever reason, the subordinate creation fails as well.
Note that virtual terminals are only one of the types of terminals supported by the array on behalf of its elements. Another important feature supported by the array is l0 the ability to establish all connections for a newly created element, connecting the element to the same parts and terminals to which the array itself is described to be connected in the host assembly (excluding the array's controlling terminals fact, prop and conn).
4.2. Array Properties Properties defined as properties on the array itself are interpreted as private properties of the array and are not included in any mechanisms for. storage or distribution to subordinates. This also implies that their names are reserved for internal use of the array and cannot be used as names of group properties on the array. These names are intentionally prefixed with dot ".", to lower the possibility of name conflict.
One of the array properties has a completely custom implementation. This property is used to define the set of virtual terminals available on the array. Any attempt to set such property, upon success, will result in creating a new virtual terminal and this terminal will become immediately available for connections.
Operation get is not supported and will return CMST_NOT SUPPORTED. Operation chk will check if the addition of a new virtual terminal with that name is possible or not.
4.3. Virtual Properties Virtual Properties are a dynamic set of properties on the array, which are intended to be distributed to all subordinates whenever they become available. This set changes every time a new property is set on the array. The underlying mechanism for storage and distribution of the property values is the one found in a group property.
The values, and preferably, the types, of the virtual properties set by the outer scope are stored and remembered by the array and in the same time distributed to all currently existing subordinates the same way this is done with group properties.
When a new subordinate is created, all virtual properties that have been set in the life scope of the array (and currently remembered) are set on that subordinate ignoring any errors related to whether such property exists or not. If other errors occur, a warning is issued through the CIassMagic API for error medium access.
The get operation is equivalent to the get operation on a group property. -the value is retrieved from the storage in the array and no subordinates are involved in the process. Other methods of retrieving the value of the virtual property are possible (e.g., get the value of that property from the first subordinate, if said subordinate exists), and should be apparent to one skilled in the art to which the present invention pertains.
This mechanism in this embodiment of the array does not support UPCASE and RDONLY property attributes. Mandatory properties are not directly supported, however, if any of the subordinates has mandatory properties and these are not set before activation, the activation of the subordinate will fail and the proper diagnostic message will be logged in the checked versions of the CIassMagic engine.
4.4. Redirected Properties These are properties beginning with a key qualifier [ < key value in hex or dec. >
or [ < key value in hex. or dec. > ]. DM ARR simply strips the qualifier and redirects them to the proper subordinate essentially doing the same as any assembly would do. DM ARR uses the key value in the qualifier string to determine which subordinate to redirect to.
No storage is provided for such properties. DM ARR only acts as a redirector.

4.5. Enumeration of Properties As any other part, DM ARR presents a property namespace to the outer scope, preferably constructed in the following manner (and order):
1. All properties on the array itself excluding the custom ones (virtual terminals) and all properties starting with "-".
2. All virtual properties currently existing on the array. These are the properties set by the outer scope until before the particular enumeration operation was commenced. The property operations are protected - other execution contexts will be blocked or refused entry until the operation is complete.
l0 3. All properties of all subordinates in unspecified order. These are the properties beginning with a key qualifier [ < key value in hex. or dec. > ]..
5. Main data structures and other definitions 5.1. VPROP - Virtual property table entry // virtual property table entry typedef struct VPROP
char ~" namep; // name of the property uint16 type; // property data type void ~valp; // pointer to value 2o uint32 len; // length of the value } VPROP;
5.2. VTERM - Virtual terminal table entry' // virtual terminal table entry typedef struct VTERM
char name[MAX TERM NM SZ]; // virtual terminal name boot connected; // TRUE if terminal connected from outside byte conn ctx[CONN CTX SZ]; // connection context } VTERM;

5.3. CONN NDX - Connection Index typedef struct CONN NDX
hdl conn h; // connection handle VTERM ~"vtp; // virtual terminal instance ID (NULL if not virtual) boot left; // TRUE if the array terminal is on the left side // of the connection (as per get-info) } CONN-NDX;
to The DM ARR uses this structure to maintain the index entry for connection r-~
terminal map. Instances of this structure are allocated by the array and added to a handle set using the CIassMagic API.
No random access is needed to this index and for this reason the handle values associated with each instance of this structure are not stored anywhere. Only enumeration of these instances is possible which provided by the CIassMagic API for handle management.
5.4. S PROP O.RY - Enumeration states enum S PROP QRY
{
S PQ ARRAY, // array properties S-PQ VPROP, // virtual properties S-PQ SUBS, // properties of subordinates The property query state machine uses this enumerated type to determine the next state in the enumeration. Each state is associated with a class of properties currently being enumerated. As the array implements joined name spaces for these classes, the state is needed to identify the current one.

The transition is purely sequential in the order in' which these states are defined.
Backward enumeration of properties and therefore backward state transition are not possible.
5.5. PQ ARRAY - Property Query Context in the S-Pa ARRAY state typedef struct PQ ARRAY
f ctx enum ctx; // current property enum. ctx } PQ ARRAY;
This structure represents the property query context in S PQ ARRAY state. This is the state in which the properties listed on enumeration are these defined on the array itself, skipping properties whose names begin with " -".
5.6. PQ VPROP - Property Query Context in the S PQ VPROP state typedef struct PQ VPROP
ctx enum ctx; // current virt. prop. enum. ctx } PQ VPROP;
This structure represents the property query context in S-PQ VPROP state. This is the state in which the virtual properties are listed on enumeration.
The context is the one returned by the virtual property enumeration helper API.
5.7. PQ SUBS - Property Query Context in the S PQ SUBS state typedef struct PQ SUBS
f ctx enum ctx; // part array enumeration context boot curr 1 st; // TRUE to start from the first property dword curr oid; // current subordinate in the array ctx curr qryh; // query handle on current subordinate } PQ SUBS;
This structure represents the property query context in S PQ SUBS state. This is the state in which the properties of subordinates (elements) of the array are listed on enumeration.

Both the current subordinate and the property enumeration context on that subordinate are kept. There is also an indication whether the enumeration has to start from the first property of the current element or to continue from the current one.
5.8. PROP QRY - General Property Query Context typedef struct PROP-ORY
uint state; // enumeration state f1g32 attr-mask; // query attributes mask f1g32 attr val; // query attributes values union Pa-ENUM STATE // query state depending on the state PQ ARRAY array;
PQ VPROP vprop;
PQ SUBS subs;
};
} PROP-QRY;
This structure represents the composite property query instance. It combines the current state of property enumeration in a query instance together with the particular contexts for each individual state. It is assumed that there is no context shared between different states.
6. Self data structure (instance data) BEGIN SELF
DM ARR-HDR arr; // Part Array from DriverMagic VECON vtc; // virtual terminals container VECON vpc; // virtual properties container VTDST vtd; // virtual terminal operation distributor VPDST vpd; // virtual property operation distributor _hdl cnx; // connection index owner key -hdl qry; // queries owner key I_META *host imetap; // host meta-object interface // used to resolve subordinate name to oid I R ECON ~*iecnp; // connection enumeration interface // used to enumerate the connections in the host RDX CNM-DESC *'cdscp; // connection descriptor in the host PROPERTIES
RDX SID sid; // self ID of the host boot auto activate; // TRUE to auto-activate bool gen-keys; // TRUE to generate keys char name [RDX-MAX -PRT-NM-LEN + 1 ]; // array name char cls nm[RDX PRT NM LEN + 1 ); // default MAX class name char fact [RDX MAX TRM NM LEN + 1 ]; // 'fact' terminal name char -prop [RDX-MAXTRM-NM-LEN + 1 ]; // 'prop' terminal name char conn [RDX MAX TRM NM LEN + 1 ]; // 'conn' terminal name TERMINALS
decl input (fact, I A FACT) decl input (prop, I A PROP) decl input (conn, I A CONN) END SELF
7. State machine organization A state machine is used for property enumeration. The input events are three:
"reset", "next" and "current". The machine performs sequential state transition in the order in which the states are defined. Transition to initial state is possible at any state and will happen if "reset" event is received.
The input events are declared in the following enumerated type:
enum PQ EVENT
PQ EV RESET = 0, PQ EV NEXT - 1, PQ EV CURR = 2, };
All events are fed into a state machine controller - a static function responsible to invoke the proper action handler as defined in the state transition table. The action handler is responsible to perform the state transition before it returns to the controller.
The prototype of such action handler is shown bellow:
typedef stat pq ahdlr (PROP-O.RY '"sp, SELF *selfp, B-PROPERTY ~"bp);
The state machine event feeder (controller) prototype is shown here:
static stat pq sm feed (PROP QRY ~"sp, SELF *selfp, uint ev, B PROPERTY
'* bp);
The state transition table associates three action handlers for each state:
"reset", "next" and "current" action handlers.
typedef struct SM TBL ENTRY
pq ahdlr preset hdlrp;
pq ahdlr next-hdlrp;
pq ahdlr *curr-hdlrp;
} SM TBL-ENTRY;

State transition table:
static SM TBL_ENTRY g sm table [] _ /~" PQ EV RESET ~"/ /~* PQ EV NEXT ~*/ /~ PQ EV NEXT */
/~" S PQ ARRAY */ ah reset , ah arr next , ah arr curr , /~" S_PQ VPROP ~"/ ah-reset , ah vp next , ah vp curr , /~ S PQ SUBS ~"/ ah reset , ah subs next , ah subs curr , See the DM ARR part implementation design in Appendix 5 for more details on the described embodiment. Also see the Appendix 14 for the interfaces exposed by the DM ARR part.
8. Mechanisms This section contains a brief overview of some of the DM ARR mechanisms. For additional details on the preferred embodiment, see the appropriate Appendix.
Redirected Properties Operations on these properties are redirected (using the key value in the qualifier) to the respective subordinate in the Part Array entity. The determination whether or not to use this mechanism is based on the first character in the property name. If that character is "[", this mechanism is used, otherwise the property is considered virtual.
Property can also be considered virtual if the syntax of the qualifier is unrecognized. The only recognized syntax is. "[ < hex. or dec. value > ]" or "[ < hex. or dec. value>].". For example, "[abcd].prop" has unrecognized syntax and will not be considered redirected. Operations on properties with syntax "[*'].prop" are equivalent to operations on a virtual property "prop".
If a part with such key does not exist at the time of the property operation, the operation fails.

Virtual Group Properties DM ARR uses the handle manager provided by the engine to keep the set of virtual properties. The host memory allocator is used for all allocations including the property name and storage for the value.
Every time a new property is set, the set of virtual properties is enumerated using the owner key for this set and if this property was not found (was not previously set), it is added by allocating an instance of the VPROP data structure and associating it with a handle. All storage is allocated using allocation on behalf of the host. Get operation works off the storage retrieving the information directly from there.
Once a virtual property is added, the set of subordinates is enumerated and the property value is set to them as well. If the property is not found, this condition is ignored.
This mechanism works independently of the fact whether there are any subordinates or not. When new subordinate is created, the virtual property mechanism enumerates the set of all currently existing properties and attempts to set each of them to the new subordinate, following the same logic as for setting on existing ones.
In all cases warnings will be logged in case setting a property on a subordinate fails for any reason other than the property is not found. These warnings will appear only in checked versions of the engine.
Custom Property To properly maintain the virtual terminal mechanism, DM ARR uses a custom property implementation for one of its properties. The operation set on this property has the meaning of "create".
Every time this custom property is set, a new virtual terminal is created with name the property value supplied to the set operation. In case there is a duplicate and/or the creation of a virtual terminal fails for any reason, the set operation fails as well.

Operation chk on this property checks for duplicate name of a virtual terminal and fails if there is a duplicate.
Operation get on this property is not supported and returns ST NOT SUPPORTED.
This mechanism uses the Virtual Terminal mechanism to accomplish what it does.
Virtual Terminals Virtual terminals are maintained only for connections to redirected or repeated outputs on the host. These terminals are created though the operations on a special custom property on the array.
Virtual Terminal mechanism uses the handle manager provided in CIassMagic to maintain the set of virtual terminals existing on the particular instance of the array.
For each virtual terminal, a special control block is allocated which will contain the connection information (once this terminal is connected from the outside) and a handle is created and associated with this control block. The connection context upon creation is initialized to 0 the terminal is marked as unconnected.
When a virtual terminal is connected to, the mechanism stores the connection context supplied by the counter terminal into the storage provided in the control block, replicates the connection to all current subordinates and indicates that the connection was successful. At this point, the mechanism marks the terminal as connected.
When a subordinate is created, the mechanism enumerates all virtual terminals skipping the unconnected ones and repeats the connection to the subordinate supplying the connection context stored in the terminal on connect operation.
The mechanism uses the Connection Index to map connections to terminals.
Enumeration of properties On enumeration properties are given out in the following order:
1. Custom property values set on the array. The values are listed under the property name ".repeated" and all virtual terminals are given as values.
2. Other properties defined on the array in the order they are defined.
".repeated"
and " < xxx > " properties are skipped.

3. Virtual group properties in no particular order.
4. Properties from the namespaces of the subordinates prefixed by the array element qualifier: "[ < key value in hex. or dec. > ]" or "< key value in hex. or dec.
> ]."
depending on whether the subordinate property starts with "[" or not.
This mechanism keeps an enumeration state associated with each property query.
This state is kept in a PROP QRY structure described in section below.
The state transition is sequential in the order defined by the S PROP QRY
enumerated type. Any property enumeration operation can force a state transition to the next or previous state when the current subset of properties is exhausted.
Connection Index Connection Index mechanism facilitates fast connection of newly created subordinates. Essentially it provides a map between connections and terminals on the array including the virtual ones.
For each connection to the array specified in the connection table of the host assembly, the index entry contains the name of the array terminal, the enumeration context associated with the connection and the handle to a virtual terminal.
If the connection is not to a virtual terminal, the handle is 0.
This index is built during activation by enumerating the connection table and for each connection resolving the handle of the virtual terminal participating in that connection (if any).
Special care is taken to ensure that there is at most one connection to/from a virtual terminal as these terminals are assumed simple outputs with cardinality 1. If not, the array will not activate, will log an error and return ST_REFUSE.
The connection index uses the CONN NDX data structure described below.
This mechanism offers only enumeration interface to this table.
8.1. Use Cases Legitimate Connections The legitimate connections of interest are shown in Fig.137. The subordinates and connection tables will look like:

SUBORDINATES
part (P1, P1 CLASS) part (P2, P2 CLASS) part (controller, C CLASS) part (bus, CM-EVB) array (array, Part, CMARR GEN KEYS) param (array, ".repeated", "out2") END SUBORDINATES
CONNECTIONS
connect (S, mux, array, in) connect (controller, fact, array, fact) connect (S, out, array, out2) connect (array, out1, P1, term) connect (array, nfy, bus, evt) END SUBORDINATES
Step 1 . Subordinates in the Assembly dominant are created. When the ASSEMBLY dominant (the host) is created, CIassMagic creates instances of all parts specified in the subordinates' table including the array. The array class is DM ARR and this is hidden by the array declaration macro.
Step 2. Hard parameterization phase. Immediately after creation, CIassMagic performs hard parameterization of them using again the information in the subordinates' table. There is only one parameter set on the array ".repeated". CIassMagic will set this property with the value specified: out2.
As this is a special property (custom), this will trigger creation of a virtual terminal out2 which will be marked as "unconnected" at this time.
Step 3. Connection phase. The connection manager (CM) in CIassMagic will attempt to establish all connections as specified in the connection table including all connections toifrom the array. The array will return ST NOP on all of them except connections to/from out2 (#4) which is a virtual terminal.
The connection broker (CB), who will actually perform the connection protocol, will forward this status to the CM, who in turn will just ignore this ~ ' connection. When the connection to out2 terminal of the array is established, this time the Assembly will return the special ST-NOP indicating that this terminal cannot be connected at this time.
Step 4. Subordinate in the array gets created. It is assumed that the array is active at this time, if not the fact terminal will return ST NOT ACTIVE. Wheri , this happens the array will enumerate the Connection Index and for each index entry, will establish a connection between the new subordinate and the connection counterpart as specified in the connection table. The array resolves this counterpart by using get curr operation and the connection enumeration context in the index entry (the enumeration context, or index, was stored in the table when the connection index was constructed). For the cases when the connection is to a virtual terminal (handle is non-0), the array resolves this terminal using the handle from the index entry and checks if this terminal is connected from outside. If yes, the array replicates the connection to the virtual terminal using the connection data stored in the virtual terminal.
If this virtual terminal is not connected, it is skipped. For cases when the connection is not to a virtual terminal, the array establishes the connection.
Step 5. Connection to a virtual terminal is established. This may happen both at "active" or "inactive" time. The array gets the acquire and connect operations on its terminal interface implementation. It enumerates the virtual terminals in attempt to determine if that's a connection to a virtual terminal.
It does that by name comparison. On acquire the array basically does nothing, except to supply empty connection data. On connect, the terminal interface implementation stores the connection data into the virtual terminal storage (provided) and marks it as connected. The array replicates the just established connection to the virtual terminal to all of its elements using the name and connection data from the virtual terminal.
Contingencies Fig. 138 illustrates an advantageous use of the inventive DM ARR part.
Possible illegal connections of interest are shown in Fig. 138. Connection 1 and 2 are illegal as both contain redirected output that crosses the boundary of the host without connection multiplexing. Connection 3 is illegal because the terminal on the array to which it refers is not declared as ".repeated".
SUBORDINATES
array (array, Part, CMARR GEN-KEYS) param (array, ".repeated", "bidir") // here we forgot to include "out1" as ".repeated"
param (array, ".repeated", "out2") END SUBORDINATES
CONNECTIONS
connect ($, in, array, in) connect ($, bidir, array, bidir) connect (array, out1, $, out) connect (array, out2, $, out) END SUBORDINATES
This use case assumes that the instance of the array has been created and parameterized as indicated in the table of subordinates. The hard parameterization will create two virtual terminals bidir and out2: ' Step 1 . Establishing connections 1 and 2. The dominant (host) will attempt to establish these connections in the connection phase (see previous use case).
Connection 1 attempt will fail both on the host side and on the array side;
2 will fail only on the host side. The failures are indicated by returning status ST_NOP and these connections will be skipped by the Connection Manager (CM). In fact, no connections will be established at this time.
Step 2. Establishing connections by the host's outer scope. At some later time before activation, the host's outer scope may attempt to establish any of the connections shown on the above figure. The attempts will be delegated to the array by the host.
Connection 1 will be rejected by the array with status ST NOP (the host must recognize this and remap the status to ST REFUSE) as the in terminal is not a virtual one.
Connection 2 is not going to be rejected on the same basis; the array will attempt to update the virtual terminal bidir and will fail with ST REFUSE
because the directions are incompatible: the array would expect the counter terminal to be input.
Connection 3, when redirected from the repeated output on the host, will succeed connecting the out2 terminal, but will fail when out1 is attempted.
The failure will be return status ST NOP. This status will be treated as an error by the repeated output on the host and remapped to ST REFUSE so this connection will not be established.
The limitations described above pertain to the particular embodiment (based on the DriverMagic composition-based system) and are not inherent limitations of the present invention.
Passing information about the host assembly to DM ARR
The DM ARR receives a special value in its . sid property. This value is a pointer to an interface, which allows the array to obtain information sufficient to enumerate the connections in the host assembly and to be able to resolve the name of a subordinate part in the host assembly (as mentioned in the connection description table) to an object identifier (oid), used when requesting the establishing of connections.
In this particular embodiment, the information obtained by DM ARR includes:

~ a pointer to the connection descriptor of the host assembly (RDX CNM DESC);
~ a pointer to an interface for enumerating the connections in a connection descriptor 11 R ECON);
~ a pointer to the instance data of the host assembly, providing the ability to resolve the name of a subordinate part in the host assembly to an object ID (oid), using a service similar to the cm prt sub2oid() API function in DriverMagic.
For more information on the connection descriptor see Appendix 3.
RDX-CNM-DESC Structure. For more information on the interface for enumerating connection descriptors, see Appendix 4. I-R-ECON Interface. For more information on resolving subordinate name to oid, see the cm prt sub2oid API function in the C
Language Binding Reference for the CIassMagic Composition Engine [exact reference exists somewhere in the beginning of the text].
9. Details on mechanisms and helpers used in DM ARR
9.1. VECON - Virtual Entity Container The virtual entity container is used for holding the set of virtual properties and for holding the set of virtual terminals.
The following structure is the instance data of a container for virtual entities.
typedef struct VECON
hdl owner key; // owner key of the handle set CM OID oid; // memory owner uint32 off; // offset of name pointer } VECON;
The virtual entity container helper maintains a set of handles associated with an owner. The owner is kept on the owner key field. The oid field is used for ownership of the memory allocated by the helper. The memory allocation is performed on behalf of this object. The off field is used to calculate the pointer to the name of particular entity by a base pointer supplied on all entity operations.
For more details on the virtual entity container, see Appendix 6. VECON - Virtual Entity Container and Appendix 13. Interfaces Used by Described Mechanisms.
9.2. VPROP - Virtual Property Helper The virtual property helper is used to maintain data associated with a single instance of a virtual property. It uses the following structure to keep said data.
typedef struct VPROP
char ~*namep; // name of the property l0 uint16 type; // property data type void '"valp; // pointer to value uint32 len; // length of the value CM OID oid; // object to allocate on behalf of } VPROP;
The name of the property is kept by reference; the helper is responsible to allocate the storage. The same is valid for the value of the property. The name/value storage allocation happens at the same time when the virtual property is added (created) and therefore has the same life scope as the property itself.
The reason for this storage being allocated dynamically is that there is no explicit limit on the length of the property name. The same is valid for the property value.
The set of virtual properties is maintained by an instance of the VECON
virtual property container.
For more details on the virtual property helper, see Appendix 6. VECON -Virtual Property Container and Appendix 13. Interfaces Used by Described Mechanisms.
9.3. VPDST - Virtual Property Distributor The virtual property distributor is used to distribute the value of a virtual property to the current set of contained elements, when the array receives a request to set said virtual property (note that this request is typically received through the component boundary, not through the prop terminal).

The following structure is the instance data of a distributor of virtual property values.
typedef struct VPDST
DM ARR-HDR ~"arrp; // array instance CM OID oid; // object to allocate memory on behalf of } VPDST;
The arrp field is used to identify the Part Array instance as provided by CIassMagic. The oid field is used for ownership of the memory allocated by the helper. The memory allocation is performed on behalf of this object.
For more details on the virtual property helper, see Appendix 8. VPDST -Virtual Property Distributor and Appendix 13. Interfaces Used by Described Mechanisms.
9.4. VTERM - Virtual Terminal Helper The virtual property helper is used to maintain data associated with a single instance of a virtual terminal. It uses the following structure to keep said data.
typedef struct VTERM
char *~namep; // pointer to terminal name boot connected; // TRUE~if terminal connected byte conn ctx[CONN CTX SZ]; // connection context char name[MAX TERM NM SZ]; // virtual terminal name word sync; // synchronicity dword attr; // terminal attributes } VTERM;
The instance data contains the name of the terminal (fixed length), indication whether this terminal is connected and the connection data (context), synchronicity and attributes supplied by the counter terminal (if connected). The virtual entity container utilizes the pointer to the virtual terminal name (namep field).
For more information on the virtual terminal helper, see Appendix 9. VTERM -Virtual Terminal Helper and Appendix 13. Interfaces Used by Described Mechanisms.

This helper is preferably used in conjunction with VTRME and VTRMI mechanisms described below.
9.5. VTRME - Virtual Terminal Mechanism (Exterior) This mechanism is used to handle requests to establish and dissolve connections for virtual terminals when said requests are received on the outside boundary of the array (i.e., requests typically coming from the CIassMagic engine when establishing connections inside the host assembly). The VTRME mechanism uses the VTERM data structure described above.
For more information on the virtual terminal mechanism for exterior requests, see Appendix 10. VTRME - Virtual Terminal Mechanism (Exterior) and Appendix 13.
Interfaces Used by Described Mechanisms.
9.6. VTRMI - Virtual Terminal Mechanism (Interior) This mechanism is used to handle requests to establish and dissolve connections with virtual terminals of the array when said requests are received on the inside boundary of the array (i.e., requests typically coming from the CIassMagic engine when the array has requested the connection of a terminal of an element part to the virtual terminal). The VTRMI mechanism uses the VTERM data structure described above.
For more information on the virtual terminal mechanism for interior requests, see Appendix 11. VTRMI - Virtual Terminal Mechanism (Interior) and Appendix 13.
Interfaces Used by Described Mechanisms.
9.7. VTDST - Virtual Terminal Distributor This mechanism is used when a connection to virtual terminal is being established from outside of the array, to distribute the connection data to all present elements in the array.
The virtual terminal distributor uses the following data structure as instance data:
typedef struct VTDST
DM ARR-HDR ~"arrp; // array instance ID
CM OID oid; // object ID of the host } VTDST;
The arrp field is used to identify the Part Array instance as provided by CIassMagic. The oid field is used for ownership of the memory allocated by the helper. The memory allocation is performed. on behalf of this object.
For more information on the virtual terminal distributor, see Appendix 12.
VTDST
- Virtual Terminal Distributor and Appendix 13. Interfaces Used by Described Mechanisms.
10. Example Architecture Using Part Array This section provides an example of a driver architecture using the DM ARR
part l0 array. The array is used to contain a dynamic set of part instances, one per each individual device that is serviced by the driver.
The section consists of an architectural diagram, a functional overview, definition of principal entities (parts) and identification of specific interfaces between them.
This section is based on an actual driver, identified hereinafter as the MCP
Driver.
The architecture defined here, however, including the use of the part array and surrounding parts, is universal and can be used for virtually any device driver.
With insignificant modifications, apparent to the one skilled in the art, the same architecture and mechanisms can be used for a variety of other software components and systems, such' as COM and ActiveX controls, device drivers for other operating systems, application subsystems, operating system service, and many others.
10.1. Functional Description Driver Scope Fig. 139 illustrates a concentric view diagram of the MCP driver for Windows.
The top-level assembly (DRV) assembles the following parts: device factory (DM_FAC), device enumerator on registry (DM-REN), device parameterizer (DM-PRM), exception handler (DM_EXC) and part array (DM ARR) which manages device driver instances (DEVxxx).
The DRV assembly is created when the driver is loaded. It contains a device instance factory (DM-FAC) that is responsible for the creation, parameterization and destruction of all device instances (DEVxxx).

DM FAC utilizes DM REN to enumerate installed devices and to access the resources allocated for them. During the driver's initialization, DM REN is directed to read the list of devices configured in the registry. For each device found by DM-REN, DM-FAC creates a device instance in DM ARR and DM-PRM parameterizes it with settings found in the Registry sub-key for the particular device.
Device Scope The device instances DEVxxx created by DM_FAC implement the per-device functionality of the MCP driver. DEVxxx is a generic name for a set of classes; each class handles different communication media (xxx stands for the medium name;
for example, DEVSER is for serial devices (RS-232), DEVPAR is for parallel devices (IEEE-1284), DEVUSB is for Universal Serial Bus Devices). DM ARR is capable of creating any of those (and other) classes. The only requirement to the class is that it has terminals and properties as used by the DRV (which is the host assembly for DM ARR). For example, the particular DRV of the MCP driver relies to be able to connect to terminals called 'dio' and 'ext' on the boundary of DEVxxx.
DEVxxx is an assembly of two major components:
(1 ) The MCP core assembly, MCC, converts the application requests into application messages.
(2) The transport assembly, TRAxxx, which encapsulates the transport-specific functionality required to establish the communication channel with the device.
It is responsible for acquiring exclusive access to the communication driver; it also implements reliable communications protocol over the specified connection.
TRAxxx provides an OS-independent and error-free transparent interface to device. Due to a differences in the serial/parallel port API in the target operating systems, TRAxxx has different implementation for Windows NT and Windows 95/98.
Communications Protocol Core Scope The MCC assembly is common for all devices. It contains two major components:
(1 ) The front end assembly, IF-IFA, which conditions and dispatches the requests from the application according to their function.

(2) The session manager, SES, which is responsible for generating application message requests (from incoming event requests) and submitting them out. When the response to a previously issued request comes, the session manager satisfies the pending event. SES accepts the incoming device notifications: all notifications are buffered inside of SES and passed to the application upon request.
10.2. Definition of Entities - Driver Scope DRV - Driver DRV is the top level assembly of the driver framework. It assembles all the major components of the driver framework - DM FAC, DM-PRM, DM ARR, DM-REN and DM EXC.
DRV exposes a single I-DRAIN input through which it receives events from the driver packaging.
DM FAC - Device Factory DM-FAC registers the dispatch handlers required for Windows WDM kernel mode device drivers (1RP MJ xxx functions).
DM FAC handles all necessary interactions with the operating system in order to register device driver instances. It receives all the calls that WDM kernel mode device drivers must implement. DM-FAC dispatches these calls to the appropriate instance of the device driver (DEVxxx).
DM FAC uses the enumerator DM REN to determine how many and what device instances to create. DM FAC utilizes DM ARR to maintain the array of device instances.
In addition, DM FAC sends a command to the parameterizer DM PRM to read the device instance properties from the registry and configure the specified device instance with them.
DM-FAC is a DriverMagic library part provided with the Windows NT Driver Kit and WDM Driver Kit. Refer to the Object Dynamics' Windows NT Driver Kit Reference and WDM Driver Kit Reference documents for a complete description.

DM REN - Registry Enumerator DM-REN emulates device enumeration by reading the all sub-keys in the driver's Registry key (Parameters\Devices\xxxx) and using the data found in each as representing a device instance.
DM-REN is a DriverMagic library part. Refer to the Object Dynamics' DriverMagic User Manual for a complete description.
DM PRM - Parameterizer from the Registry DM-PRM reads the device settings from the registry and sends them to the device instance using property "set" requests on its o-prp output.
l0 DM-PRM is a DriverMagic library part. Refer to the part library reference in the DriverMagic User Manual for a complete description.
DM ARR - Part Arra y DM ARR is a dynamic container for other parts. The set of parts contained by DM ARR can be changed dynamically at any time. DM ARR implements all functionality necessary to manage the parts it contains. It works in conjunction with its host assembly to make its contained parts' terminals and properties visible to the host.
DM ARR is a DriverMagic library part. Refer to the rest of this document for a complete description.
DM EXC - Exception HandleilEvent Log DM-EXC displays the exception events generated by DM-FAC to the debug console and/or saves them in the Windows NT system event log or into a text file in Windows 95/98.
DM-EXC is a DriverMagic library part. Refer to the part library reference in the DriverMagic User Manual for a complete description (Windows NT) and the DriverMagic WDM Drivel Kit Reference (Windows 95/98).
10.3. Definition of Entities - Device Scope The device driver assembly (DEVxxx) implements the core functionality of the driver. An instance of this assembly is created for each installed device that is supported by the driver. DEVxxx consists of the following major parts:

~ MCC - Communications Protocol Core sub-assembly. MCC converts the application requests into application messages.
~ TRAxxx - Transport interface sub-assembly. TRAxxx provides a transparent OS-independent error-free interface to device.
Following is a detailed description of the components that make up DEVxxx.
DEVxxx - Device Assembly DEVxxx assembles MCC, TRAxxx and DM PEX. This allows the DEVxxx internal structure to be invisible to the outside, so that the device portion of the driver can be created and used as a single component.
MCC - Communications Protocol Core MCC is the device communication protocol assembly. It does not contain device-specific parts. MCC implements the appropriate Application message protocol.
MCC
receives the application requests, converts them into application messages and sends them to the device. It keeps track of requests submitted and completes them when the corresponding device responses are received. MCC receives all device notifications and stores them until the user-mode application acquires them.
TRAxxx - Transport Assembly This assembly implements the device transport protocol. It is responsible for acquiring exclusive access to the communication driver and detecting the device.
TRAxxx implements the appropriate transport protocol. TRAxxx provides a uniform interface for communication with the device applications. It has different implementation for the different transport media. The transport assembly contains parts that are operating system specific; it has different implementations under the different target systems.
DM PEX - Property Exposer DM-PEX gives any part connected to its prop terminal the ability to access the properties of the assembly that DM-PEX it is contained within. It allows manipulation of assembly's properties (including its subordinates) from a part connected to the assembly.

DM-PEX is a DriverMagic library part provided with Advanced Part Library.
Refer to the part library reference in the Object Dynamics' Advanced Part Library document for a complete description.
Communications Protocol Core Scope The MCC assembly and all parts in it are platform-independent. They are shared between Windows NT and Windows 95/98.
MCC contains of the following parts:
~ driver interface assembly - IF IFA
~ session manager - SES
~ event sequencer - DM SEQ
~ exception handler - DM-EXC.
/F /FA - Interface Assembly IF-IFA assembles parts that convert the incoming IOCTL requests to self-contained events and distribute those events its various output terminals according to their function. IF-IFA converts the incoming IOCTL requests to self-contained events sent out through call, nfy and prp terminals.
SES - Device Session Manager SES is the device session assembly for MCP driver. It translates the requests incoming on its inputs into application messages and sends them out.to the device. It keeps track of requests submitted and completes them when the corresponding device responses are received. SES receives all device notifications and stores them until the user-mode application acquires them.
DM SEQ - Event Sequencer DM SEa distributes incoming events received on in to the parts connected to the out1 and out2 terminals.
The events sent through out1 and out2 can be completed either synchronously or asynchronously - DM SEa takes care of the proper sequencing, completion and necessary cleanup.
DM SEQ is used to distribute device life-cycle events between the session manager and the transport assembly.

DM-SEQ is a DriverMagic library part provided with Advanced Part Library.
Refer to the part library reference in the Object Dynamics' Advanced Part Library document for a complete description.
DM EXC - Exception Handier/Event Log DM-EXC displays the exception events generated by Session manager (SES) to the debug console and/or saves them in the Windows NT system event log or into a text file in Windows 95/98.
DM-EXC is a DriverMagic library part. Refer to the part library reference in the DriverMagic User Manual for a complete description (Windows NT) and the DriverMagic WDM Driver Kit Reference (Windows 95/98).
11. Assembly descriptor for DRV
__________________________________________________________________________ DRV: Driver Assembly ~/
/~' DR DRV.C - MCP Driver Assembly ~*/
/* Version 1.00 SRevision: S ~/
__________________________________________________________________________ // CIassMagic support #include < cmagic.h >
#include <dm arr.h>
#include < i dio.h > // for the DIO MAP BUFFERED const #pragma hdrstop // project definitions #define MODULENAME "DR DRV"
#include < prjdefs.h >
#include <re ctl.h> // Exception message IDs. Generated // from re ctl.mc #include < re exctxt.h > // Exception messages text #if defined(PRJ SDK_n3f) ~ ~ defined(PRJ SDK n3c) #define WIN NT PROJECT
#endif #define DFLT CLASS NAME "DEVSER"
#define PKG EXT CLASS MAP
PRJ_REGISTRY-ROOT_9x"\\Parameters\\ExternaICIassMap"
/~ ___ Self Definitions -____________________________________________________ ~/
BEGIN SELF
decl pass (drv) // properties DRIVER OBJECT ~"drv objp; // grp property storage END SELF
/ * --- Defau It Implementations ----------------------------------------------~ /
PART (DR DRV, "MCP Driver Assembly");
/~ * --- Terminal/Property declarations --------------------------------------~"/
TERMINALS (DR DRV) pass (drv) END TERMINALS
PROPERTIES (DR DRV) prop grp uint32 (drv objp , fac, driver objectp ) #ifdef WIN NT PROJECT
prop grp uint32 (drv objp , exc, io objectp ) #endif prop-bcast unicodez (reg-root) prop redir (dflt class-name, fac, dflt class-name) prop redir (device type , fac, device type 1 END PROPERTIES
/~ ~ ___ Subordinates -_______________________________________________________ ~/
SUBORDINATES (DR DRV) part (fac, DM FAC) param (fac, dflt class_name, DFLT CLASS-NAME ) param (fac, buf-mapping , DIO-MAP_BUFFERED ) param (fac, device type , FILE DEVICE UNKNOWN) param (fac, status xlat , 1 ) // custom statuses // translated to // (s I Oxe0000000) #ifdef WIN NT PROJECT
param (fac, multiplex , TRUE ) #else param (fac, mux dio , TRUE ) param (fac, mux ext , TRUE ) param (fac, pnp , FALSE ) param (fac, copy stkloc , FALSE ) part (Idr, DM PKGLDR) param (ldr, pkg map-key , PKG_EXT CLASS-MAP ) #end if part (prm, DM PRM) part (ren, DM REN) array (arr, DEVSER, CMARR GENERATE-KEYS) // note: class name is // set from the outside #ifdef WIN NT PROJECT
part (exc, DM EXC) #else part (exc, MCP EXC95) param (exc, file-name , LOG_FILE-NAME ) EXC-param (exc, event log , FALSE
) param (exc, debug outpu t , TRUE
) param (exc, file-name , LOG-FILENAME ) EXC_ param (exc, fmt(0].id , INTERNAL-ERROR ) FWK_ param (exc, fmt(0].string , -INTERNAL_ERROR TXT
FWK ) param (exc, fmt(1 ].id , NO-DEVICES ) FWK-param (exc, fmt(1 ].string, -NO-DEVICES TXT ) FWK

param (exc, fmt(2].id , DEV ACTIVATE-FAILED
FWK ) param (exc, fmt(2].string , _DEV ACTIVATE-FAILED
FWK TXT) param (exc, fmt(3].id , CREATE ALIAS_FAILED
FWK ) param (exc, fmt(3].string , -CREATE ALIAS-FAILED
FWK TXT) param (exc, fmtf4].id , RRP_CLAIMED_FAILED
) param (exc, fmt[4].string, CLAIMED FAILED TXT
RRP ) param (exc, fmtf5].id , RRP RES CONFLICT ) param (exc, fmt[5].string , RRP-RES-CONFLICT TXT ) param (exc, fmt[6].id , RRP UNCLAIMED FAILED ) param (exc, fmtf6].string , RRP-UNCLAIMED_FAILED TXT ) #endif END SUBORDINATES
/~ ~ ___ Connections -________________________________________________________ ~/
CONNECTIONS (DR DRV) connect (S , drv , fac, drv ) connect (fac, dio , arr, dio ) #ifdef WIN NT PROJECT
connect (fac, fac , prm, i fac) #else connect (fac, fac , Idr, i fac) connect (Idr, o fac, prm, i fac) connect (Idr, o-prp, prm, i prp) #endif connect (fac, prp , prm, i prp) connect (prm, o fac, arr, fact ) connect (prm, o prp, arr, prop ) connect (fac, edev , ren, edev ) connect (fac, eprp , ren, eprp ) connect (fac, exc , exc, exc ) END CONNECTIONS

12. Limits of the implementation The following list outlines the limitations of an embodiment of the inventive container, none of which is necessary for practicing the present invention as claimed herein and none of which is necessarily preferred for the best mode of practicing the invention. Moreover, none of the following should be viewed as a limitation on means envisioned in the claims for practicing the invention as outlined herein above and below:
1.. DM ARR is built for the CIassMagic object-composition engine used in the DriverMagic system, and thus can be used directly only with that system. As a result, it is a DriverMagic component object, and can contain only other component objects acceptable to DriverMagic. The reason for choosing that system for the preferred embodiment is that, to inventors best knowledge, it is the only composition-based system applicable in a wide area of applications that does not sacrifice performance.
2. DM ARR uses the CIassMagic part array API as means to create, destroy, connect and disconnect, manipulate properties and activation state, maintain the list of contained objects, and other functions, related to the contained objects. The reason for using this API is that the CIassMagic engine provides it and, thus it was advantageous to use the existing implementation.
3. DM ARR identifies object classes, terminals and properties by names (text strings). Other identification mechanisms include without limitation, Microsoft COM GUID, integer values, IEEE 802.3 Ethernet MAC addresses, etc. The reason for using names is that the DriverMagic system uses names to identify these entities, which makes it easy for practitioners to remember and use.
4. DM ARR does not provide a built-in mechanism for dispatching /i.e., multiplexing or demultiplexing) multiple connections between an object outside the container and one or more objects contained in the container. When using this implementation, said dispatching is preferably provided through separate adapter objects or by the outside objects, advantageously allowing the container to be used with a variety of dispatch mechanisms.
5: DM ARR does not provide the ability to add already created objects to the container and to remove objects from the container without destroying said objects. The reason for this is that there was no perceived need for this feature.
6. DM ARR provides the ability to hold references (object IDs, oids) of the contained objects instead of the contained objects themselves. The reason for this is that the DriverMagic system does not provide mechanisms for one object to physically contain the memory of other objects.
Dynamic Structure Support Factories DM FAC - Device Driver Factory (INDMJ
Fig. 140 illustrates the boundary of the inventive DM-FAC part for WDM.
DM-FAC is a generic factory for WDM device drivers including Plug-n-Play (PnP) drivers. The determination of whether the factory will support PnP or not is based on the values set on ext irp and EXT xxx properties. If DM-FAC is to handle any PnP-related IRPs, it is assumed that this is a factory for PnP driver (operates in PnP
mode), otherwise it is not.
DM-FAC provides the necessary functionality to register the driver's entry points with Windows and, if necessary, to enumerate and register the devices controlled by the driver. The device enumeration is not implemented by DM FAC - it relies on the part connected to the edev and eprp terminals for this. For each registered device DM-FAC creates and parameterizes a device instance through the array control interfaces (fac and prp).
For PnP drivers DM-FAC provides the functionality to dynamically register and deregister devices as they appear and disappear from the system.
DM-FAC registers to receive all the basic device I/0 requests for the driver and dispatches them through the dio interface to the appropriate device instance.

Depending on the value of its ext-irp and EXT xxx properties, DM-FAC also registers to receive other I/O requests and dispatches them to the ext interface.
Synchronous and asynchronous I/0 request completion is provided on both the dio and ext interfaces. Note that DM-FAC allows asynchronous completion even for its device factory functionality - IRPs signifying that PnP devices have been removed from the system can be completed asynchronously.
DM-FAC has a notification input through which it is informed of driver life-cycle events.
All outgoing calls on DM-FAC's interfaces are executed in the same context that l0 Windows I/O Manager used to enter the driver - this is either a system thread or an application thread and the IRQ level is always PASSIVE (normal thread context).
IMPORTANT NOTE: DM-FAC cannot be used to implement drivers that accept I/O
requests at DISPATCH level.
1. Boundary 1.1. Terminals Terminal "drv" with direction "In" and contract I DRAIN. Note: Life cycle related events.
Terminal "dio" with direction "Bidir" and contract In: I DIO Out: I DIO C.
Note:
Device I/O and configuration/status operations. The back channel can be used for asynchronous completion of operations. DM-FAC implements the dio.complete as an unguarded operation, which can be called both in thread context (PASSIVE-IRQL) and in dispatch context (DISPATCH IRQL). dio is a multiplexed output, connectable at active time.
Terminal "ext" with direction "Plug" and contract I-DRAIN. Note: IRPs not covered by the I_DIO interface are routed through this terminal. DM_FAC provides only the IRP pointer to the callee. The back channel can be used for asynchronous completion of operations. Similarly to dio, the ext input on DM-FAC is unguarded.
This terminal may remain unconnected. ext is a multiplexed output, connectable at active time.

Terminal "fac" with direction "Out" and contract I A_FACT. Note: Part array interface. This terminal is used to create, destroy and enumerate driver instances.
Terminal "prp" with direction "Out" and contract I A-PROP. Note: Property interface for part arrays. See below for a list of properties that DM FAC will set on the created device instances.
Terminal "edev" with direction "Out" and contract I DEN. Note: Device enumeration interface. Unless DM FAC operates in PnP mode, it requires connection to this terminal to enumerate the devices that have to be created and registered.
Floating.
Terminal "eprp" with direction "Out" and contract I A_PROP. Note: This output is used to get extended information for each device enumerated through edev.
Floating.
1.2. Events and notifications Incoming Event Bus Notes EV_DRV-INIT B-EV_DRV DM-FAC must receive this notification during the driver initialization. DM FAC will use this event to register the driver's entry points, and to enumerate and create the driver objects.
EV DRV CLEANUP B EV DRV DM FAC must receive this notification before the driver is unloaded.
EV-IRP_NFY-PROC CP B_EV-IRP Complete the IRP specified in the event bus.
LT
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "driver objectp" of type "UINT32". Note: Pointer to Windows driver object structure. DM_FAC modifies only the MajorFunction field in the driver object.
Mandatory.
Property "ext-irp" of type "UINT32". Note: A bit mask defining which IRP-MJ
xxx functions to pass to the ext terminal. Bits 0 to 31 correspond to IRP MJ xxx codes 0 to 31 respectively. DM-FAC will ignore bits that correspond to IRPs covered by the I DIO interface or are outside the IRP MJ MAXIMUM FUNCTION code (for WDM this is 27 or 0x1 b). DM-FAC will register to receive only those IRP_MJ xxx calls that have the corresponding bit set in ext-irp. Default: 0x0.
Property "EXT-CREATE_NAMED-PIPE" of type "UINT32". Note: Boolean. Set to TRUE if DM FAC is to handle this IRP. The value of this property will be OR-ed with the respective bit in ext irp property and the result will be used to determine whether DM FAC will handle a particular IRP or not. Default: FALSE
Property "EXT QUERY-INFORMATION" of type "UINT32". Note: Same as above.
Property '.'EXT SET INFORMATION" of type "UINT32". Note: Same as above.
Property "EXT QUERY EA" of type "UINT32". Note: Same as above.
Property "EXT SET-EA" of type "UINT32". Note: Same as above.
Property "EXT FLUSH BUFFERS" of type "UINT32". Note: Same as above.
Property "EXT_QUERY VOLUME-INFORMATION" of type "UINT32". Note: Same as above.
Property "EXT_SET VOLUME_INFORMATION" of type "UINT32". Note: Same as above.
Property "EXT-DIRECTORY CONTROL" of type "UINT32". Note: Same as above.
Property "EXT-FILE SYSTEM_CONTROL" of type "UINT32". Note: Same as above.
Property "EXT-INTERNAL_DEVICE CONTROL" of .type "UINT32". Note: Same as above.
Property "EXT SHUTDOWN" of type "UINT32". Note: Same as above.
Property "EXT LOCK CONTROL" of type "UINT32". Note: Same as above.
Property "EXT CREATE-MAILSLOT" of type "UINT32". Note: Same as above.
Property "EXT-QUERY SECURITY" of type "UINT32". Note: Same as above.
Property "EXT-SET-SECURITY" of type "UINT32". Note: Same as above.
Property "EXT_POWER" of type "UINT32". Note: Same as above.
Property "EXT SYSTEM CONTROL" of type "UINT32". Note: Same as above.
Property "EXT DEVICE CHANGE" of type "UINT32". Note: Same as above.
Property "EXT_QUERY QUOTA" of type "UINT32". Note: Same as above.
Property "EXT_SET-QUOTA" of type "UINT32". Note: Same as above.
Property "EXT_PNP" of type "UINT32". Note: Same as above.

Property "EXT-PNP_POWER" of type "UINT32". Note: Same as above.
Property "pnp" of type "UINT32". Note: Boolean. Set to non-zero (TRUE) to indicate that DM FAC will handle PnP events (IRP_MJ-PNP xxx). Setting this property to TRUE is equivalent to setting IRP-MJ-PNP and IRP_MJ-PNP_POWER to TRUE or setting the respective bit in ext irp to 1. When TRUE, DM_FAC ignores the settings of the EXT-PNP and EXT-PNP-POWER properties (DM_FAC will always handle these IRPs). Default: FALSE
Property "dflt class name" of type "ASCIZ". Note: The class name to use when creating device instances, in case the device enumerator does not provide a class name. Default: FW DEV
Property "mux dio" of type "UINT32". Note: Boolean. This property defines whether DM_FAC should use the dio interface as a multiplexed output or as normal output. If it is set to non-zero, DM-FAC will multiplex the output using the id returned from the fac interface when device instances are created. If this property is 0, DM FAC
will permanently select the first connection on the dio output and send all calls to it.
Default: TRUE.
Property "mux ext" of type "UINT32". Note: Boolean. This property defines whether DM_FAC should use the ext interface as a multiplexed output or as normal output. If it is set to non-zero, DM-FAC will multiplex the output using the id returned from the fac interface when device instances are created. If this property is 0, DM FAC
will permanently select the first connection on the dio output and send all calls to it.
Default: TRUE.
Property "device type" of type "UINT32". Note: Device type identifier to use when registering the devices with the operating system. This property is optional -the default value is FILE DEVICE UNKNOWN (0x22). Use values between 0x8000 and Oxffff for custom-defined types. Note that, although this is not enforced, the device type value is normally used in the high-order word (bits 31..16) of the IOCTL codes for this type of device.

Property "buf-mapping" of type "UINT32". Note: If set to DIO_MAP_BUFFERED
DM-FAC will set DO_BUFFERED-10 flag in the device objects. Default:
DIO MAP BUFFERED
Property "force free" of type "UINT32". Note: Boolean. If TRUE, DM FAC will free the self-owned events with no regard what the event processing status is.
Default:
FALSE
Property "copy stkloc" of type "UINT32". Note: Boolean. If TRUE, DM FAC will copy the current stack location to the next one (if any) before sending any IRP events through its ext terminal. Default: TRUE
Property "dev cls-guide" of type "UINT32". Note: Pointer to a GUID identifying the class of devices DM_FAC registers device interfaces for. For a list of device class GUIDs, consult the Microsoft DDK documentation. If NULL, device interfaces will not be registered. Default: NULL
Property "dev ref" of type "UNICODEZ". Note: Reference string used when registering device interfaces. For description of device interfaces and reference strings, consult the Microsoft DDK documentation. Default: ""
Property "dev-name base" of type "UNICODEZ". Note: Base (prefix) name for symbolic links created for each device. See discussion at the end of this table. If empty string (""), symbolic link will not be registered. Default: ""
Property "status xlat" of type "UINT32". Note: Specifies how DM-FAC translates return statuses that are propagated back up to user mode (Win32). Possible values are 0 (standard NT error codes), 1 (standard NT error codes and custom error codes), and 2 (only custom error codes). See the Mechanisms section for more information. Default is 0.
1.5. Properties Provided by DM FAC to Device Instances The following optional properties are set on the device instances immediately after they are created through the fac interface:
Property "dev objp" of type "UINT32". Note: Pointer to the device object that was created for this instance.

Property "dev_name" of type "ASCIZ". Note: Device name in kernel mode space.
In PnP mode this property is set only if dev-name base property on DM_FAC is set.
Property "dev sym-Ink1 " of type "ASCIZ". Note: Symbolic link #1. In PnP mode this property is set only if dev-name-base property on DM-FAC is set.
Property "dev sym Ink2" of type "ASCIZ". Note: Symbolic link #2. Not set in PnP
mode.
Property "phys devp" of type "UINT32". Note: Pointer to the PDO for the PnP
device being added. Set in PnP mode only.
Property "low dev objp" of type "UINT32". Note: Pointer to the lower-level driver device object. Set in PnP mode only.
Property "reg-root" of type "UNICODE". Note: Path to the device's Registry settings.
This is provided by the device enumerator connected to DM-FAC's or the PnP
Device Manager on Add Device.
2. Encapsulated interactions DM FAC uses the following Windows I/O manager API:
IoAlIocateDriverObjectExtension, IoGetDriverObjectExtension IoCreateDevice, IoDeleteDevice IoAttachDeviceToDeviceStack, IoDetachDevice IoRegisterDevicelnterface IoGetDeviceProperty IoCreateSymbolicLink, IoDeleteSymbolicLink IoCompIeteRequest IoGetCurrentlrpStackLocation, IoCopyCurrentlrpStackLocationToNext IoMarkIrpPending DM-FAC also provides the entry points to handle IRPs from the I/O Manager and modifies the DriverObject structure in order to direct the requests to these entry points.

3. Specification 4. Responsibilities 1. On EV-DRV-INIT: register entry points and if the edev terminal is connected, enumerate devices through it, create and parameterize device instances (through fac and prp). If connected, retrieve the following information from the device enumerator:
class name for the device instance Win32 names) to associate with the device device name (in kernel-mode name space) 2. On basic IRP-MJ xxx calls from I/O Manager (the ones that match operations in I DIO): use data from the IRP to fill in the B DIO bus and pass the operation to dio terminal.
3. Handle dynamic (PnP) device addition and removal and create/destroy device instances for each such device. Provide handling for asynchronous completion of the device removal procedure and destroy the instance upon removal.
4. For dynamic (PnP) device closure, delay cleanup in case the device is still open.
5. If an operation on dio returns any status except CMST-PENDING: translate the status to NT status and complete the IRP.
6. If an operation on dio returns CMST-PENDING: return STATUS_PENDING to Windows without completing the IRP.
7. On dio.complete: retrieve the IRP pointer and the completion status from B
DIO, translate status to NT status and complete the IRP.
8. On IRP MJ xxx calls that are not covered by I DIO - pass the call to ext as an EV REQ IRP event. If the call returns any status except CMST PENDING
translate return status and complete the IRP.
9. On EV-REQ-IRP completion event from ext - translate completion status and complete the IRP.
10.Translate the return statuses that are propagated back up to user mode according to the status xlat property.

5. Theory of operation 5.1. State machine None 5.2. Main data structures DriverObject (system-defined) DM FAC expects to receive a valid pointer to a DriverObject structure with the EV-DRV-INIT event. It modifies the MajorFunction field in this structure to register its entry points. It also passes this structure to the Windows I/O Manager when creating device instances.
l0 DeviceObject (system-defined) Windows returns a Device0bject structure when a new device is created.
DM_FAC uses a public field in this structure (DeviceExtension) to store its per-device context.
)RP (system-defined) This structure is used by the I/0 Manager to pass requests and their arguments for all driver functions (IRP MJ xxx).
5.3. Mechanisms Name and Symbolic Link In non-PnP mode, the symbollic link to device instances (if any) are provided by the device enumerator connected to the edev terminal. Up to 2 such links can be registered.
In PnP mode, DM FAC registers symbolic links (Win32 names) to device instances using the value of dev_base-name as a prefix and appending to it the value of DevicePropertyDriverKeyName.
The latter is a persistent identifier of a device. Windows computes this identifier the first time a device appears on a particular slot in a particular hardware bus4 and remembers it in a persistent part of the registry. DM-FAC will replace any backslash 4 Note that one and the same device plugged into different hardware buses or even different slots of the same bus, will have different persistent identifiers.

characters ("\") with dots ("."), so that this identifier can be used as part of a symbolic link name.
Registry Access DM-FAC does not read directly from the Registry.
In non-PnP mode, a device enumerator connected to the edev terminal is expected to provide registry path for each device. This path will be passed as a property (reg-root) to the corresponding device instance created by DM-FAC.
In PnP mode, the registry root is calculated by the value of DevicePropertyDriverKeyName property appended to HKLM\System\CurrentControlSet\Services\Class.
Dispatching operations to device instances DM FAC's dio and ext terminals are (independently) multiplexed to allow multiple device instances to be connected to these terminals. The default mechanism for multiplex output selection provided by CIassMagic 'is not atomic - it requires separate "select" and "call" operations. This cannot be used in DM_FAC, because these terminals are not called in a guarded context and may be re-entered from different execution contexts simultaneously.
DM FAC does not enter any critical sections while it is calling dio and ext operations to allow the device instances to execute in the same context in which DM FAC was entered by I/0 Manager. If it is necessary, the parts that represent the device instances should provide their own guarding (e.g., the standard part terminal guard provided by CIassMagic).
To overcome this restriction, DM FAC enters a critical section to perform the multiplex output selection and retrieve a valid v-table interface pointer to the selected part. It then calls the operation using the interface pointer outside of the critical section.
Translating DriverMagic status codes DM-FAC translates CMST xxx status codes (that are returned from invoking operations on the dio and ext terminals - synchronous or asynchronous) into Windows NT status codes or custom status codes defined by the user. These codes are then propagated up to the user mode environment (Win32).
The status translation is controlled through the status xlat property. This property may have one of the following values:
0: Standard NT status codes only (see status table below) 1: Standard NT status codes and custom (user-defined) status codes 2: Custom (user-defined) status codes only If translating to standard NT status codes (status xlat is 0 or 1 ), DM-FAC
uses a status table that maps CMST xxx statuses to NT statuses. These NT statuses are then converted into Win32 error codes by the operating system.
If the CMST xxx status code is not found in the table, either the status is mapped to STATUS-UNSUCCESSFULL (status xlat is 0) or it is mapped to a custom status (status xlat is 1 ) by ANDing the status code with OxE0000000 (this tells the operating system that this is a user-defined status code - the OS will pass the code up to user mode without modification).
If status xlat is 2, the status codes are always user-defined and are ANDed with OxE0000000 as described above. In this case, DM FAC does not use the table to map the status codes. In user mode, the Win32 status code can be ANDed with 0x1 FFFFFFF to extract the user-defined status code.
Note that the status codes from Plug-n-Play and power IRPs are always converted to the proper NT status code without reguard to the status xlat property.
Below is a table showing the mapping of the DriverMagic status codes to NT
status codes:
DriverMagic Status NT Status CMST OK ERROR SUCCESS
CMST ALLOC STATUS NO MEMORY
CMST NO ROOM STATUS INSUFFICIENT RESO
URCES
CMST OVERFLOW STATUS BUFFER TOO SMALL

DriverMagic NT Status Status CMST UNDERFLOW STATUS INVALIDPARAMETE

R

CMST EMPTY STATUS PIPE
EMPTY

CMST FULL STATUS DISK LL
FU

CMST EOF STATUS END FILE
OF

CMST INVALID STATUS INVALIDPARAMETE

R

CMST BAD VALUE STATUS INVALIDPARAMETE

R

CMST OUT OF RANGE STATUS INVALIDPARAMETE

R

CMST NULL PTR STATUS INVALIDPARAMETE

R
CMSTBAD SYNTAX STATUS INVALID PARAMETE

R

CMSTBAD NAME OBJECT NAME INVALID

CMSTUNEXPECTED STATUS INTERNAL ERROR

CMSTPANIC STATUS INTERNAL ERROR

CMSTDEADLOCK STATUS POSSIBLE DEADLOC

K

CMSTSTACK OVERFL STATUS BAD INITIAL
STACK

OW

CMSTREFUSE STATUS REQUEST NOT
ACC

EPTED

CMSTNO ACTION STATUS REQUEST NOT
ACC

EPTED

CMSTFAILED STATUS UNSUCCESSFULL

CMSTNOT INITED STATUS INTERNAL ERROR

CMSTNOT ACTIVE STATUS INTERNAL ERROR

DriverMagic NT Status Status CMST NOT OPEN STATUS INTERNAL ERROR

CMST NOT CONNECT STATUS INTERNAL ERROR

ED

CMST NOT CONSTRU STATUS INTERNAL ERROR

CTED

CMST BAD CHKSUM STATUS DEVICE DATA ERRO
R
CMSTNOT FOUND STATUS NO SUCH FILE

CMSTDUPLICATE STATUS DUPLICATE NAME

CMSTBUSY STATUS BUSY

CMSTACCESS DENIE STATUS ACCESS DENIED

D
CMST PRIVILEGE STATUS PRIVILEGE NOT HEL
D
CMST SCOPE VIOLATI STATUS ACCESS DENIED
ON
CMST BAD ACCESS STATUS ACCESS DENIED
CMSTPENDING STATUS PENDING

CMSTCANCELED STATUS CANCELLED

CMSTABORTED STATUS CANCELLED

CMSTRESET STATUS CANCELLED

CMSTCLEANUP STATUS CANCELLED

CMSTOVERRIDE STATUS UNSUCCESSFULL

CMSTPOSTPONE STATUS UNSUCCESSFULL

CMSTCANT BIND STATUS NO SUCH FILE

CMSTAPI ERROR STATUS NOT IMPLEMENTED

DriverMagic Status NT Status CMST WRONG VERSI STATUS REVISION MISMATC

ON H

CMST NOT IMPLEMEN STATUS NOT IMPLEMENTED

TED

CMST NOT SUPPORTE STATUS INVALID DEVICE
RE

D QUEST

CMST BAD OID STATUS INTERNAL ERROR

CMST BAD MESSAGE STATUS INTERNAL ERROR

Below is a table showing the mapping of the DriverMagic status codes to Win32 (user mode) status codes:
DriverMagic Status Win32 Status CMST OK NO ERROR
CMST ALLOC ERROR NOT ENOUGH MEMOR
Y
CMST NO ROOM ERROR NO SYSTEM RESOUR
CES
CMST OVERFLOW ERROR INSUFFICIENT
BUFFER

CMST UNDERFLOW ERROR INVALIDPARAMETER

CMST EMPTY ERROR NO DATA

CMST FULL ERROR DISK
FULL

CMST EOF ERROR HANDLE EOF

CMST INVALID ERROR INVALIDPARAMETER

CMST BAD VALUE ERROR INVALIDPARAMETER

CMST OUT OF RANGE ERROR INVALIDPARAMETER

CMST NULL PTR ERROR INVALIDPARAMETER

CMST BAD SYNTAX ERROR INVALIDPARAMETER

CMST BAD NAME ERROR INVALIDPARAMETER

DriverMagic Win32 Status Status CMST UNEXPECTED ERROR INTERNAL ERROR

CMST PANIC ERROR INTERNAL ERROR

CMST DEADLOCK ERROR POSSIBLE DEADLOCK

CMST STACK OVERFL ERROR STACK OVERFLOW

OW

CMST REFUSE ERROR REQ NOT ACCEP

CMST NO ACTION ERROR REQ NOT ACCEP

CMST FAILED ERROR GEN FAILURE

CMST NOT INITED ERROR INTERNAL ERROR

CMST NOT ACTIVE ERROR INTERNAL ERROR

CMST NOT OPEN ERROR INTERNAL ERROR

CMST NOT CONNECT ERROR INTERNAL ERROR

ED

CMST NOT CONSTRU ERROR INTERNAL ERROR

CTED

CMST BAD CHKSUM ERROR CRC

CMST NOT FOUND ERROR FILE NOT FOUND

CMST DUPLICATE ERROR DUP NAME

CMST BUSY ERROR BUSY

CMST ACCESS DENIE ERROR ACCESS DENIED

D

CMST PRIVILEGE ERROR PRIVILEGE NOT HELD

CMST SCOPE VIOLATI ERROR ACCESS DENIED
ON
CMSTBAD ACCESS ERROR ACCESS DENIED

CMSTTIMEOUT ERROR SEM TIMEOUT

CMSTCANCELED ERROR OPERATION ABORTED

DriverMagic Win32 Status Status CMST ERROR OPERATION ABORTED
ABORTED

CMST RESET ERROR OPERATION ABORTED

CMST CLEANUP ERROR OPERATION ABORTED

CMST OVERRIDE ERROR GEN FAILURE

CMST POSTPONE ERROR GEN FAILURE

CMST CANT BIND ERROR FILE NOT FOUND

CMST ERROR INVALID FUNCTION
API
ERROR

CMST ERROR REVISION MISMATCH
WRONG
VERSI

ON

CMST NOT IMPLEMEN ERROR INVALID FUNCTION

TED

CMST NOT SUPPORTE ERROR INVALID FUNCTION

D

CMST BAD OID ERROR INTERNAL ERROR

CMST BAD MESSAGE ERROR INTERNAL ERROR

5.4. Use Cases PnP Device Instance Creation DM FAC receives a call from the PnP Device Manager: AddDevice.
Creates an instance (using default class name) of the part responsible for the new device through its fac terminal (device part) Parameterizes the device part with the arguments of the AddDevice (PDO
pointer) and, if eprp is connected with all the properties that the part connected to this terminal reports (using the devid returned by the fac terminal).
Attaches the device instance to the device stack and sets the returned object pointer as a property on the device part.
Activates the device part.
Registers symbolic links computing name for the device instance based on the device id.

PnP Device Instance Destruction (sync. completion) DM FAC receives an IRP MN REMOVE DEVICE.
Forwards the event out through ext terminal allowing asynchronous completion.
The event completes synchronously.
Deregisters symbolic links, deactivate, destroys device iristance and returns.
PnP Device Instance Destruction (async. completion) DM FAC receives an IRP MN REMOVE DEVICE.
Forwards the event out through ext terminal allowing asynchronous completion.
The forwarding completes asynchronously (CMST PENDING) -- return STATUS PENDING.
When the completion event comes - deregisters symbolic links, deactivate and destroys the instance.
Completes the IRP.
Synchronous Device I/O Operation DM-FAC receives a call from the I/O Manager and translates it into an I-DIO
operation.
If the mux dio property is non-zero, it selects the connection on the dio output (this and the next step are executed as an atomic select-and-call operation) DM FAC invokes the operation on dio The call returns a completion status and DM FAC translates it to a Windows NT status and completes the IRP sent by the I/O Manager.
Asynchronous Device llO Operation DM-FAC receives a call from the I/O Manager and translates it into an I-DIO
operation.
If the mux dio property is non-zero, it selects the connection on the dio output (this and the next step are executed as an atomic select-and-call operation) DM-FAC invokes the operation on dio The call returns CMST-PENDING, which indicates that the operation will be completed later. DM-FAC marks the IRP as pending and returns to I/O
Manager without completing it.
When the operation is completed, the part connected to dio invokes the I-DIO C.complete operation on the back channel of the dio interface using the same bus that was used to start the operation (or a copy of it).
DM-FAC retrieves the operation's IRP pointer from the bus and reports the completion to the I/O Manager.
6. Notes The recipient of the IRP MN REMOVE DEVICE IRP event (received from the ext terminal) must return the removal completion status from the lower driver to DM FAC, not its own removal status. Thus, the return status of the IRP MN REMOVE DEVICE IRP (from DM FAC) is that of the lower driver.
DM FAC - Device Driver Factory (NTKI
Fig. 141 illustrates the boundary of the inventive DM-FAC part for NTK.
DM-FAC is a generic factory for Windows NT device drivers. Since there can be only one driver in a executable, only one instance of DM FAC may be created per executable (DM FAC will enforce this).
2o DM-FAC provides the necessary functionality to register the driver's entry points with Windows NT and to enumerate and register the devices controlled by the driver.
The device enumeration is not implemented by DM-FAC - it relies on the part connected to the edev and eprp terminals for this. For each registered device DM-FAC creates and parameterizes a device instance through the array control interfaces (fac and prp).
DM-FAC registers to receive all the basic device I/O requests for the driver and dispatches them through the dio interface to the appropriate device instance.
Depending on the value of its ext irp property, DM-FAC also registers to receive other I/O requests and dispatches them to the ext interface.

Synchronous and asynchronous I/O request completion is provided on both the dio and ext interfaces.
DM-FAC has a notification input through which it is informed of life-cycle related driver events.
All outgoing calls on DM-FAC's interfaces are executed in the same context that Windows NT I/O Manager used to enter the driver - this is either a system thread or an application thread and the IRQ level is always PASSIVE (normal thread context).
7. Boundary ' 7.1. Terminals l0 Terminal "drv" with direction "In" and contract I DRAIN. Note: Life cycle related events.
Terminal "dio" with direction "Bidir" and contract In:
I-DIO Out: I_DIO C. Note: Device I/O and config/status operations. The back channel can be used for asynchronous completion of operations. DM FAC
implements the dio.complete as an unguarded operation, which can be called both in thread context (PASSIVE IRaL) and in dispatch context (DISPATCH IRQL). dio is a multiplexed output, connectable at active time.
Terminal "ext" with direction "Plug" and contract I-DRAIN. Note: IRPs not covered by the I-DIO interface are routed through this terminal. DM-FAC provides only the IRP pointer to the callee. The back channel can be used for asynchronous completion of operations. Similarly to dio, the ext input on DM-FAC is unguarded.
This terminal may remain unconnected. ext is a multiplexed output, connectable at active time.
Terminal "fac" with direction "Out" and contract I A_FACT. Note: Part array interface. This terminal is used to create, destroy and enumerate driver instances.
Terminal "prp" with direction "Out" and contract I A PROP. Note: Property interface for part arrays. See below for a list of properties that DM FAC will set on the created device instances.

Terminal "edev" with direction "Out" and contract I DEN. Note: Device enumeration interface. DM-FAC requires this connection to enumerate the devices that have to be created and registered.
Terminal "eprp" with direction "Out" and contract I A-PROP. Note: This output is used in conjunction with edev to get extended information for each device enumerated through edev.
7.2. Events and notifications Incoming Event Bus Notes EV-DRV-INIT B_EV_D DM-FAC must receive this notification during the driver RV initialization. DM-FAC will use this event to register the driver's entry points, and to enumerate and create the driver objects.
EV DRV CLEANUP B EV D DM FAC must receive this notification before the driver RV is unloaded.
EV_IRP_NFY-PROC . B_EV_IR Complete the IRP specified in the event bus.
CPLT P
7.3. Special events, frames, commands or verbs None.
7.4. Properties Property "driver objectp" of type "UINT32". Note: Pointer to Windows NT driver object structure. DM_FAC modifies only the MajorFunction field in the driver object.
This property is mandatory.
Property "ext irp" of type "UINT32". Note: A bit mask defining which IRP-MJ
xxx functions to pass to the ext terminal. Bits 0 to 31 correspond to IRP MJ xxx codes 0 to 31 respectively. DM_FAC will ignore bits that correspond to IRPs covered by the I DIO interface or are outside the IRP MJ MAXIMUM FUNCTION code (for Windows NT 4.0 this is 27 or 0x1 b). DM-FAC will register to receive only those IRP-MJ
xxx calls that have the corresponding bit set in ext irp. The default value for ext-irp is 0.

Property "dflt class name" of type "ASCIZ". Note: The class name to use when creating device instances, in case the device enumerator does not provide a class name. The default value for this property is "FW DEV".
Property "multiplex" of type "UINT32". Note: This property defines whether DM
FAC
should use the dio and ext interfaces as multiplexed outputs or as normal outputs. If it is set to non-zero, DM FAC will multiplex the outputs using the id returned from the fac interface when device instances are created. If this property is 0, DM
FAC
will permanently select the first connection on the dio and ext outputs and send all calls to it. The default value for multiplex is 1 (TRUE).
Property "device type" of type "UINT32". Note: Device type identifier to use when registering the devices with the operating system. This property is optional -the default value is FILE DEVICE UNKNOWN (0x22). Use values between 0x8000 and Oxffff for custom-defined types. Note that, although this is not enforced, the device type value is normally used in the high-order word (bits 31..16) of the IOCTL codes for this type of device.
Property "status xlat" of type "UINT32". Note: Specifies how DM-FAC translates return statuses that are propagated back up to user mode (Win32). Possible values are 0 (standard NT error codes), 1 (standard NT error codes and custom error codes), and 2 (only custom error codes). See the Mechanisms section for more information. Default is 0.
7.5. Registry Access DM FAC does not read directly from the Registry. The device enumerator connected to the edev terminal is expected to provide a registry path for each device.
This path will be passed as a property (reg-root) to the corresponding device instance created by DM-FAC.
7.6. Properties Provided by DM-FAC to Device Instances The following optional properties are set on the device instances immediately after they are created through the fac interface:

Property "device objectp" of type "UINT32". Note: Pointer to the device object that was created for this instance.
Property "reg-root" of type "UNICODE". Note: Path to the device's Registry settings.
This value is provided by the device enumerator connected to DM-FAC's edev and eprp outputs.
8. Encapsulated interactions DM-FAC calls the Windows NT I/O manager to register devices (IoCreateDevice) and to register Win32-accessible aliases for the devices (IoCreateSymbolicLink).
DM-FAC also provides the entry points to handle IRPs from the I/O Manager and modifies the DriverObject structure in order to direct the requests to these entry points.
9. Specification 10. Responsibilities On EV DRV INIT: register entry points, enumerate devices through edev, and create and parameterize device instances (through fac and prp). Retrieve the following information from the device enumerator:
class name for the device instance Win32 names) to associate with the device device name tin kernel-mode name space) On basic IRP-MJ xxx calls from I/O Manager Ithe ones that match operations in I DIO): use data from the IRP to fill in the B DIO bus and pass the operation to dio terminal.
If an operation on dio returns any status except CMST-PENDING: translate the status to NT status and complete the IRP.
If an operation on dio returns CMST_PENDING: return STATUS-PENDING to Windows NT without completing the IRP.
On dio.complete: retrieve the IRP pointer and the completion status from B
DIO, translate status to NT status and complete the IRP.

On IRP-MJ xxx calls that are not covered by I-DIO - pass the call to ext as an EV-IRP-REQ-PROCESS event. If the call returns any status except CMST-PENDING - translate return status and complete the IRP.
On EV-IRP-NFY-PROC-CPLT event from ext - translate completion status and complete the IRP.
Translate the return statuses that are propagated back up to user mode according to the status xlat property.
11. Theory of operation 11.1. State machine l0 None 11.2. Main data structures DriverObject (system-definedl DM-FAC expects to receive a valid pointer to a DriverObject structure with the EV-DRV-INIT event. It modifies the MajorFunction field in this structure to register its entry points. It also passes this structure to the Windows NT I/0 Manager when creating device instances.
DeviceObject(system-definedl A DeviceObject structure is returned by Windows NT when a new device is created. DM FAC uses a public field in this structure (DeviceExtension) to store its per-device context.
/RP (system-definedl This structure is used by the I/O Manager to pass the arguments for all driver functions (IRP MJ xxx).
11.3. Mechanisms Dispatching operations to device instances DM FAC's dio and ext terminals are multiplexed to allow multiple device instances to be connected to these terminals. The default mechanism for multiplex output selection provided by CIassMagic is not atomic - it requires separate "select"
and "call" operations. This cannot be used in DM FAC, because these terminals are not called in a guarded context and may be re-entered from different execution contexts simultaneously.
DM-FAC should not enter any critical sections while it is calling dio and ext operations to allow the device instances to execute in the same context in which DM-FAC was entered by I/0 Manager. If it is necessary, the parts that represent the device instances may provide their own guarding (e.g., the standard part terminal guard provided by CIassMagic).
To overcome this restriction, DM_FAC enters a critical section to perform the multiplex output selection and retrieve a valid v-table interface pointer to the selected part. It then calls the operation using the interface pointer outside of the critical section.
Translating D~iverMagic status codes DM_FAC translates CMST xxx status codes (that are returned from invoking operations on the dio and ext terminals - synchronous or asynchronous) into Windows NT status codes or custom status codes defined by the user. These codes are then propagated up to the user mode environment (Win32).
The status translation is controlled through the status xlat property. This property may have one of the following values:
0: Standard NT status codes only (see status table below) 1 : Standard NT status codes and custom (user-defined) status codes 2: Custom (user-defined) status codes only If translating to standard NT status codes (status xlat is 0 or 1 ), DM FAC
uses a status table that maps CMST xxx statuses to NT statuses. These NT statuses are then converted into Win32 error codes by the operating system.
If the CMST xxx status code is not found in the table, either the status is mapped to STATUS_UNSUCCESSFULL (status xlat is 0) or it is mapped to a custom status (status xlat is 1 ) by ANDing the status code with OxE0000000 (this tells the operating system that this is a user-defined status code - the OS will pass the code up to user mode without modification).

If status xlat is 2, the status codes are always user-defined and are ANDed with OxE0000000 as described above. In this case, DM FAC does not use the table to map the status codes. In user mode, the Win32 status code can be ANDed with 0x1 FFFFFFF to extract the user-defined status code.
Below is a table showing the mapping of the DriverMagic status codes to NT
status codes:
DriverMagic Status NT Status CMST OK ERROR SUCCESS
CMST ALLOC STATUS NO MEMORY
CMST NO ROOM STATUS INSUFFICIENT RESO
URCES
CMST OVERFLOW STATUS BUFFER TOO SMALL
CMST UNDERFLOW STATUS INVALID PARAMETE
R
CMST EMPTY STATUS PIPE EMPTY

CMST FULL STATUS DISK FULL

CMST EOF STATUS END OF FILE

CMST INVALID STATUS INVALID PARAMETE

R
CMST BAD VALUE STATUS INVALID PARAMETE
R
CMST OUT OF RANGE STATUS INVALID PARAMETE
R
CMST NULL PTR STATUS INVALID PARAMETE
R
CMST BAD SYNTAX STATUS INVALID PARAMETE
R
CMST BAD NAME OBJECT NAME INVALID

CMST UNEXPECTED STATUS INTERNAL ERROR

CMST PANIC STATUS INTERNAL ERROR

DriverMagic NT Status Status CMST DEADLOCK STATUS POSSIBLE DEADLOC

K

CMST STACK OVERFL STATUS BAD INITIAL STACK

OW

CMST REFUSE STATUS REQUEST NOT ACC

EPTED

CMST NO ACTION STATUS REQUEST NOT ACC

EPTED

CMST FAILED STATUS UNSUCCESSFULL

CMST NOT INITED STATUS INTERNAL ERROR

CMST NOT ACTIVE STATUS INTERNAL ERROR

CMST NOT OPEN STATUS INTERNAL ERROR

CMST NOT CONNECT STATUS INTERNAL ERROR

ED

CMST NOT CONSTRU STATUS INTERNAL ERROR

CTED

CMST BAD CHKSUM STATUS DEVICE DATA ERRO

R

CMST NOT FOUND STATUS NO SUCH FILE

CMST DUPLICATE STATUS DUPLICATE NAME

CMST BUSY STATUS BUSY

CMST ACCESS DENIE STATUS ACCESS DENIED

D

CMST PRIVILEGE STATUS PRIVILEGE NOT
HEL

D

CMST SCOPE VIOLATISTATUS ACCESS DENIED

ON

CMST BAD ACCESS STATUS ACCESS DENIED

DriverMagic NT Status Status CMST PENDING STATUS PENDING

CMST CANCELED STATUS CANCELLED

CMST ABORTED STATUS CANCELLED

CMST RESET STATUS CANCELLED

CMST CLEANUP STATUS CANCELLED

CMST OVERRIDE STATUS UNSUCCESSFULL

CMST POSTPONE STATUS UNSUCCESSFULL

CMST CANT BIND STATUS NO SUCH FILE

CMST API ERROR STATUS NOT IMPLEMENTED

CMST STATUS REVISION MISMATC
WRONG
VERSI

ON H

CMST NOT IMPLEMEN STATUS NOT IMPLEMENTED

TED

CMST NOT SUPPORTE STATUS INVALID DEVICE
RE

D QUEST

CMST BAD OID STATUS INTERNAL ERROR

CMST BAD MESSAGE STATUS INTERNAL ERROR

Below is a table showing the mapping of the DriverMagic status codes to Win32 (user mode) status codes:
DriverMagic Status Win32 Status CMST OK NO ERROR
CMST ALLOC ERROR NOT ENOUGH MEMOR
Y
CMST NO ROOM ERROR NO SYSTEM RESOUR
CES
CMST OVERFLOW ERROR INSUFFICIENT BUFFER

CMST UNDERFLOW ERROR INVALID PARAMETER

CMST EMPTY ERROR NO DATA

DriverMagic Status Win32 Status CMSTFULL ERROR DISK FULL

CMSTEOF ERROR HANDLE EOF

CMSTINVALID ERROR INVALID PARAMETER

CMSTBAD VALUE ERROR INVALID PARAMETER

CMSTOUT OF RANGE ERROR INVALID PARAMETER

CMSTNULL PTR ERROR INVALID PARAMETER

CMSTBAD SYNTAX ERROR INVALID PARAMETER

CMSTBAD NAME ERROR INVALID PARAMETER

CMSTUNEXPECTED ERROR INTERNAL ERROR

CMSTPANIC ERROR INTERNAL ERROR

CMSTDEADLOCK ERROR POSSIBLE DEADLOCK

CMSTSTACK OVERFL ERROR STACK OVERFLOW

OW

CMSTREFUSE ERROR REQ NOT ACCEP

CMSTNO ACTION ERROR REQ NOT ACCEP

CMSTFAILED ERROR GEN FAILURE

CMSTNOT INITED ERROR INTERNAL ERROR

CMSTNOT ACTIVE ERROR INTERNAL ERROR

CMSTNOT OPEN ERROR INTERNAL ERROR

CMSTNOT CONNECT ERROR INTERNAL ERROR

ED

CMST NOT CONSTRU ERROR INTERNAL ERROR
CTED

CMSTBAD CHKSUM ERROR CRC

CMSTNOT FOUND ERROR FILE NOT FOUND

CMSTDUPLICATE ERROR DUP NAME

CMSTBUSY ERROR BUSY

DriverMagic Win32 Status Status CMST ACCESS DENIE ERROR ACCESS DENIED

D

CMST PRIVILEGE ERROR PRIVILEGE NOT HELD

CMST SCOPE VIOLATIERROR ACCESS DENIED

ON

CMST BAD ACCESS ERROR ACCESS DENIED

CMST TIMEOUT ERROR SEM TIMEOUT

CMST CANCELED ERROR OPERATION ABORTED

CMST ERROR OPERATION ABORTED
ABORTED

CMST RESET ERROR OPERATION ABORTED

CMST CLEANUP ERROR OPERATION ABORTED

CMST OVERRIDE ERROR GEN FAILURE

CMST POSTPONE ERROR GEN FAILURE

CMST 'CANT BIND ERROR FILE NOT FOUND

CMST API ERROR ERROR INVALID FUNCTION

CMST ERROR REVISION MISMATCH
WRONG
VERSI

ON

CMST NOT IMPLEMEN ERROR INVALID FUNCTION

TED

CMST NOT SUPPORTE ERROR INVALID FUNCTION

D

CMST BAD OID ERROR INTERNAL ERROR

CMST BAD MESSAGE ERROR INTERNAL ERROR

11.4. Use Cases Synchronous //O Operation DM-FAC receives a call from the I/0 Manager and translates it into an I_DIO
operation.

If the multiplex property is non-zero, it selects the connection on the dio output (this and the next step are executed as an atomic select-and-call operation) DM-FAC invokes the operation on dio The call returns a completion status and DM FAC translates it to a Windows NT
status and completes the IRP sent by the I/O Manager.
Asynchronous llO Operation DM-FAC receives a call from the I/O Manager and translates it into an I-DIO
operation.
If the multiplex property is non-zero, it selects the connection on the dio output (this and the next step are executed as an atomic select-and-call operation) DM FAC invokes the operation on dio The call returns CMST PENDING, which indicates that the operation will be completed later. DM-FAC marks the IRP as pending and returns to I/O
Manager without completing it.
When the operation is completed, the part connected to dio invokes the I-DIO-C.complete operation on the back channel of the dio interface using the same bus that was used to start the operation (or a copy of it). DM FAC retrieves the operation's IRP pointer from the bus and reports the completion to the I/O
Manager.
DM VXFAC - VxD Device Drivel Factory Fig. 142 illustrates the boundary of the inventive DM VXFAC part.
DM VXFAC is a generic factory for Windows 95/98 VxD device drivers.
DM VXFAC translates VxD life-cycle and device I/O control events received on its drv terminal into I-DIO operations that are passed out through the dio terminal.
On driver initialization, DM VXFAC creates and parameterizes one device instance through the array control interfaces (fac and prp). Typically the device instance receives the dio operation calls generated by DM VXFAC.
Since there are no specific read and write operations for VxDs, DM VXFAC
allows read and write I/O controls to be defined for a device (specified through properties). When these I/O controls are received by DM VXFAC, they are translated into dio.read and dio.write operations. All other I/O controls are translated to dio.ioctl.
All dio operations generated by DM VXFAC may be completed synchronously or asynchronously. DM VXFAC takes care of the proper operation re-synchronization and completion.
12. Boundary 12.1. Terminals Terminal "drv" with direction "In" and contract I DRAIN. Note: Synchronous, vtable, infinite cardinality, unguarded Life cycle and I/O control VxD events are received through this terminal. The life cycle and I/O control events received here are converted into I-DIO operations sent out through the dio terminal. This terminal is compatible with the VxD package events defined in a vxd.h.
Terminal "dio" with direction "Bidir" and contract In: I DIO C Out: I DIO.
Note:
Synchronous, vtable, cardinality 1, unguarded, activetime Device I/O
operations.
DM VXFAC converts life cycle and I/O control events received from the drv terminal into I_DIO operations sent out through this terminal. The back channel is used for asynchronous completion of operations (as defined by the I DIO interface).
Terminal "fac" with direction "Out" and contract I A_FACT. Note: Synchronous, vtable, cardinality 1 Part array factory interface. This terminal is used to create, activate, deactivate and destroy a device instance. DM VXFAC creates only one device instance.
Terminal "prp" with direction "Out" and contract I A-PROP. Note: Synchronous, vtable, cardinality 1 Part array property interface for manipulating properties of device instances. See below for a list of properties that DM VXFAC sets on the created device instances.
12.2. Events and notifications Incoming Event Bus Notes EV VXD INIT B EV V VxD initialization event.
XD DM VXFAC must receive this notification during the driver initialization. DM VXFAC uses this event to create, parameterize and activate the device instance assembly.
Typically, this event is sent by the driver packaging.
EV VXD CLEANUP B EV V VxD cleanup event.
XD DM VXFAC must receive this notification before the driver is unloaded. DM VXFAC uses this event to deactivate and destroy the device instance assembly.
Typically, this event is sent by the driver packaging.
EV VXD-MESSAG B-EV V VxD life cycle and I/O control event.
E XD When the W32-DEVICEIOCONTROL message is received, DM VXFAC translates the open/close requests (DIOC OPEN and DIOC CLOSEHANDLE) and I/O controls into I-DIO operations that are passed through the dio terminal.
DM VXFAC is parameterized with the I/O controls that represent read and write operations on the device. All other I/0 controls are translated into dio.ioctl.
Typically, this event is sent by the driver packaging.
12.3. Special events, frames, commands or verbs None.
12.4. Properties Property "dflt class name" of type "ASCIZ". Note: Default class name of the device instance assembly. This is the class name to use when creating device instances.
DM VXFAC creates the instance when it receives an EV VXD INIT event on the drv terminal. DM VXFAC only uses this property if the class-name property is empty (""). This property is provided for compatibility with the Windows NT factory (DM FAC). Default value is "FW DEV".

Property "class-name" of type "ASCIZ". Note: Class name of the device instance assembly. This is the class name to use when creating device instances. DM
VXFAC
creates the instance when it receives an EV VXD INIT event on the drv terminal. If this property is not equal to "", DM VXFAC always uses this class name for the device instance. Default value is "" (dflt class name is used).
Property "status xlat" of type "UINT32". Note: Specifies how DM VXFAC
translates return statuses that are propagated back up to user mode (Win32). Possible values are 0 (standard Win32 error codes), 1 (standard Win32 error codes and custom error codes), 2 (custom error codes only) and 3 (always return success). See the Mechanisms section for more information. Default value is 0.
Property "ioctl-read" of type "UINT32". Note: I/O control code for read operations.
When this I/O control code is received by DM VXFAC, it converts it into an dio.read operation. Default value is 0 (none).
Property "ioctl write" of type "UINT32". Note: I/O control code for write operations.
When this I/O control code is received by DM VXFAC, it converts it into an dio.write operation. Default value is 0 (none).
Property "ioctl stat offs" of type "UINT32". Note: Operation completion status offset. This is the offset (in bytes) into the I/0 control data block where the operation's completion status is stored. If -1, DM VXFAC does not copy the completion status for the operation into the I/0 control data block. The size of the storage for the completion status is 4 bytes (unsigned long). Default value is 0 (first field in data block).
Property "cplt wait type" of type "UINT32". Note: Asynchronous completion semaphore flags. These flags control what actions to take when interrupts occur while DM VXFAC is waiting for an asynchronous open/cleanup/close operation to complete. Default is BLOCK THREAD-IDLE.
Property "reg-root" of type "ASCIZ". Note: Registry root path. This is the registry path for the devices registry settings. This path is relative to HKEY LOCAL MACHINE. Default value is "".

12.5. Properties Provided by DM VXFAC to Device Instances The following optional properties are set on the device instance immediately after it is created through the fac terminal:
Property "reg root" of type "ASCIZ". Note: Path to the device's registry settings.
DM VXFAC gets the value for this property from its reg root property (pass-through property). This path is relative to HKEY-LOCAL-MACHINE.
13. Encapsulated interactions DM VXFAC uses the following APIs from VtooIsD for asynchronous operation completion, mutex and semaphore usage:
VWIN32_DIOCCompIetionRoutine() CreateMutex() DestroyMutex() EnterMutex() LeaveMutex() Create Semaphore() Destroy Semaphorel) Wait Semaphorel) Signal Semaphore-No Switch() LinPageLock() LinePageUnlock() 14. Specification 15. Responsibilities On EV VXD-INIT: create, parameterize and activate a single device instance (through the fac and prp terminals). Create only one device instance.
On EV VXD CLEANUP: deactivate and destroy the device instance (through the fac terminal).
On DIOC_OPEN control message (EV VXD-MESSAGE): generate a dio.open operation call. If operation completes asynchronously (returns CMST PENDING), wait on a semaphore until the operation is complete.

On DIOC_CLOSEHANDLE control message (EV VXD-MESSAGE): generate dio.cleanup and dio.close operation calls. If operations are asynchronous (return CMST-PENDING) wait on a semaphore until the operations complete.
When the read or write I/O control is received (through the EV VXD_MESSAGE
event), generate dio.read and dio.write operations respectively.
On all I/O controls other then DIOC OPEN, DIOC CLOSEHANDLE, read or write;
generate a dio.ioctl operation.
Allow asynchronous completion of all I-DIO operations.
On dio.complete: retrieve the completion status from B DIO, translate the completion status and complete the operation.
Translate the completion status for both synchronous and asynchronous operations according to the status xlat property.
Handle all unrecognized control messages received on drv (all except W32-DEVICEIOCONTROL) by returning CMST-NOT SUPPORTED without entering any critical sections or enabling interrupts.
16. Theory of operation 16.1. Main data structures DlOCParams (system-defined) DM VXFAC expects to receive a valid pointer to a DIOCParams structure with the EV VXD-MESSAGE event, W32-DEVICEIOCONTROL message. It copies most of the fields of this structure to a B-DIO bus passed with the corresponding I-DIO
operation. Upon operation completion, DM VXFAC fills in the number of bytes returned in the output buffer (IpcbBytesReturned field).
OVERL4PPED (system-definedl DM VXFAC expects to receive a valid pointer to an OVERLAPPED structure with the EV VXD-MESSAGE event, W32 DEVICEIOCONTROL message for devices using overlapped I/O. The Win32 event contained in this structure is signaled by the operating system when a pending operation has completed.

16.2. Mechanisms Driver initialization and c%anup When the VxD containing DM VXFAC is loaded (or is opened using CreateFile()), DM VXFAC receives a EV VXD-INIT event. In response to this event, DM VXFAC
creates an instance of the device's class (specified by the class_name property).
DM VXFAC then parameterizes and activates the instance. DM VXFAC enforces that only one instance of the driver's class may exist at any time - DM VXFAC fails additional EV VXD INIT events.
When the VxD is unloaded (or is closed using CIoseHandlel) or DeleteFile()), DM VXFAC receives an EV VXD CLEANUP event. In response to this event, DM VXFAC deactivates and destroys the device instance. Additional EV VXD CLEANUP events are ignored.
Dispatching openlclose operations to device instances When the device is opened using the CreateFile() Win32 API, DM VXFAC
receives a DIOC OPEN message (through the EV VXD_MESSAGE event).
DM VXFAC fills out a B_DIO bus and translates this message into a dio.open operation.
When the device is closed using the CIoseHandlel) Win32 API, DM VXFAC
receives a DIOC CLOSEHANDLE message (through the EV VXD-MESSAGE event).
DM VXFAC fills out a B-DIO bus and translates this message into dio.cleanup and dio.close operations.
If the dio.open, dio.cleanup or dio.close operations complete asynchronously (return CMST-PENDING), DM VXFAC waits on a semaphore until the operation completes. When dio.complete is called to complete the pending operation, the semaphore is signaled and DM VXFAC completes the operation. This is~ necessary because the open and close operations issued by the operating system must complete synchronously.
Dispatching llO control operations to device instances I/0 control operations are sent as EV VXD MESSAGE events (W32-DEVICEIOCONTROL message) when an application uses the DevicelOControl() Win32 API. The application is expected to pass a pointer to the following structure as the input and output buffers for the I/O control:
typedef struct XXX
unsigned long cplt s ; // IOCTL completion status unsigned long reserved ; // reserved for internal use // additional I/O control data here } XXX;
// nb: no equivalent functionality is provided by the Windows // NT device driver factory.
The first two fields must be the completion status and a reserved field.
Additional fields may be added depending on the operation of the I/O control.
The cplt s field is used to store the operation completion status. For asynchronous operations (Overlapped I/O), DM VXFAC returns pending status (DevicelOControl() returns FALSE and GetLastErrorl) _ = ERROR 10 PENDING).
When the operation completes, DM VXFAC copies the operation completion status into the I/O control structure.
When DM VXFAC receives the I/O control, it checks if the I/0 control code is equal to ioctl read or ioctl write. If so, DM VXFAC generates dio.read and dio.write operations respectively. All other I/O controls are translated into dio.ioctl operations.
I/O control operations may be processed synchronously or asynchronously. , For synchronous and asynchronous operations, DM VXFAC always updates the cplt s field with the completion status of the operation (if ioctl stat offs !
_ -1 ). This allows a driver to fail an asynchronous operation; the application checks the cplt s field for the completion status.
Translating DriverMagic status codes DM VXFAC translates CMST xxx status codes (that are returned from invoking operations on the dio terminal - synchronous or asynchronous) into Win32 status codes or custom status codes defined by the user. These codes are then propagated up to the user mode environment (Win32).
The status translation is controlled through the status xlat property. This property may have one of the following values:
0: Standard Win32 status codes only (see status table below) 1: Standard Win32 status codes and custom status codes 2: Custom (user-defined) status codes only 3: Success status always If translating to standard Win32 status codes (status xlat is 0 or 1 ), DM
VXFAC
uses a status table that maps CMST xxx statuses to Win32 statuses.
If the CMST xxx status code is not found in the table, either the status is mapped to ERROR GEN-FAILURE (status xlat is 0) or it is mapped to a custom status (status xlat is 1 ) by ORing the status code with OxE0000000 (this tells the operating system that this is a user-defined status code - the operating system passes the code up to user mode without modification).
If status xlat is 2, the status codes are always user-defined and are ORed with OxE0000000 as described above. In this case, DM VXFAC does not use the table to map the, status codes. In user mode, the Win32 status code can be ANDed with 0x1 FFFFFFF to extract the user-defined status code.
If status xlat is 3, DM VXFAC always returns success (NO ERROR) for the operation. A Win32 application can check the status code by checking the completion status in the operation bus (cplt s). This field will always contain the status returned by the operation ORed with OxE0000000. This type of status translation is provided since there is no way to return errors for asynchronous operations.
Note that the status translation does not apply to DIOC OPEN and DIOC CLOSEHANDLE.
Below is a table showing the mapping of the DriverMagic status codes to Win32 (user mode) status codes:
DriverMagic Status Win32 Status DriverMagic Status Win32 Status CMST OK NO ERROR
CMST ALLOC ERROR NOT ENOUGH MEMOR
Y
CMST NO ROOM ERROR NO SYSTEM RESOUR
CES
CMSTOVERFLOW ERROR INSUFFICIENT BUFFER

CMSTUNDERFLOW ERROR INVALID PARAMETER

CMSTEMPTY ERROR NO DATA

CMSTFULL ERROR DISK FULL

CMSTEOF ERROR HANDLE EOF

CMSTINVALID ERROR INVALID PARAMETER

CMSTBAD VALUE ERROR INVALID PARAMETER

CMSTOUT OF RANGE ERROR INVALID PARAMETER

CMSTNULL PTR ERROR INVALID PARAMETER

CMSTBAD SYNTAX ERROR INVALID PARAMETER

CMSTBAD NAME ERROR INVALID PARAMETER

CMSTUNEXPECTED ERROR INTERNAL ERROR

CMSTPANIC ERROR INTERNAL ERROR

CMSTDEADLOCK ERROR POSSIBLE DEADLOCK

CMSTSTACK OVERFL ERROR STACK OVERFLOW

OW
CMSTREFUSE ERROR REQ NOT
ACCEP

CMSTNO ACTION ERROR REQ NOT ACCEP

CMSTFAILED ERROR GEN FAILURE

CMSTNOT INITED ERROR INTERNALERROR

CMSTNOT ACTIVE ERROR INTERNALERROR

CMSTNOT OPEN ERROR INTERNALERROR

CMSTNOT CONNECT ERROR INTERNALERROR

ED

DriverMagic Win32 Status Status CMST NOT CONSTRU ERROR INTERNAL ERROR

CTED

CMST BAD CHKSUM ERROR CRC

CMST NOT FOUND ERROR FILE NOT FOUND

CMST DUPLICATE ERROR DUP NAME

CMST BUSY ERROR BUSY

CMST ERROR ACCESS DENIED
ACCESS
DENIE

D

CMST PRIVILEGE ERROR PRIVILEGE NOT HELD

CMST SCOPE VIOLATIERROR ACCESS DENIED

ON

CMST BAD ACCESS ERROR ACCESS DENIED

CMST TIMEOUT ERROR SEM TIMEOUT

CMST CANCELED ERROR OPERATION ABORTED

CMST ERROR OPERATION ABORTED
ABORTED

CMST RESET ERROR OPERATION ABORTED

CMST CLEANUP ERROR OPERATION ABORTED

CMST OVERRIDE ERROR GEN FAILURE

CMST POSTPONE ERROR GEN FAILURE

CMST CANT BIND ERROR FILE NOT FOUND

CMST API ERROR ERROR INVALID FUNCTION

CMST ERROR REVISION MISMATCH
WRONG
VERSI

ON

CMST NOT IMPLEMEN ERROR INVALID FUNCTION

TED

CMST NOT SUPPORTE ERROR INVALID FUNCTION

D

DriverMagic Status Win32 Status CMST BAD OID ERROR INTERNAL ERROR
CMST BAD MESSAGE ERROR INTERNAL ERROR
16.3. Use Cases Driver initialization The VxD containing DM VXFAC is loaded, either at boot time (static VxD) or on a call to CreateFile() (dynamic VxD).
DM VXFAC receives an EV VXD-INIT message on its drv terminal.
DM VXFAC checks if an instance of the device has already been created, if so DM VXFAC returns CMST FAILED.
DM VXFAC creates an instance of the device.
DM VXFAC parameterizes the device instance with the registry path for the device settings (reg-root property).
DM VXFAC activates the device instance and returns CMST OK.
Driver cleanup The VxD containing DM VXFAC is unloaded, either at system shutdown (static VxD) or on a call to CIoseHandlel) (dynamic VxD).
DM VXFAC receives an EV VXD_CLEANUP message on its drv terminal.
DM VXFAC checks if the device instance has already been destroyed, if so DM VXFAC returns CMST OK.
DM VXFAC deactivates and destroys the device instance.
DM VXFAC returns CMST OK.
Synchronous Operations DM VXFAC receives an EV VXD MESSAGE event on its drv terminal and translates it into an I_DIO operation. .
DM VXFAC invokes the proper operation on dio (open, close, cleanup, read, write or ioctl).
The call returns a completion status and DM VXFAC translates it to a Win32 status. If operation is read, write or ioctl DM VXFAC copies the translated status into the cplt s field of the I/O control data block and updates the number of bytes copied to the output buffer.
DM VXFAC completes the operation.
Asynchronous openlc%se Operations DM VXFAC receives an EV VXD MESSAGE event (for DIOC OPEN or DIOC CLOSEHANDLE) on its drv terminal and translates it into an I DIO
operation.
DM VXFAC invokes the proper operation on dio (open, close or cleanup).
The invoked operation returns CMST-PENDING to indicate asynchronous completion.
DM VXFAC waits on a semaphore until the operation has completed.
At a later time, the dio.complete operation is invoked on DM VXFAC to indicate the pending operation has completed. DM VXFAC then signals the semaphore.
DM VXFAC wakes up from waiting on the semaphore and completes the life-cycle operation.
Asynchronous ilO Operations DM VXFAC receives an EV VXD MESSAGE event (read, write or other I/O
controls) on its drv terminal and translates it into an I DIO operation.
DM VXFAC invokes the proper operation on dio (read, write or ioctl).
The invoked operation returns CMST-PENDING to indicate asynchronous completion.
DM VXFAC returns -1 to the operating system to indicate the operation is pending (Overlapped I/0).
At a later time, the dio.complete operation is invoked on DM VXFAC to indicate the pending operation has completed.
DM VXFAC translates the completion status as specified by the status xlat property and updates the completion status in the I/O control data block.
DM VXFAC passes the number of bytes copied to the output buffer in the DIOCParams structure received with the I/0 control.

DM VXFAC completes the pending operation by invoking VWIN32-DIOCCompIetionRoutine().
17. Notes DM VXFAC expects that all recognized events received through the drv terminal are received while the interrupts are enabled. For all unrecognized events, DM VXFAC does not assume that the interrupts will be enabled; it returns immediately without any operation.
DM VXFAC allows only one file to be open at any time. DM VXFAC fails additional open requests. DM VXFAC may be updated in the. future to handle mutliple nested open requests.
For all I/0 control requests, DM VXFAC maps user mode buffers into kernel mode address space before forwarding I_DIO operations through the dio terminal. For all IOCTL requests other then read and write, DM VXFAC always maps the output buffer passed to DeviceloControll). The buffer mapping is done by using the LinPageLock() and LinPageUnlock() kernel mode API.
DM VXFAC uses buffered I/O for all operations, but DM VXFAC always maps the user's buffers into the kernel mode address space. This buffer mapping forces all operations to use direct I/O, even though it's buffered I/O from the operating system standpoint.
The B DIO bus DM VXFAC passes to each I DIO operation is allocated on the stack of the current execution context. If an operation is to be completed asynchronously, DM VXFAC expects that the B-DIO bus will be duplicated and passed back to dio.complete when the operation has completed.
The B_DIO.irpp field is used internally by DM VXFAC. DM VXFAC expects that this field is not modified by the device instance and is passed back to dio.complete for the completion of asynchronous operations.
DM VXFAC never fails DIOC OPEN messages even if the I-DIO.open operation generated by DM VXFAC fails. This is due to the behavior of the Windows 95/98 operating system. However, DM VXFAC keeps an "open" state on the device instance. If an open attempt does fail, DM VXFAC fails all I/O controls sent to the device until it is either opened successfully or closed. DM VXFAC
passes additional open attempts until success.
For asynchronous, overlapped I/0 operations, it is not advised to complete these operations while the interrupts are disabled. This is because DM VXFAC during dio.compete needs to free the operation completion context by calling cm bus free().
In doing so, the interrupts become enabled which could cause unpredictable results.
Enumerators DM REN - Device Enumerator on Registry Fig. 143 illustrates the boundary of the inventive DM REN part.
DM_REN is a registry-based device enumerator specifically designed to work in Windows NT kernel-mode. DM-REN is parameterized with the driver root registry key (as a string).
Upon activation of DM REN, the edev terminal provides enumeration of devices as defined in Param\Devices subkey of the root registry key; the eprp terminal provides enumeration of the persistent properties for each device obtained through edev.
The properties manipulated through the eprp terminal cannot be modified (set operation will fail).
Full registry path to the specified device key can be obtained from DM REN by reading a property on its boundary. The enumeration ID received from the device is used for identifying the particular device instance.
DM REN supports multiple simultaneous queries for devices and properties on a device.
DM-REN does not modify or delete any information from the registry.
This part is available only in Windows NT/95/98 Kernel Mode environments.
1. Boundary 1.1. Terminals Terminal "edev" with direction "In" and contract I DEN. Note: DM REN receives queries for enumerating the installed devices.

Terminal "eprp" with direction "In" and contract I A PROP. Note: DM REN
receives queries for obtaining the specific properties information for an installed device.
1.2. Events and notifications None.
1.3. Special events, frames, commands or verbs None 1.4. Properties Property "reg root" of type "UNICODEZ". Note: Specifies a root Registry key name.
The device instance keys are stored into its Parameters\Devices sub-key. This property is mandatory.
Property "dev name base" of type "UNICODEZ". Note: This property is used as the base for making device names. The name is created as:
\Device\ < device name base > < dev subkey >
2. Encapsulated interactions DM-REN relies on following services from the Windows NT kernel mode support routines:
-ZwOpenKey - open an existing key in the registry -ZwEnumerateKey - to enumerate all existing sub-keys -ZwQueryValueKey - to obtain the current value of the specified value entry -ZwEnumerateValueKey - to enumerate all value entries of the opened registry key -ZwClose - close previously opened registry key -Initialize0bjectAttributes - used to initialize the object attributes needed for the subsequent call to ZwOpenKey 3. Specification 4. Responsibilities 1. Implement the I-DEN interface by enumerating the Parameters\Devices sub-key of the driver's Registry key, specified by the reg-root property.
2. Provide the following data for each device instance:
- class name for the device instance - registry path to device's settings - Win32 names) to associate with the device - device name (in kernel-mode name space) 3. Implement I A-PROP interface. Supports all property enumeration functionality and property get calls. Does not support changing of the property values. Only one property is supported - reg-root.
5. Theory of operation 5.1. State machine None.
l0 5.2. Main data structures None.
5.3. Mechanisms Creating a unique Identifier for the device instances When DM-REN enumerates all device registry keys under driver registry key, it gives them a unique identifier. The identifier is used for obtaining the properties for the selected device (after the enumeration). DM-REN identifies the devices by creating a unique ID using the enumeration index. The sequence of creating this unique ID follows:
1. Get the least significant 16-bits from the enumeration index 2. Make 8-bits check sum (XOR) of all characters in the Registry key name.
3. Combine into one DWORD the least significant byte of the Registry name length, the calculated check sum and the least significant word (16-bits) from the device enumeration index. This DWORD will be the device identifier.
Create a query handler DM-REN uses CIassMagic~" handles with an owner key to keep track of all open queries. DM-REN allocates a memory buffer to keep some query information and store the pointer to this buffer into the handler context. When DM-REN is destroyed, it enumerates the handles with its own key and releases all allocated resources.
DM PEN - PCl Device Enumerator Fig. 144 illustrates the boundary of the inventive DM-PEN part.

DM_PEN a DriverMagic~" part, which is specifically designed to work in Windows NT kernel-mode. It enumerates PCI devices using specific criteria.
Before its activation, DM-PEN receives the name of the driver root registry key -reg root, pointer to the driver object associated with this device - drv objp and device and vendors IDs and masks. Using the specified information, it locates all devices of a specified class on a PCI bus. DM PEN collects information about the resources of the devices, initializes them if necessary and gives a unique name to each of them. Some of the resources are obtained by reading the information stored into Parameters\Devices sub-key of the reg root key. If those keys are not set in the Registry, the device will use their default values. DM-PEN can work properly even without having this information set in the Registry.
When DM-PEN receives an enumeration query through edev terminal, it returns an id, which is used as an identifier for the particular device instance. This id shall be used for property enumeration the eprp terminal. The identifier is valid only through the DM PEN lifecycle.
DM PEN supports property enumeration calls through its eprp terminal. It does not support the property "set" operation from the I A-PROP interface. DM-PEN
supports multiple properties with the same name. For those properties, a two digit decimal number is added at the end of the name.
DM PEN supports multiple simultaneously open enumeration queries for both types - device and property queries.
NOTE: The initialization and activation of this component must be running at IRQL
PASSIVE LEVEL.
6. Boundary 6.1. Terminals Terminal "edev" with direction "in" and contract In: I DEN. Note: DM PEN
receives queries for enumerating the installed devices.
Terminal "eprp" with direction "in" and contract In:
I A-PROP. Note: DM-PEN receives queries for obtaining the specific properties information for an installed device.

6.2. Events and notifications DM-PEN has no incoming and outgoing events and notifications.
6.3. Special events, frames, commands or verbs None 6.4. Properties Property " reg root" of type "unicodez". Note: Specifies the root Registry key name for the driver. The device instance keys are stored into its Parameters\Devices sub-key. This property is mandatory.
Property " drv objp" of type "uint32". Note: pointer to the driver object.
l0 Property " dev name base" of type "unicodez". Note: This property is used as the base for making device names. The name is created as:
\Device\ < device name base > n Where n is the sequential number of the device during the device enumeration This property is mandatory.
Property " vendor id" of type "uint32". Note: Vendor ID. This property is mandatory.
Property " vendor-id-mask" of type "uint32". Note: Vendor ID mask. The default is OxFFFFFFFF
Property " device-id" of type "uint32". Note: Device ID. This property is mandatory.
Property " device_id-mask" of type "uint32". Note: Device ID mask. The default is OxFFFFFFFF
Property " subsys vendor id" of type "uint32". Note: Subsystem Vendor ID. This property is mandatory.
Property " subsys vendor-id-mask" of type "uint32". Note: Subsystem Vendor ID
mask. The default is OxFFFFFFFF
Property " subsys device_id" of type "uint32". Note: Subsystem device ID. This property is mandatory.
Property " subsys device id-mask" of type "uint32". Note: Subsystem device ID
mask. The default is OxFFFFFFFF
6.5. Properties exported through eprp terminal.
Property "bus" of type "uint32". Note: device bus number Property "slot" of type "uint32". Note: device slot number Property "vendor-id" of type "uint32". Note: Vendor ID.
Property "device-id" of type "uint32". Note: Device ID.
Property "subsys vendor id" of type "uint32". Note: Subsystem Vendor ID
Property "subsys device id" of type "uint32". Note: Subsystem Device ID
Property "reg root" of type " unicodez". Note: registry path to the specified device instance key (per device instance) Property "class-name" of type "asciiz". Note: class name of part to be created for handling this device instance Property "device name" of type "unicodez". Note: name to use for registering the device Property "friendly name" of type "unicodez". Note: Win32 alias (does not include the \??\ prefix) Property "port-base" of type "BINARY (uint64)". Note: I/O port base. (8-byte physical address). Could be more than 1 per device.
Property "port length" of type "uint32". Note: Specifies the range of the I/O
port base. Could be more than 1 per device.
Property "mem-base" of type "BINARY (uint64)". Note: The physical and bus-relative memory base (8-byte physical address). Could be more than 1 per device.
Property "mem-length" of type "uint32". Note: Specifies the range of the memory base.. Could be more than 1 per device.
Property "irq level" of type "uint32". Note: Bus-relative IRQL. Could be more than 1 per device.
Property "irq vector" of type "uint32". Note: Bus-relative vector. Could be more than 1 per device.
Property "irq affinity" of type "uint32". Note: Bus-relative affinity. Could be more than 1 per device.
Property "dma channel" of type "uint32". Note: DMA channel number. Could be more than 1 per device.
Property "dma-port" of type "uint32". Note: MCA-type DMA port. Could be more than 1 per device.

7. Encapsulated interactions DM-PEN relies on following services from the Windows NT kernel mode support routines:
HaIGetBusData - obtains details about a given slot or address on a particular I/O
bus. By changing this function's parameters, it is possible to scan all devices.
HalAssignSIotResources - determines the resource requirements of the target device, allocates them, initializes the target device with its assigned resources, and returns the assignments to the caller.
IoAssignResources - erase the claim on resources (made by HalAssignSIotResources) in the registry when the driver is unloaded.
HaITransIateBusAddress - translates a bus-specific address into the corresponding system logical address.
8. Packaging and environment dependencies DM PEN is a DriverMagic~" part for use in a Windows NT kernel-mode driver.
9. Specification 10. Responsibilities 1. Implement the I-DEN interface by searching for PCI devices using various criteria, such as Vendor ID, Device ID, etc.
2. Obtain device specific information from the Parameters\Devices sub-key of the driver's Registry key, specified by the reg root property.
3. Provide the following data for each device instance:
- class name for the device instance - Win32 names) to associate with the device device name (in kernel-mode name space) 4. Allocate resources for every device 5. Implement I A-PROP interface. Supports all property enumeration functionality and property get calls. Support multiple properties with the same name. Does not support changing of the property values.

11. Theory of operation 11.1. State machine DM PEN has no state machine 11.2. Main data structures ~ Device Table - table consists of all resource information for each enumerated device.
11.3. Mechanisms Creating a unique Identifier for the device instances When DM-PEN enumerates all device registry keys under driver registry key, it l0 gives them a unique identifier. The identifier is used for obtaining the properties for the selected device (after the enumeration). DM-PEN uses DriverMagic~" handles with an owner key to identify the specific device instance.
Creating a query handle DM_PEN uses DriverMagic~" handles with an owner key to keep track of all open queries. DM-PEN allocates a memory buffer to keep some query information and store the pointer to this buffer into the handle context. When DM-PEN is destroyed, it enumerates the handles with its own key and releases all allocated resources.
Creating a device name The device name has the follow structure:
\Device\dev name basen Where dev name base is a property supplied by the caller and n is a sequential number of discovering the device.
Note: n starts from 1.
Creating a device instance reg root path The device reg root path is created by adding to the driver reg root path \Parameters\Devices\nnnn. Where nnnn is a four digit decimal number with leading zeros. It has the same meaning as n in device name creation. E.g. the device reg root has the following format:
< driver reg root > \Parameters\Devices\nnnn Creating a class name for the device The device class name is obtained from DevPartClass Registry key under device reg root tree. If this key is not set (from the installer), the class name will be an empty string.
Creating a device friendly name The device class name is obtained from FriendiyName Registry key under device reg root tree. If this key is not set (from the installer) the device name is used instead.
12. Unresolved issues If multiple PCI devices are installed in the system, there is no reliable way to keep persistent data associated with each device. If the devices are moved to different slots on the PCI bus, a reconfiguration of the devices' parameters will be necessary.
Note that this is a problem with Plug-and-Play devices in general, not a problem with the PCI enumerator.
DM PCEN - PCMClA Device Enumerator Fig. 145 illustrates the boundary of the inventive DM-PCEN part.
DM-PCEN a DriverMagic~" part that is specifically designed to work in Windows NT kernel-mode. It enumerates PCMCIA devices using specific criteria.
Before its activation, DM PCEN receives as properties the name of the device manufacturer and the device model name. Using this information, it locates all matching PCMCIA devices installed in the system. DM-PCEN collects information about the resources of the devices and gives a unique name to each of them.
Some of the resources are obtained by reading the information stored into Parameters\Devices sub-key of the reg-root key. If those keys are not set in the Registry, the device will use their default values. DM-PCEN can work properly even without having this information set in the Registry.
When DM-PCEN receives an enumeration query through edev terminal, it returns an ID, which is used as an identifier for the particular device instance. This ID is used for property enumeration through the eprp terminal. The identifier is valid only through the DM-PCEN instance lifetime.

DM-PCEN supports property enumeration calls through its eprp terminal. It does not support the property set operation from the I A PROP interface. DM PCEN
supports multiple properties with the same name. For those properties, a two digit decimal number is added at the end of the name.
DM-PCEN supports multiple simultaneously open enumeration queries for both types - device and property queries.
Since the PCMCIA support in Windows NT 4.0 does not allow more than one PCMCIA card with the same manufacturer/device name pair, the enumerator can find either zero or one PCMCIA devices.
l0 13. Boundary 13.1. Terminals Terminal "edev" with direction "in" and contract In: I DEN. Note: DM PCEN
receives queries for enumerating the installed devices.
Terminal "eprp" with direction "in" and contract In: I A_PROP. Note: DM_PCEN
receives queries for obtaining the specific properties information for an installed device.
13.2. Events and notifications DM-PCEN has no incoming and outgoing events and notifications.
13.3. Special events, frames, commands or verbs None 13.4. Properties Property "reg-root" of type "unicodez". Note: Specifies the root Registry key name for the driver. The device instance keys are stored into its Parameters\Devices sub-key. This property is mandatory.
Property "manufacturer" of type "unicodez". Note: Device manufacturer name.
This property is mandatory.
Property "device" of type "unicodez". Note: Device model name. This property is mandatory.

13.5. Properties exported through the eprp terminal Property "bus" of type "uint32". Note: device bus number Property "slot" of type "uint32". Note: device slot number Property "manufacturer" of type "unicodez". Note: device manufacturer name Property "device" of type "unicodez". Note: device model name Property "reg_root" of type "unicodez". Note: registry path to the specified device instance key (per device instance) Property "class name" of type "asciiz". Note: class name of part to be created to handle this device instance (may be empty) Property "device_name" of type "unicodez". Note: name to use for registering the device Property "friendly name" of type "unicodez". Note: Win32 alias (does not include the \??\ prefix) Property "port-base" of type "BINARY (uint64)". Note: I/O port base. (8-byte physical address). Could be more than 1 per device.
Property "port length" of type "uint32". Note: Specifies the range of the I/O
port base. Could be more than 1 per device.
Property "mem base" of type "BINARY (uint64)". Note: The physical and bus-relative memory base (8-byte physical address). Could be more than 1 per device.
Property "mem-length" of type "uint32". Note: Specifies the range of the memory base.. Could be more than 1 per device.
Property "irq-level" of type "uint32". Note: Bus-relative IRQL. Could be more than 1 per device.
Property "irq vector" of type "uint32". Note: Bus-relative vector. Could be more than 1 per device.
Property "irq affinity" of type "uint32". Note: Bus-relative affinity. Could be more than 1 per device.
Property "dma channel" of type "uint32". Note: DMA channel number. Could be more than 1 per device.

Property "dma-port" of type "uint32". Note: MCA-type DMA port. Could be more than 1 per device.
14. Encapsulated interactions DM-PCEN~ relies on following services from the Windows NT kernel mode support 'routines:
ZwOpenKey - open an existing key in the registry ZwEnumerateKey - to enumerate all existing sub-keys ZwQueryValueKey - to obtain the current value of the specified value entry ZwEnumerateValueKey - to enumerate all value entries of the opened registry key to ZwClose - close previously opened registry key InitializeObjectAttributes - used to initialize the object attributes needed for the subsequent call to ZwOpenKey HaITransIateBusAddress - translates a bus-specific address into the corresponding system logical address.
15. Packaging and environment dependencies DM-PCEN is a DriverMagic~" part for use in a Windows NT kernel-mode driver.
16. Specification 17. Responsibilities 1 . Implement the I-DEN interface by searching for PCMCIA devices 2o using the manufacturer/device criteria.
2. Obtain device specific information from the Parameters\Devices sub-key of the driver's Registry key, specified by the reg-root property.
3. Provide the following data for each device instance:
- class name for the device instance - Win32 namels) to associate with the device - device name (in kernel-mode name space) 4. Obtain device resources from '\Registry\Machine\Hardware\Description\System\PCMCIA PCCARDs' registry key 5. Implement I A-PROP interface. Supports all property enumeration functionality and property get calls. Support multiple properties with the same name. Does not support changing of the property values.
18. Theory of operation 18.1. State machine DM PCEN has no state machine 18.2. Main data structures Device Table - a table that consists of all. resource information for each enumerated device.
18.3. Mechanisms Obtaining Device resurces DM PCEN search the Registry key '\Registry\Machine\Hardware\Description\System\PCMCIA PCCARDs' for the value with matched the device name (see Creating a device name below). This registry value contains REG FULL RESOURCE DESCRIPTOR, which contains all allocated for the specific device resource.
Creating a unique Identifier for the device instances When DM-PCEN enumerates all device registry keys under driver registry key, it gives them a unique identifier. The identifier is used for obtaining the properties for the selected device (after the enumeration). DM-PCEN uses DriverMagic~' handles with an owner key to identify the specific device instance.
Creating a query handle DM-PCEN uses DriverMagic~" handles with an owner key to keep track of all open queries. DM PCEN allocates a memory buffer to keep some query information and store the pointer to this buffer into the handle context. When DM-PCEN is destroyed, it enumerates the handles with its own key and releases all allocated resources.
Creating a device name As device name is used the value of the Registry value '\Registry\Machine\CurrentControlSet\Services\PCMCIA\DataBase\ < manufacturer > \
< device > \Driver' Creating a device instance reg root path The device reg-root path is created by adding to the driver reg-root path \Parameters\Devices\nnnn. Where nnnn is a four digit decimal number with leading zeros. It has the same meaning as n in device name creation. The device reg root has the following format:
< driver reg root > \Parameters\Devices\nnnn Creating a class name for the device The device class name is obtained from DevPartCiass registry key under device reg-root tree. If this key is not set (by the installer), the class name will be an empty l0 string. ' Creating a device friendly name The device class name is obtained from FriendlyName registry key under device reg-root tree. If this key is not set (by the installer) the device name is used instead.
19. Unresolved issues 1. If multiple PCMCIA devices are installed in the system, there is no reliable way to keep persistent data associated with each device. If the devices are moved to different socket on the PCMCIA adapter, a reconfiguration of the devices' parameters will be necessary.
The above note is largely irrelevant since the PCMCIA support in Windows NT
4.0 does not provide for multiple instances of the same PCMCIA device in the system.
Registrars DM SGR - Singleton Registrar Fig. 146 illustrates the boundary of the inventive DM SGR part.
DM SGR is used to register its host assembly under a given name and to make it available for binding. Assemblies of this type are known as singletons.
On activation, DM SGR registers its host assembly under a given name (parameterized through the name property). The instance name may only be registered once. If the host assembly is instantiated more then once, DM SGR
activation fails.

DM SGR can be disabled by simply removing the part from its host assembly or for convenience, by setting the name property to "".
DM-SGR has no terminals and does not contain any functionality except on activation.
1. Boundary 1.1. Terminals None.
1.2. Events and notifications None.
1.3. Special events, frames, commands or verbs None.
1.4. Properties Property "name" of type "ASCIZ". Note: Specifies the instance name that DM
SGR's host assembly should be registered under. Instance name must be less then 128 characters. If name is "" DM SGR is disabled and does nothing. Default value is "".
2. Encapsulated interactions None.
3. Specification 4. Responsibilities 27. Register the host assembly by the specified name (name property) to make it available for binding.
28. Prevent its host assembly from being instantiated more then once.
5. Theory of operation 5.1. State machine None.
5.2. Main data structures None.

5.3. Mechanisms Preventing host assembly from multiple instantiations On activation, if the name property is "", DM SGR does nothing and returns CMST-OK. In this case, the host assembly may be instantiated more then once.
Otherwise, DM SGR registers the instance name with the object ID of its containing assembly.
When the assembly is instantiated for the first time, the instance name registration and DM-SGR's activation succeeds. If the same assembly is instantiated more then once, DM SGR's activation fails with CMST DUPLICATE (instance names may only be registered once).
DM-SGR deregisters the instance name on deactivation.
5.4. Use Cases Implementing a singleton assembly 1. The singleton assemblies part table contains the DM-SGR part along with any other parts the assembly uses.
2. The DM SGR part is parameterized with an instance name for the assembly (e.g., hard parameterization).
3. The assembly is created and activated (there are no connections to DM SGR).
4. DM SGR registers the instance name with the object ID of the assembly and its activation succeeds.
5. Any additional attempts to create and activate the singleton assembly a second time will fail with CMST DUPLICATE.
The assembly is deactivated and destroyed. DM SGR deregisters the instance name on deactivation.
DM DSTK - Device Stacker Fig. 147 illustrates the boundary of the inventive DM-DSTK part.
DM_DSTK can be used in a WDM/NT driver to attach devices created by the DriverMagic NT or WDM device factory (DM FAC) to lower level device drivers.

DEMANDE OU BREVET VOLUMINEUX
LA PRESENTE PARTIE DE CETTE DEMANDE OU CE BREVET COMPREND
PLUS D'UN TOME.

NOTE : Pour les tomes additionels, veuillez contacter 1e Bureau canadien des brevets JUMBO APPLICATIONS/PATENTS
THIS SECTION OF THE APPLICATION/PATENT CONTAINS MORE THAN ONE
VOLUME

NOTE: For additional volumes, please contact the Canadian Patent Office NOM DU FICHIER / FILE NAME
NOTE POUR LE TOME / VOLUME NOTE:

Claims (133)

What is claimed is:
1. A method for designing a software system in which system at least a first object is created arbitrarily earlier than a second object and said second object is automatically connected to at least said first object, said method comprising the steps of:
creating said first object;
creating a first container object capable of holding at least one other object of arbitrary object class;
defining at least a first template connection between said first object and said first container object;
creating said second object;
connecting said second object to said first object using said first template connection in which template said first container object is replaced with said second object.
2. The method in claim 1 wherein the step of creating said second object is performed by said first container object.
3. The method in claim 1 wherein the step of connecting said second object to said first object is performed by said first container object.
4. The method in claim 1 wherein the step of creating said second object is performed by said first container object and the step of connecting said second object to said first object is performed by said first container object.
5. The method in claim 1 wherein connections between all objects are established between connection points on said objects.
6. The method in claim 1 wherein said first template connection is defined in a data structure.
7. The method in claim 5 wherein said first template connection is defined in a data structure.
8. A system created using any one of claims 1, 2, 3, 4, 5, 6 or 7.
9. A method for describing connections between a plurality of objects in a software system in which at least a first object of said plurality is created arbitrarily later than the remainder of said plurality, said method comprising the steps of:
defining at least a second object of said remainder;
defining a first container object which will be used as a placeholder for defining connections between said first object and said remainder;
defining at least a first connection between said second object and said first object by using said first container object in place of said first object.
10. A method for describing connections between a first plurality of objects in a software system and a second plurality of objects in said software system, said second plurality being created arbitrarily later than said first plurality, said method comprising the steps of:
defining at least a first object of said first plurality;
defining a first container object which will be used as a placeholder for defining connections between said first object and each object of said second plurality;
defining at least a first connection to be created between said first object and each object of said second plurality as a connection between said first object and said first container object.
11. In a software system, said software system having a plurality of objects, a container object comprising:
a first memory for keeping reference to at least a first object of arbitrary object class;
a section of program code causing said first memory to be modified so that it will contain a first reference to a second object;
a section of program code accessing a data structure and determining that at least a first connection needs to be established between said second object and at least a third object;
a section of program code causing said first connection to be established.
12. The container object of claim 10 further comprising a section of program code causing said second object to be created.
13. In a software system, said software system having a plurality of objects, a container object comprising:
a memory for keeping at least one reference to a contained object of arbitrary class;
a connection point for receiving requests to modify the set of contained objects;
at least one virtual connection point that accepts at least a first connection to be established to said contained object, said acceptance occurring before said contained object is added to said contained object;
a section of program code that establishes said first connection when said contained object is added to said container object.
14. In a software system, said software system having a plurality of objects, a container object comprising:
a first memory for keeping at least one reference to a contained object of arbitrary class;
a connection point for receiving requests to modify the set of contained objects;
at least one virtual property that accepts the value to be set in a first property on said contained object, said virtual property being capable of accepting values of a plurality of data types;
a section of program code that sets said first property on said contained object to said accepted value when said contained object is added to said contained object.
15. In a software system, said software system having a plurality of objects, a container object comprising:
a first memory for keeping a first plurality of contained objects of arbitrary classes;
a second memory for keeping a second plurality of unique identifiers, each identifier of said second plurality associated with exactly one object of said first plurality;
at least a first property, said first property being a second property of a first object of said first plurality and said first property being identified by a combined identifier produced by combining the associated identifier of said first object and the identifier of said second property.
16. The software system of claim 15, wherein each said property comprises a terminal.
17. The software system of either of claims 15 or 16, wherein the second memory doesn't exist and contained objects are identified by identifiers assigned by the container.
18. A container object class in a software system, said software system having a first plurality of objects, each object of said first plurality belonging to an object class, said container object class comprising:
means for holding a second plurality of contained objects, said means being applicable to contained objects of any class;
means for changing the set of said contained objects, said means being applicable to contained objects of any class;
means for presenting said plurality of contained objects as a single object, said means being applicable to contained objects of any class.
19. The container object class of claim 18 wherein said single object is an instance of said container object class.
20. A container object which is an instance of the container object class of claim 18.
21. In a software system, said software system having a plurality of objects, each object of said plurality of objects belonging to an object class, said software system having means for building at least one structure of connected objects and means of describing said structure of connected objects, a container object class comprising:
means for holding a plurality of contained objects, said means being applicable to contained objects of any class;
means for changing the set of said contained objects programmatically, said means being applicable to contained objects of any class;
means for presenting said plurality of contained objects as a single object in said structure of connected objects, said means being applicable to contained objects of any class.
22. A container object which is an instance of the container object class of claim 21.
23. In a software system having at least a first object and a second object, said first object having at least one first connection point, said second object having at least one second connection point, said first connection point being used to establish a first connection between said first connection point of said first object and said second connection point of said second object, and said software system having means of requesting the establishment of a connection between connection points, a container object comprising:
means for adding and removing said first object from said container;
means for defining a third connection point on said container object;
means for transforming a requests for establishing of a connection between said second connection point and said third connection point into a request for establishing a connection between said second connection point and said first connection point.
24. The container object of claim 23 wherein said software system includes means of identifying said first connection point using a first identifier, said container object having the additional means to identify said third connection point using said first identifier.
25. The container object of claim 23 wherein said software system includes means of identifying said first connection point using a first identifier, said container object having the additional means to identify said first object using a second identifier and said container object having the additional means to identify said third connection point using a combination of said first identifier and said second identifier.
26. A container object in a software system, said software system having at least one first object and said container object, said first object having at least one first property, said software system having means of requesting operations over said first property, said container comprising:
means for adding and removing said first object from said container;
means for defining a second property on said container object;

means for transforming a request for operations over said second property into a request for operations over said first property.
27. The container object of claim 26 wherein said software system has means of identifying said first property using a first identifier, said container object having the additional means to identify said second property using said first identifier.
28. The container object of claim 26 wherein said software system has means of identifying said first property using a first identifier, said container object having the additional means to identify said first object using a second identifier and said container object having the additional means to identify said second property using a combination of said first identifier and said second identifier.
29. A container object having the sum of the means of the container object of claim 25 and of the container object of claim 28.
30. The container of claim 29 wherein all the specified means of said container are implemented independently of the class of said first object.
31. A container object in a software system, said software system having a plurality of objects, said software system having means for requesting operations over an object, said container object comprising:
means for holding a plurality of contained objects;
means for changing the set of said contained objects programmatically;
means for identifying each object of said contained objects by a separate, unique identifier for each object;
means of handling requests for operations over any object of said contained objects wherein said identifier is used to determine which object of said contained objects should handle the request.
32. The container of claim 31 wherein said container has the additional means of automatically assigning said unique identifier to each object added to said container.
33. The container of claim 31 wherein said unique identifier is assigned outside of said container, and said container has the additional means of associating said unique identifier with each said contained object.
34. A method for caching and propagating property values to a dynamic set of objects in a software system, said software system having a plurality of objects, each of said objects having a plurality of properties, each said property having a value and an identifier, said method comprising the steps of:
accepting a first request to modify the value of a first property on behalf of said dynamic set of objects as if said dynamic set of objects were one object;
storing said value and identifier of said first property in a first data storage;
retrieving said value and identifier of said first property from said first data storage;
issuing a request to modify the value of said first property on a first object of said dynamic set of objects, using said value and identifier retrieved from said first data storage.
35. A container object in a software system using the method in claim 34.
36. A method for caching and propagating outgoing connections of a dynamic set of objects in a software system, said software system having a plurality of objects, said software system having means for establishing connections between said objects, said connections providing means for a first connected object to make outgoing calls to a second connected object, said method comprising the steps of:
accepting the request to establish a first outgoing connection between said dynamic set of objects and a first object, as if said dynamic set of objects were a single object;
storing a first data value necessary to effect said first connection in a first data storage;
retrieving said first data value from said first data storage;
issuing a request to establish a second connection between a second object of said dynamic set and said first object, using said first data value retrieved from said first data storage.
37. A container object in a software system using the method in claim 36.
38. A container object in a software system using both the method in claim 34 and the method in claim 36.
39. A container object in a software system, said software system having a plurality of objects, said software system having means for building at least one structure of connected objects, said software system having a first means of describing said structure, said container object being a first object in said structure, said first object having a first connection to at least a second object in said structure, said first connection being described by said first means, said container comprising:
means for holding a plurality of contained objects;
means for changing the set of said contained objects programmatically;
means for connecting each of said contained objects to said second object.
40. The container in claim 39 wherein said container has the additional means of establishing all connections between said container and other objects in said structure, said all connections being described by said first means, said additional means causing the establishing of each of said all connections between each of said contained objects and said other objects in said structure.
41. A container object in a software system, said software system having a plurality of objects, said software system having means of building at least one structure of connected objects, said software system having a first means of describing said structure, said software system providing a second means of enumerating all connections described by said first means, said container being a first object in said structure, said container being connected to at least a second object in said structure, said container comprising:
means for holding a plurality of contained objects;
means for changing the set of said contained objects programmatically;
means for finding a first described connection between said container and said second object;
means for establishing said first connection between a third object contained in said container and said second object.
42. The container in claim 41 wherein said container establishes connections between a first connection point of said third object and a second connection point of said second object.
43. A container object in a software system; said software system having a plurality of objects, said container having a first connection to at least one object, said first connection being described in a first data structure, said container comprising:
means for holding a plurality of contained objects;
means for changing the set of said contained objects programmatically;
means for determining a first set of connections to be established for each object added to said set of contained objects based on the set of connections described in said first data structure;
means for establishing said first set of connections.
44. The container in claim 43 wherein said container further comprises means for dissolving said first set of connections.
45. The container in claim 43 wherein said container further comprises:
means for remembering a second set of outgoing connections from said container to other objects means for excluding said second set of connections from said first set of connections means for establishing said second set of outgoing connections for each object added to said set of contained objects.
46. The container in claim 43 wherein said container further comprises:
means for remembering properties set on said container;
means for setting remembered properties on each new object added to said set of contained objects;
means for propagating properties set on said container to all objects in said set of contained objects;
47. A container object in a software system, said software system containing a plurality of objects, said software system having a first means to establish connections between connection points of objects of said plurality, said first means providing the ability to establish more than one connection to a first connection point of a first object, said container object having a second connection point connected to said first connection point of said first object, said container comprising:

means for holding a plurality of contained objects;
means for changing the set of said contained objects programmatically;
means for establishing a separate connection between a connection point on each object of said plurality of contained objects and said first connection point of said first object.
48. The container in claim 43 wherein said container further comprises:
means for remembering properties set on said container;
49. A part for distributing events among a plurality of parts, said part comprising:
a multiple cardinality input, a multiple cardinality output, means for recording references to parts that are connected to said output means for forwarding events received on said input to each of the connected objects to said output.
50. A part for distributing events and requests between a plurality of other parts, said part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to a first connected part;
a third terminal for sending calls out to a second connected part;
means for choosing whether to send the received call through said second terminal or through said third terminal.
51. A part for distributing events and requests between a plurality of other parts, said part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to a first connected part;
a third terminal for sending calls out to a second connected part;
means for choosing whether to first send the received call through said second terminal and then through said third terminal or to first send the received call through said third terminal and then through said second terminal.
52. A part for distributing events and requests between a plurality of other parts, said part comprising:
a first terminal for receiving calls;

a second terminal for sending calls out to a first connected part;
a third terminal for sending calls out to a second connected part;
means for sending a first received call as a first call to said second terminal and then, based on value returned from said first call, choose whether or not to send said first received call as a second call to said third terminal.
53. A method for desynchronizing events and requests in a software system, said method comprising the steps of:
storing said event in a memory;
receiving a pulse signal;
retrieving said event from said memory and continuing to process said event in the execution context of said pulse signal.
54. A part in a software system, said part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to a first connected part;
a third terminal for receiving a pulse call;
a memory for storing call information received from said first terminal;
a section of program code that is executed when said part receives said pulse calls, said section retrieving said call information from said memory and sending a call out to said second terminal.
55. The part in claim 54 wherein said memory can hold call information for a plurality of calls.
56. The part in claim 54 wherein said memory is a queue.
57. The part in claim 54 wherein said memory is a stack.
58. The part in claim 54 wherein said first terminal and said second terminal are one terminal.
59. A part in a software system, said part comprising:
a first terminal for receiving calls;
a second terminal for sending calls out to first connected part;
a memory for storing call information received from said first terminal;
a means for obtaining execution context;

a section of program code that is executed in said execution context, said section retrieving said call information from said memory and sending a call out to said second terminal.
60. The part in claim 59 wherein said means for obtaining execution context is a thread of execution in a multithreaded system.
61. The part in claim 59 wherein said means for obtaining execution context is a timer callback.
62. The part in claim 59 wherein said means for obtaining execution context is a subordinate part.
63. The part in claim 59 wherein said means for obtaining execution context is a subordinate part, said subordinate part having a primary function of providing execution context for other parts.
64. The part in claim 59 wherein said first terminal and said second terminal are one terminal.
65. A part in a software system, said part comprising:
a first subordinate part for storing incoming data;
a second subordinate part for generating execution context.
66. The part in claim 65 wherein said part further comprises a connection between said first subordinate part and said second subordinate part.
67. A part in a software system, said part comprising:
a first terminal for receiving an incoming request;
a second terminal for sending out an outgoing request;
a third terminal for receiving a request completion indication;
a synchronization object for blocking the thread in which said incoming request was received until said request completion indication is received.
68. The part in claim 67 wherein said second terminal and said third terminal are one terminal.
69. A part in a software system, said part comprising:
an input terminal for receiving calls of a first type;
an output terminal for sending calls of a second type;
means for converting calls of said first type to calls of said second type.
70. A part in a software system, said part comprising:
an input terminal for receiving calls of a first type and sending calls of said first type;
an output terminal for receiving calls of a second type and sending calls of said second type;
means for converting calls of said first type to calls of said second type;
means for converting calls of said second type to calls of said first type.
71. The part of claim 70 wherein said first type and said second type differ by physical mechanism.
72. The part of claim 70 wherein said first type and said second type differ by logical contract.
73. A part in a software system, said part comprising:
a first terminal for receiving a first request and sending a second request;
a second terminal for sending said first request;
a third terminal for receiving said second request.
74. The part of claim 73 wherein:
said first terminal is a bidirectional terminal;
said second terminal is an output terminal;
said third terminal is an input terminal.
75. A part in a software system, said part comprising:
a first terminal for receiving calls;
a second terminal for sending out calls received on said first terminal;
a third terminal for sending out calls whenever a call is received on said first terminal.
76. The part in claim 76 wherein said part further comprises a first property for defining a criterion for selecting for which calls received on said first terminal said part will send out calls through said third terminal.
77. The part in claim 76 wherein said part further comprises a second property for configuring what call said part will send out said third terminal.
78. The part in claim 76 wherein said part further comprises a third property for configuring what call said part will send out said third terminal before sending out a call received on said first terminal to said second terminal.
79. The part in claim 76 wherein said part further comprises a third property for configuring what call said part will send out said third terminal after sending out a call received on said first terminal to said second terminal.
80. The part in claim 76 wherein said part further comprises a third property for configuring whether a call out through said third terminal should be made before or after sending out a call received on said first terminal to said second terminal.
81. A part in a software system, said part comprising:
a first terminal for receiving calls;
a second terminal for sending out calls received on said first terminal;
a third terminal for sending out calls whenever a call sent out said second terminal returns a pre-determined value.
82. The part of claim 81 wherein said part further comprises a property for configuring said pre-determined value.
83. The part of claim 81 wherein said pre-determined value indicates that said second call has failed.
84. The part of claim 81 wherein said pre-determined value indicates that said second call has succeeded.
85. A part in a software system, said part comprising:
a first terminal for receiving calls;
a second terminal for sending out calls received on said first terminal;
a first property for configuring a first value;
a third terminal for sending out notification calls whenever a call sent out said second terminal returns a second value that matches said first value.
86. The part of claim 85 wherein said part further comprises a second property for configuring whether said part will send out said notification calls if said second value matches said first value or if said second value differs from said first value.
87. A part in a software system, said part comprising:
a terminal for receiving calls of arbitrary logical contract;
a property for defining a return value.
88. The part of claim 87 wherein said part further comprises a property for configuring the logical contract for calls received on said terminal.
89. The part of claim 87 wherein said terminal is an input terminal.
90. The part of claim 87 wherein said terminal is a bi-directional terminal and said part does not make calls out said terminal.
91. A part in a software system, said part comprising:
a terminal for receiving a first call and a reference to a first memory;
a property for defining a return value;
a section of program code for freeing said first memory.
92. The part in claim 91 wherein said part further comprises means for determining whether said section of program code should be executed for said first call.
93. The part in claim 91 wherein said part further comprises means for determining whether said section of program code should be executed for said first call based on a value contained in said first memory.
94. A part in a software system, said part comprising:
a first terminal for receiving a first call;
a second terminal for sending out said first call;
means for extracting data from said first call;
means for formatting said extracted data as a first text;
means for sending out said first text.
95. The part of claim 94 wherein said means for sending out said first text is a third terminal.
96. The part of claim 94 wherein said means for sending out said first text is a section of program code that invokes a function for displaying said first text on a console.
97. A first structure of connected parts in a software system, said first structure comprising:
a factory part for determining when a new part should be created;
a container part for holding a first plurality of parts of arbitrary part class;
a connection between said factory part and said container part.
98. The structure of claim 97 wherein:
said factory part has a first terminal;
said container part has a second terminal;
said connection is established between said first terminal and said second terminal.
99. The structure of claim 97 wherein said structure further comprises a demultiplexing part having a first terminal for receiving calls, a second terminal for sending out calls and means for selecting a part connected to said second terminal.
100. The structure of claim 99 wherein said structure further comprises a plurality of connections, each connection established between said second terminal of said demultiplexing part and a terminal of each part in said first plurality.
101. The structure of claim 100 wherein said connection demultiplexing part and said factory part are one part.
102. A composite part in a software system, said composite part comprising the structure in claim 97.
103. The structure of claim 97 wherein said structure further comprises an enumerator part for defining the set of parts in said first plurality.
104. The structure of claim 103 wherein said structure further comprises a connection between said enumerator part and said factory part.
105. The structure of claim 97 wherein said enumerator uses a data container for defining the parts in first plurality.
106. The structure of claim 103 wherein said enumerator comprises means for enumerating a set of peripheral devices connected to a computer system.
107. The structure of claim 106 wherein said enumerator further comprises a first property for configuring a limitation on the type of peripheral devices to be enumerated.
108. The structure of claim 97 wherein said structure further comprises a parameterizer part for retrieving the value for at least one property to be set on each part of said first plurality.
109. The structure of claim 108 wherein said parameterizer part retrieves said value from a data container.
110. The structure of claim 108 wherein said parameterizer part uses a persistent identifier to select said value among a set of values.
111. The structure of claim 97 wherein said structure further comprises a serializer part for saving the value of at least on property of each part in said first plurality.
112. The structure of claim 111 wherein said structure further comprises a trigger part for initiating said saving of the value.
113. The structure of claim 97 wherein said structure further comprises a parameterizer part for retrieving the value for a first property to be set on each part of said first plurality and for saving the value of said first property.
114. The structure of claim 97 wherein said factory part determines whether to create a new part in said first plurality or to use an existing part in said first plurality based a persistent identifier provided to said factory part.
115. The structure of claim 97 wherein said structure further comprises a loader part for bringing in memory a class for a part to be created.
116. The structure of claim 116 wherein said structure further comprises:
a connection between said factory part and said loader part;
a connection between said loader part and said container part.
117. A part in a software system, said part comprising:
a first terminal for receiving calls;
a second terminal for sending out calls received on said first terminal;
a third terminal for sending out requests to create new parts;
means for selecting calls received on said first terminal for which said part sends out requests on said third terminal.
118. A method for designing access to a hardware component in a component-based software system, said method comprising the steps of:
designating a first software component for receiving interrupts from said hardware component;
designating a at least a second software component for accessing input and output ports of said hardware component;

designating a third software component for handling interrupts received by said first software component;
designating a fourth software component for manipulating said hardware component;
connecting said first software component to said third software component;
connecting said second software component to said fourth software component.
119. The method in claim 118 wherein said method further comprises the step of connecting said third software component and said fourth software component.
120. The method in claim 118 wherein said third software component and said fourth software component are one component.
121. A part in a software system, said part comprising:
a first terminal for sending out calls;
a section of program code for receiving control when an interrupt occurs and sending out a call through said first terminal.
122. The part of claim 121 wherein said part further comprises a property for configuring which hardware interrupt vector among a plurality of hardware interrupt vectors said part should receive.
123. The part of claim 121 wherein said part further comprises a section of program code for registering said part to receive control when said interrupt occurs.
124. A part in a software system, said part comprising:
a terminal for receiving requests to access at least one port of a hardware component;
a property defining the base address of said port;
a section of code that accesses said port when a request is received on said first terminal.
125. The part of claim 124 wherein said port is a memory-mapped port.
126. The part of claim 124 wherein said port is a input-output port.
127. The part of claim 124 wherein said requests include a read request and a write request.
128. A structure of connected parts in a software system, said structure comprising:
an interrupt source part for receiving interrupt from a hardware component;
at least one port accessor part for accessing ports of said hardware component;
at least one controller part for controlling said hardware component.
129. The structure of claim 128 wherein said controller part accesses said hardware component exclusively through said interrupt source part and said port accessor part.
130. The structure of claim 128 wherein said structure further comprises:
a connection between said interrupt source part and one of said controller parts;
a connection between one of said port accessor parts and one of said controller parts.
131 . A composite part in a software system, said composite part containing the structure of claim 128.
132. A composite part in a software system, said composite part containing the structure of claim 129.
133. A method for designing software system in which system at least a first object is created arbitrarily earlier than a second object and said second object is automatically connected to at least said first object, said method comprising the steps of:
creating said first object;
creating a first container object capable of holding at least one other object of arbitrary object class;
defining at least a first template connection between said first object and said first container object;
creating said second object;
connecting said second object to said first object using said first template connection in which template said first container object is replaced with said second object.
CA002391763A 1999-08-16 2000-08-16 System of reusable software parts and methods of use Abandoned CA2391763A1 (en)

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
US14937199P 1999-08-16 1999-08-16
US14962499P 1999-08-16 1999-08-16
US60/149,371 1999-08-16
US60/149,624 1999-08-16
PCT/US2000/022694 WO2001014959A2 (en) 1999-08-16 2000-08-16 System of reusable software parts and methods of use

Publications (1)

Publication Number Publication Date
CA2391763A1 true CA2391763A1 (en) 2001-03-01

Family

ID=26846678

Family Applications (2)

Application Number Title Priority Date Filing Date
CA002391763A Abandoned CA2391763A1 (en) 1999-08-16 2000-08-16 System of reusable software parts and methods of use
CA002386658A Abandoned CA2386658A1 (en) 1999-08-16 2000-08-16 System of reusable software parts for implementing concurrency and hardware access, and methods of use

Family Applications After (1)

Application Number Title Priority Date Filing Date
CA002386658A Abandoned CA2386658A1 (en) 1999-08-16 2000-08-16 System of reusable software parts for implementing concurrency and hardware access, and methods of use

Country Status (6)

Country Link
US (5) US20020069400A1 (en)
EP (2) EP1224544A1 (en)
AU (2) AU6782800A (en)
CA (2) CA2391763A1 (en)
IL (2) IL148130A0 (en)
WO (2) WO2001014959A2 (en)

Families Citing this family (117)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19835215C2 (en) * 1998-08-05 2000-07-27 Mannesmann Vdo Ag Combination instrument
US6621918B1 (en) 1999-11-05 2003-09-16 H Innovation, Inc. Teleradiology systems for rendering and visualizing remotely-located volume data sets
US6789111B1 (en) * 1999-12-09 2004-09-07 Microsoft Corporation Automatic detection and installation of client peripheral devices by a server
US7181745B1 (en) * 2000-03-03 2007-02-20 The Mathworks, Inc. Method and system for accessing objects defined within an external object-oriented environment
US8312429B2 (en) * 2000-11-10 2012-11-13 Oracle International Corporation Cell based data processing
US7058939B2 (en) * 2001-04-05 2006-06-06 International Business Machines Corporation Automatic link maintenance to ensure referential integrity constraints
US20030237073A1 (en) * 2001-05-17 2003-12-25 Karel Gardas Software synchronization of interface and class implementation
US7127559B2 (en) * 2001-07-10 2006-10-24 Micron Technology, Inc. Caching of dynamic arrays
US7062761B2 (en) 2001-07-10 2006-06-13 Micron Technology, Inc. Dynamic arrays and overlays with bounds policies
US7213050B1 (en) * 2001-07-11 2007-05-01 Cisco Technology, Inc. System and method for reserving conference resources for a multipoint conference using a priority scheme
US7313824B1 (en) * 2001-07-13 2007-12-25 Liquid Machines, Inc. Method for protecting digital content from unauthorized use by automatically and dynamically integrating a content-protection agent
US7111285B2 (en) * 2001-07-17 2006-09-19 Liquid Machines, Inc. Method and system for protecting software applications against static and dynamic software piracy techniques
US7406424B2 (en) * 2001-08-29 2008-07-29 Hewlett-Packard Development Company, L.P. Migration of a workflow system to changed process definitions
US7039723B2 (en) * 2001-08-31 2006-05-02 Hinnovation, Inc. On-line image processing and communication system
WO2003029967A1 (en) * 2001-09-28 2003-04-10 Crystal Decisions, Inc. Apparatus and method for combining discrete logic visual icons to form a data transformation block
US20030086595A1 (en) * 2001-11-07 2003-05-08 Hui Hu Display parameter-dependent pre-transmission processing of image data
WO2003069466A1 (en) * 2002-02-18 2003-08-21 Japan Science And Technology Agency Software component importance evaluation system
US7010782B2 (en) * 2002-04-04 2006-03-07 Sapphire Infotech, Inc. Interactive automatic-test GUI for testing devices and equipment using shell-level, CLI, and SNMP commands
US7676538B2 (en) * 2002-05-02 2010-03-09 Bea Systems, Inc. Systems and methods for application view transactions
US7290215B2 (en) * 2002-06-03 2007-10-30 Microsoft Corporation Dynamic wizard interface system and method
US7458018B2 (en) * 2002-06-27 2008-11-25 Microsoft Corporation System and method for obtaining and using namespace related information for opening XML documents
US7039898B2 (en) * 2002-07-12 2006-05-02 Netspective Communications, Llc Computer system for performing reusable software application development from a set of declarative executable specifications
US7765521B2 (en) * 2002-08-29 2010-07-27 Jeffrey F Bryant Configuration engine
US7114148B2 (en) * 2002-09-30 2006-09-26 Microsoft Corporation Runtime services for network software platform
US20040148299A1 (en) * 2002-11-25 2004-07-29 Microsoft Corporation Automated workflow composable action model
US20040122689A1 (en) * 2002-12-20 2004-06-24 Dailey Roger S. Method and apparatus for tracking a part
CN1306430C (en) * 2002-12-31 2007-03-21 上海科泰世纪科技有限公司 User self-defining event mechanism based on structure
US7210125B2 (en) * 2003-07-17 2007-04-24 International Business Machines Corporation Method and system for application installation and management using an application-based naming system including aliases
US7536696B2 (en) * 2003-10-24 2009-05-19 Microsoft Corporation Mechanism for handling input parameters
US8875039B2 (en) * 2003-11-18 2014-10-28 The Mathworks, Inc. Propagation of characteristics in a graphical model environment
US7636351B2 (en) * 2004-02-02 2009-12-22 At&T Intellectual Property, I, L.P. Methods, systems, and storage mediums for providing database management services for a telecommunications system
CN100527266C (en) * 2004-03-15 2009-08-12 汤姆森许可贸易公司 Method for obtaining prescribed data value and equipment for using the method
CN100342340C (en) * 2004-06-10 2007-10-10 罗泽文 Constitution method for software execution environment operation external connection
US7680805B2 (en) * 2004-12-30 2010-03-16 Sap Ag Synchronization method for an object oriented information system (IS) model
GB0500151D0 (en) * 2005-01-06 2005-02-16 Ibm A method and system for updating application design
GB0500150D0 (en) * 2005-01-06 2005-02-16 Ibm Method, and aggregation component for aggregating application components
US20060190111A1 (en) * 2005-02-03 2006-08-24 Wang Beniz System and method of designing a product or a module therein based on experiences of modular designs accumulated previously
US8621425B1 (en) * 2005-04-08 2013-12-31 The Mathworks, Inc. Generating code based at least on one or more output arguments designated as not being present
CN101305350A (en) * 2005-06-09 2008-11-12 惠而浦公司 Software architecture system and method for communication with, and management of, at least one component within a household appliance
US8155120B2 (en) * 2005-06-09 2012-04-10 Whirlpool Corporation Software architecture system and method for discovering components within an appliance using fuctionality identifiers
KR100747466B1 (en) * 2005-10-01 2007-08-09 엘지전자 주식회사 A device management client and device management method using nodes having additional properties
US7774779B2 (en) * 2005-11-18 2010-08-10 At&T Intellectual Property I, L.P. Generating a timeout in a computer software application
KR100757229B1 (en) * 2005-12-05 2007-09-10 한국전자통신연구원 Method and apparatus for diagnosing operating systems resources to support USB device driver development on Linux systems
US7984416B2 (en) * 2006-03-24 2011-07-19 The Mathworks, Inc. System and method for providing class definitions in a dynamically typed array-based language
US8966456B2 (en) * 2006-03-24 2015-02-24 The Mathworks, Inc. System and method for providing and using meta-data in a dynamically typed array-based language
JP4887893B2 (en) * 2006-04-26 2012-02-29 株式会社日立製作所 Computer system and computer system control method
US9754265B2 (en) * 2006-05-01 2017-09-05 At&T Intellectual Property I, L.P. Systems and methods to automatically activate distribution channels provided by business partners
US20080028057A1 (en) * 2006-07-26 2008-01-31 International Business Machines Corporation System and method to facilitate design and operation of event-driven, embedded solutions
US20080033980A1 (en) * 2006-08-03 2008-02-07 Jaroslav Andrew Delapedraja System and method for automatically adjusting file system settings
CN100419677C (en) * 2006-08-16 2008-09-17 中国航天科技集团公司第一研究院 Module based fast engineering design method
US10078574B2 (en) 2006-09-25 2018-09-18 Typemock Ltd. Methods and systems for isolating software components
GB0624582D0 (en) * 2006-12-08 2007-01-17 Visible Computing Ltd USB autorun devices
US7716247B2 (en) * 2006-12-18 2010-05-11 Microsoft Corporation Multi-protocol access to files and directories
US8001530B2 (en) * 2006-12-28 2011-08-16 Sap Ag Method and framework for object code testing
KR101371619B1 (en) * 2007-02-14 2014-03-06 삼성전자주식회사 Apparatus and method for componentizing legacy system
US8464205B2 (en) * 2007-04-13 2013-06-11 International Business Machines Corporation Life cycle of a work packet in a software factory
US9311111B2 (en) * 2007-07-12 2016-04-12 The Mathworks, Inc. Programming environment with support for handle and non-handle user-created classes
US8370824B2 (en) * 2007-10-23 2013-02-05 International Business Machines Corporation Dynamic class loading
US8359572B2 (en) * 2008-01-08 2013-01-22 Microsoft Corporation Self-describing re-usable software components
US8839225B2 (en) 2008-01-23 2014-09-16 International Business Machines Corporation Generating and applying patches to a computer program code concurrently with its execution
US9218166B2 (en) * 2008-02-20 2015-12-22 Embarcadero Technologies, Inc. Development system with improved methodology for creation and reuse of software assets
KR101397377B1 (en) * 2008-02-26 2014-05-19 휴렛-팩커드 디벨롭먼트 컴퍼니, 엘.피. Method and apparatus for performing a host enumeration process
US9098625B2 (en) * 2008-02-29 2015-08-04 International Business Machines Corporation Viral trace
US20090240707A1 (en) * 2008-03-18 2009-09-24 International Business Machines Corporation Event driven input data validation
US8191036B2 (en) * 2008-05-19 2012-05-29 Apple Inc. Mechanism to support orphaned and partially configured objects
US20100114939A1 (en) * 2008-10-24 2010-05-06 Schulman Elad Software test management system and method with facilitated reuse of test components
US8296723B2 (en) * 2008-12-11 2012-10-23 International Business Machines Corporation Configurable unified modeling language building blocks
JP5236564B2 (en) * 2009-04-20 2013-07-17 株式会社日立製作所 Software reuse support method and apparatus
US8484616B1 (en) * 2009-06-23 2013-07-09 Emc Corporation Universal module model
US8589913B2 (en) * 2009-10-14 2013-11-19 Vmware, Inc. Tracking block-level writes
US20110173595A1 (en) * 2010-01-08 2011-07-14 Microsoft Corporation Language-based model for asynchronous operations
US20110179303A1 (en) 2010-01-15 2011-07-21 Microsoft Corporation Persistent application activation and timer notifications
US8495601B2 (en) * 2010-06-09 2013-07-23 Lear Corporation Shared memory architecture
US20120017161A1 (en) * 2010-07-19 2012-01-19 David Hirshberg System and method for user interface
JP5120424B2 (en) * 2010-07-27 2013-01-16 横河電機株式会社 Sequence control device
US9177017B2 (en) * 2010-09-27 2015-11-03 Microsoft Technology Licensing, Llc Query constraint encoding with type-based state machine
WO2012071552A2 (en) * 2010-11-24 2012-05-31 Coral Networks, Inc. System and method for access control and identity management
US8412674B2 (en) * 2010-12-08 2013-04-02 Sybase, Inc. Replication resynchronization
CA2831135A1 (en) * 2011-03-31 2012-10-04 Coral Networks, Inc. System and method for the structuring and interpretation of organic computer programs
US9367658B2 (en) * 2011-06-22 2016-06-14 Maxeler Technologies Ltd. Method and apparatus for designing and generating a stream processor
CA2759516C (en) * 2011-11-24 2019-12-31 Ibm Canada Limited - Ibm Canada Limitee Serialization of pre-initialized objects
EP2608024A1 (en) * 2011-12-22 2013-06-26 Tata Consultancy Services Limited Computing reusability index of software assets
US9103874B2 (en) * 2012-01-09 2015-08-11 International Business Machines Corporation Concurrent test instrumentation
US20140006618A1 (en) * 2012-06-29 2014-01-02 William M. Pitts Method of creating path signatures to facilitate the recovery from network link failures
JP6420311B2 (en) 2013-03-15 2018-11-07 ベウラワークス,エルエルシー. System and method for facilitating data capture and user access to the data
US9747088B2 (en) 2013-04-22 2017-08-29 Embarcadero Technologies, Inc. Automatic reference counting
DE102013108309A1 (en) * 2013-08-01 2015-02-05 OMS Software GMBH Method for connecting objects in a software application
US9639572B2 (en) 2013-09-06 2017-05-02 Sap Se SQL enhancements simplifying database querying
US9430523B2 (en) 2013-09-06 2016-08-30 Sap Se Entity-relationship model extensions using annotations
US9176801B2 (en) 2013-09-06 2015-11-03 Sap Se Advanced data models containing declarative and programmatic constraints
US9354948B2 (en) 2013-09-06 2016-05-31 Sap Se Data models containing host language embedded constraints
US9361407B2 (en) 2013-09-06 2016-06-07 Sap Se SQL extended with transient fields for calculation expressions in enhanced data models
US9442977B2 (en) 2013-09-06 2016-09-13 Sap Se Database language extended to accommodate entity-relationship models
US9575819B2 (en) 2013-09-06 2017-02-21 Sap Se Local buffers for event handlers
US9619552B2 (en) 2013-09-06 2017-04-11 Sap Se Core data services extensibility for entity-relationship models
CN103955364B (en) * 2014-04-15 2017-06-20 南威软件股份有限公司 A kind of front end assemblies method suitable for mobile phone
US9122562B1 (en) * 2014-06-19 2015-09-01 Amazon Technologies, Inc. Software container recommendation service
WO2016146494A1 (en) * 2015-03-13 2016-09-22 Koninklijke Kpn N.V. Method and control system for controlling provisioning of a service in a network
US9729677B2 (en) * 2015-04-28 2017-08-08 David Wei Ge Method of adding client server automation to computer languages for cloud computing
US10223074B2 (en) * 2015-12-11 2019-03-05 International Business Machines Corporation Determining the identity of software in software containers
US10437523B2 (en) * 2016-02-25 2019-10-08 Red Hat Israel, Ltd. Secure receive packet processing for network function virtualization applications
US10909136B1 (en) 2017-02-08 2021-02-02 Veritas Technologies Llc Systems and methods for automatically linking data analytics to storage
US10685033B1 (en) 2017-02-14 2020-06-16 Veritas Technologies Llc Systems and methods for building an extract, transform, load pipeline
US10606646B1 (en) 2017-03-13 2020-03-31 Veritas Technologies Llc Systems and methods for creating a data volume from within a software container and initializing the data volume with data
US10540191B2 (en) 2017-03-21 2020-01-21 Veritas Technologies Llc Systems and methods for using dynamic templates to create application containers
US10565168B2 (en) * 2017-05-02 2020-02-18 Oxygen Cloud, Inc. Independent synchronization with state transformation
US11281436B2 (en) * 2017-06-30 2022-03-22 Ashish Belagali System for creating one or more deployable applications and source code thereof using reusable components and method therefor
US10740132B2 (en) 2018-01-30 2020-08-11 Veritas Technologies Llc Systems and methods for updating containers
CN108536448A (en) * 2018-03-21 2018-09-14 江苏长顺江波软件科技发展有限公司 A method of modification windows operating systems SID
US11429358B2 (en) 2020-08-12 2022-08-30 Microsoft Technology Licensing, Llc Representing asynchronous state machine in intermediate code
US11435989B2 (en) * 2020-08-25 2022-09-06 Microsoft Technology Licensing, Llc Thread-local return structure for asynchronous state machine
CN113741869B (en) * 2020-09-10 2023-05-26 吕戈 High-performance variable grammar programming language construction method
US11537661B2 (en) 2020-10-02 2022-12-27 PolyAI Limited Systems and methods for conversing with a user
CN112600882B (en) * 2020-12-01 2022-03-08 上海交通大学 Hardware acceleration method based on shared memory communication mode
CN112698930B (en) * 2020-12-31 2023-11-07 中国农业银行股份有限公司 Method, device, equipment and medium for obtaining server identification
US11934420B2 (en) 2021-01-29 2024-03-19 Walmart Apollo, Llc Systems and methods for componentization and plug and play workflows
US20240086742A1 (en) * 2022-09-13 2024-03-14 Rithm Software Inc. Multi-station decision network

Family Cites Families (53)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ATE134779T1 (en) * 1987-06-12 1996-03-15 Bmc Software Inc SUPERVISOR METHOD FOR A COMPUTER OPERATING SYSTEM
US5297283A (en) * 1989-06-29 1994-03-22 Digital Equipment Corporation Object transferring system and method in an object based computer operating system
JPH03113932A (en) * 1989-09-27 1991-05-15 Toshiba Corp Store and forward switching device
EP0464352A3 (en) * 1990-06-25 1994-11-17 Ibm Sub-entry point interface architecture for change management in a computer network
EP0523780A3 (en) * 1991-07-15 1993-03-03 N.V. Philips' Gloeilampenfabrieken Coherent optical telecommunication network
US5671436A (en) * 1991-08-21 1997-09-23 Norand Corporation Versatile RF data capture system
GB2263988B (en) * 1992-02-04 1996-05-22 Digital Equipment Corp Work flow management system and method
EP0554854A3 (en) * 1992-02-04 1996-02-28 Digital Equipment Corp System and method for executing, tracking and recovering long running computations
US5655009A (en) * 1992-03-19 1997-08-05 Fujitsu Limited Modem unit
JP3147572B2 (en) * 1993-03-22 2001-03-19 株式会社日立製作所 Program generation method
CA2135517A1 (en) * 1993-03-25 1994-09-29 Patrick Delaney Ross Multi-level interrupt system
US5544302A (en) * 1993-06-03 1996-08-06 Taligent, Inc. Object-oriented framework for creating and using container objects with built-in properties
CA2118169A1 (en) * 1993-10-27 1995-04-28 Michael R.C. Seaman Event architecture for system management in an operating system
US5517645A (en) * 1993-11-05 1996-05-14 Microsoft Corporation Method and system for interfacing components via aggregate components formed by aggregating the components each with an instance of a component manager
US5485617A (en) * 1993-12-13 1996-01-16 Microsoft Corporation Method and system for dynamically generating object connections
US5566346A (en) * 1993-12-21 1996-10-15 Taligent, Inc. System for constructing hardware device interface software systems independent of operating systems including capability of installing and removing interrupt handlers
US5546595A (en) * 1993-12-21 1996-08-13 Taligent, Inc. Object-oriented system using objects representing hardware devices, physical connectors and connections between the physical connectors for configuring a computer
WO1995017713A1 (en) * 1993-12-21 1995-06-29 Taligent, Inc. Object-oriented input/output framework
JPH07334372A (en) * 1993-12-24 1995-12-22 Seiko Epson Corp System and method for emulation
US5546519A (en) * 1994-02-28 1996-08-13 International Business Machines Corporation System and method for visually programming iteration
US5652714A (en) * 1994-09-30 1997-07-29 Apple Computer, Inc. Method and apparatus for capturing transient events in a multimedia product using an authoring tool on a computer system
US5630131A (en) * 1994-11-14 1997-05-13 Object Technology Licensing Corp. Method and apparatus for importing and exporting archive files for a graphical user interface
US5911068A (en) * 1995-03-30 1999-06-08 Microsoft Corporation Container independent control architecture
JP3441843B2 (en) * 1995-05-31 2003-09-02 富士通株式会社 Multi-user connection between stations
US5802367A (en) * 1995-07-07 1998-09-01 Microsoft Corporation Method and system for transparently executing code using a surrogate process
EP0762273B1 (en) * 1995-09-06 2002-05-15 Seiko Epson Corporation Peripheral device control system using a plurality of objects
CA2240194C (en) * 1995-12-15 2003-06-03 Object Dynamics Corp. Method and system for constructing software components and systems as assemblies of independent parts
DE59711792D1 (en) * 1996-03-20 2004-08-26 Siemens Schweiz Ag Zuerich METHOD FOR TRANSMITTING INFORMATION FROM AN INFORMATION SOURCE TO INFORMATION RECEIVERS
US6868538B1 (en) * 1996-04-12 2005-03-15 Fisher-Rosemount Systems, Inc. Object-oriented programmable controller
US5809091A (en) * 1996-06-04 1998-09-15 Ericsson, Inc. Timing signal generator for digital communication system
EP0825787A1 (en) * 1996-08-12 1998-02-25 BRITISH TELECOMMUNICATIONS public limited company Negotiation process for connection management
US6016514A (en) * 1996-10-31 2000-01-18 International Business Machines Corporation Method and apparatus for an improved specialization of a CORBAservices GenericFactory
US5978578A (en) * 1997-01-30 1999-11-02 Azarya; Arnon Openbus system for control automation networks
US5884078A (en) * 1997-01-31 1999-03-16 Sun Microsystems, Inc. System, method and article of manufacture for creating an object oriented component having multiple bidirectional ports for use in association with a java application or applet
US6643712B1 (en) * 1997-04-04 2003-11-04 Microsoft Corporation Validating the creation of and routing of messages to file objects
US6016515A (en) * 1997-04-04 2000-01-18 Microsoft Corporation Method, computer program product, and data structure for validating creation of and routing messages to file object
US5978579A (en) * 1997-08-12 1999-11-02 International Business Machines Corporation Architecture for customizable component system
US5926637A (en) * 1997-08-20 1999-07-20 Bea Systems, Inc. Service interface repository code generation data
GB2328819A (en) * 1997-08-30 1999-03-03 Ford Motor Co Antenna cluster for vehicle collision warning system
JP3394430B2 (en) * 1997-09-09 2003-04-07 富士通株式会社 Network systems and switches
WO1999018503A1 (en) * 1997-10-06 1999-04-15 Telefonaktiebolaget Lm Ericsson (Publ) Event distributor
US6032152A (en) * 1997-12-31 2000-02-29 Intel Corporation Object factory template
US6199203B1 (en) * 1998-07-21 2001-03-06 Hewlett-Packard Company Memory management techniques for on-line replaceable software
US6442620B1 (en) * 1998-08-17 2002-08-27 Microsoft Corporation Environment extensibility and automatic services for component applications using contexts, policies and activators
US6427229B1 (en) * 1998-10-22 2002-07-30 International Business Machines Corporation Object oriented mechanism and method for maintaining elements on a flexibly constrained collection that may use any suitable object as a key
US6441925B1 (en) * 1998-11-11 2002-08-27 Canon Kabushiki Kaisha Communication apparatus
EP1006443A2 (en) * 1998-11-30 2000-06-07 Hitachi, Ltd. A method of and an apparatus for conventing an event of a distributed application and recording madia for storing the method
US6671254B1 (en) * 1998-12-11 2003-12-30 Oki Electric Industry Co., Ltd. Communication network and communication node used in such network
WO2000045239A2 (en) * 1999-01-29 2000-08-03 Iona Technologies, Inc. Method and system for multi-threaded object loading and unloading
JP3557947B2 (en) * 1999-05-24 2004-08-25 日本電気株式会社 Method and apparatus for simultaneously starting thread execution by a plurality of processors and computer-readable recording medium
US6507946B2 (en) * 1999-06-11 2003-01-14 International Business Machines Corporation Process and system for Java virtual method invocation
US6601233B1 (en) * 1999-07-30 2003-07-29 Accenture Llp Business components framework
US6654607B1 (en) * 2000-02-14 2003-11-25 Toshiba America Research, Inc. Method and apparatus for enabling and monitoring mobile communication across platforms

Also Published As

Publication number Publication date
IL148129A0 (en) 2002-09-12
AU6782800A (en) 2001-07-03
CA2386658A1 (en) 2001-06-28
WO2001046804A1 (en) 2001-06-28
IL148130A0 (en) 2002-09-12
AU6915400A (en) 2001-03-19
EP1224544A1 (en) 2002-07-24
EP1279095A2 (en) 2003-01-29
US20020069399A1 (en) 2002-06-06
US20020120924A1 (en) 2002-08-29
US20030135850A1 (en) 2003-07-17
WO2001014959A2 (en) 2001-03-01
US20020069400A1 (en) 2002-06-06
US20030056205A1 (en) 2003-03-20
WO2001014959A3 (en) 2002-11-07

Similar Documents

Publication Publication Date Title
US20020120924A1 (en) System of reusable software parts for distributing event flows and methods of use
CA2240194C (en) Method and system for constructing software components and systems as assemblies of independent parts
Schmidt et al. Pattern-oriented software architecture, patterns for concurrent and networked objects
Bruneton et al. The fractal component model and its support in java
KR100221374B1 (en) Method and system for managing events
Agnew et al. Planning for change: A reconfiguration language for distributed systems
WO1995017721A1 (en) Operating system independent input/output system
JPH07281974A (en) Communication system for exchange of data between computers in network
JP2005504455A (en) Adaptive multi-protocol communication system
US5471596A (en) Computer memory device holding a data structure for implementation of function objects
JP2000029730A (en) Method and device for executing code in method invocation
US20020174082A1 (en) Reusable parts for assembled software systems
Konstantas et al. An implementation of Hybrid, a concurrent object-oriented language
US7426582B1 (en) Method, system, and apparatus for servicing PS/2 devices within an extensible firmware interface environment
Pase Dynamic probe class library (dpcl): Tutorial and reference guide
Sarkar et al. Higher-order concurrency for microcontrollers
Dulay et al. Distributed system construction: Experience with the conic toolkit
US20200401415A1 (en) Operating system architecture for microkernel generations support
Harland Towards a language for concurrent processes
Serain Client/server: Why? What? How?
Krook et al. Higher-Order Concurrency for Microcontrollers
JPH11194927A (en) Method and device for decentralization make and computer program product
Golomshtok . NET System Management Services
EP1387263A2 (en) Method and system for constructing software components and systems as assemblies of independent parts
Park Enterprise Java Aspects: Implementation strategies for supporting AspectJ components in an enterprise Javabean container

Legal Events

Date Code Title Description
FZDE Discontinued