You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
585 lines
38 KiB
585 lines
38 KiB
<?xml version="1.0"?>
|
|
<!--//////////////////////////////////////////////////////////////////////-->
|
|
<!-- $Header:$ -->
|
|
<!-- Printer Device Class Prototype SLD File -->
|
|
<!-- Version: 1.20 -->
|
|
<!-- Author: sjang -->
|
|
<!-- Copyright (c) 1999-2000 Microsoft Corp. All Rights Reserved. -->
|
|
<!--//////////////////////////////////////////////////////////////////////-->
|
|
|
|
<!DOCTYPE DCARRIER SYSTEM "mantis.dtd"
|
|
[
|
|
<!-- RegKey registry types (map to REG_SZ etc) -->
|
|
<!ENTITY RegTypeNone "0" >
|
|
<!ENTITY RegTypeSz "1" >
|
|
<!ENTITY RegTypeExpandSz "2" >
|
|
<!ENTITY RegTypeBinary "3" >
|
|
<!ENTITY RegTypeDword "4" >
|
|
<!ENTITY RegTypeDwordBigEndian "5" >
|
|
<!ENTITY RegTypeLink "6" >
|
|
<!ENTITY RegTypeMultiSz "7" >
|
|
<!ENTITY RegTypeResourceList "8" >
|
|
<!ENTITY RegTypeFullResourceDescriptor "9" >
|
|
<!ENTITY RegTypeResourceRequirementsList "10" >
|
|
<!ENTITY RegTypeQword "11" >
|
|
|
|
<!-- RegKey registry operations -->
|
|
<!ENTITY RegOpWrite "1" >
|
|
<!ENTITY RegOpDelete "2" >
|
|
<!ENTITY RegOpEdit "3" >
|
|
|
|
<!-- RegKey registry conditionals -->
|
|
<!ENTITY RegCondAlways "1" >
|
|
<!ENTITY RegCondIfExists "2" >
|
|
<!ENTITY RegCondIfNotExists "3" >
|
|
|
|
<!-- Build types (single bit integer) -->
|
|
<!ENTITY BuildFree "16" >
|
|
<!ENTITY BuildChecked "256" >
|
|
|
|
<!-- Miscellaneous -->
|
|
<!ENTITY ZeroGUID "{00000000-0000-0000-0000-000000000000}" >
|
|
<!ENTITY DevClassRev "1" >
|
|
<!ENTITY Win2000eVer "5.01" >
|
|
]>
|
|
|
|
<DCARRIER CarrierRevision="1">
|
|
|
|
<!--//////////////////////////////////////////////////////////////////////-->
|
|
<!-- Printer device class prototype component -->
|
|
<!-- -->
|
|
<!-- All Printer device components inherit from this prototype -->
|
|
<!-- component. You can have common functionalities for a specific -->
|
|
<!-- device install class in this SLD, such as configuration DHTML -->
|
|
<!-- script or a special build script for the device class. -->
|
|
<!-- -->
|
|
<COMPONENT
|
|
ComponentVSGUID="{FC86EC6B-3790-4774-B22B-F53FB654BD23}"
|
|
ComponentVIGUID="{4816DA36-46A5-477e-9B9A-BE020527DB31}"
|
|
PlatformGUID="{B784E719-C196-4DDB-B358-D9254426C38D}"
|
|
RepositoryVSGUID="{8E0BE9ED-7649-47f3-810B-232D36C430B4}"
|
|
Revision="&DevClassRev;"
|
|
Visibility="1000"
|
|
MultiInstance="True"
|
|
Released="True"
|
|
Editable="True"
|
|
HTMLFinal="False"
|
|
>
|
|
<SCRIPTTEXT language="vbscript" src="Win2000ePlatform.vbs">
|
|
<![CDATA[
|
|
'////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Copyright (c) 1999-2000 Microsoft Corp. All Rights Reserved.
|
|
'
|
|
' File name:
|
|
'
|
|
' lib.vbs
|
|
'
|
|
' Abstract:
|
|
'
|
|
' Windows Embedded Prototype Script for Printers
|
|
'
|
|
' Remarks:
|
|
'
|
|
' This file encapsulates dependency mapping functionality. When a target
|
|
' designer user adds a printer driver component, this script examines the
|
|
' resource in the printer driver component and maps it to another component.
|
|
' For example, if a driver uses pscript5.dll, it must be a postscript
|
|
' printer, and it shall have the dependency for core postscript driver
|
|
' component.
|
|
'
|
|
' In order to do this, we have the mapIt function. mapIt needs an array of
|
|
' booleans that indicate whether a component is mapped or not. It works this
|
|
' way, first the client should go through all the resources and populate the
|
|
' componentFlagArray and then it should add the dependencies according to
|
|
' this array. To do it this way we remove the duplicate dependencies and we
|
|
' decouple the logic of selecting mapped dependent components and the logic
|
|
' of adding dependencies.
|
|
'
|
|
' Right now we have only three components, aka Core PostScript, Core Unidrv,
|
|
' and Core Plotter. Eventually we going to expand it so that every section
|
|
' in ntprint.inf, such as section [CNBJ], should be a separate component and
|
|
' should be mapped in this script.
|
|
'
|
|
' Author:
|
|
'
|
|
' Larry Zhu (lzhu) 11-29-2000
|
|
'
|
|
'////////////////////////////////////////////////////////////////////////////
|
|
|
|
Option Explicit
|
|
|
|
' define a component type
|
|
Class ComponentType
|
|
Public nComponentID ' This is a zero based index and id
|
|
Public strComponentVIGUID ' VI GUID of this component
|
|
Public enumClass
|
|
Public enumType
|
|
Public enumMinRevision
|
|
End Class
|
|
|
|
' define a tuple that maps a file to a component
|
|
Class PrinterFilesMappingTuple
|
|
Public strFileName
|
|
Public nComponentID
|
|
End Class
|
|
|
|
'//////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' define the tables to store the mapping relations
|
|
'
|
|
'/////////////////////////////////////////////////////////////////////////////////
|
|
' define the table of components
|
|
Public g_componentTuples()
|
|
ReDim g_componentTuples(10) ' No need to increase this number
|
|
|
|
Public g_nComponents: g_nComponents = 0 ' Num of components
|
|
|
|
' define the table of mappings
|
|
Public g_printerFilesMappingTuples()
|
|
ReDim g_printerFilesMappingTuples(20) ' No need to increase this number
|
|
|
|
Public g_nTableEntries: g_nTableEntries = 0 ' Num of table entries
|
|
|
|
' whether the tables above are initialized
|
|
Public g_bAreTablesInitialized: g_bAreTablesInitialized = False
|
|
|
|
'////////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Function name:
|
|
'
|
|
' addTuple
|
|
'
|
|
' Function description:
|
|
'
|
|
' This subroutine adds one mapping tuple at a time and updates the mapping
|
|
' table in g_printerFilesMappingTuples
|
|
'
|
|
' Arguments:
|
|
'
|
|
' strFileName -- the file to be mapped
|
|
' nComponent -- the component ID
|
|
'
|
|
'//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
Sub addTuple(strFileName, nComponentID)
|
|
|
|
'
|
|
' ReDim is expensive, to avoid excessive redim we double the array size when
|
|
' the table is not large enough
|
|
'
|
|
If (UBound(g_printerFilesMappingTuples) < g_nTableEntries) Then
|
|
ReDim Preserve g_printerFilesMappingTuples(2*UBound(g_printerFilesMappingTuples))
|
|
End If
|
|
|
|
Set g_printerFilesMappingTuples(g_nTableEntries) = New PrinterFilesMappingTuple
|
|
g_printerFilesMappingTuples(g_nTableEntries).strFileName = strFileName
|
|
g_printerFilesMappingTuples(g_nTableEntries).nComponentID = nComponentID
|
|
|
|
g_nTableEntries = g_nTableEntries + 1
|
|
|
|
End Sub
|
|
|
|
'////////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Function name:
|
|
'
|
|
' addComponent
|
|
'
|
|
' Function description:
|
|
'
|
|
' This sub adds one component at a time to the component table
|
|
' g_componentTuples and it increments the number of component
|
|
' g_nComponents.
|
|
'
|
|
' Arguments:
|
|
'
|
|
' enumClass -- the component class
|
|
' enumType -- the component type
|
|
' strComponentVIGUID -- the VI GUID for the component
|
|
' enumMinRevision -- the minimum revision for the component
|
|
'
|
|
' Return value:
|
|
'
|
|
' The component ID for the component just added
|
|
'
|
|
'//////////////////////////////////////////////////////////////////////////////////
|
|
Function addComponent(enumClass, enumType, strComponentVIGUID, enumMinRevision)
|
|
|
|
Dim oneComponent: Set oneComponent = New ComponentType
|
|
|
|
oneComponent.nComponentID = g_nComponents
|
|
oneComponent.enumClass = enumClass
|
|
oneComponent.enumType = enumType
|
|
oneComponent.strComponentVIGUID = strComponentVIGUID
|
|
oneComponent.enumMinRevision = enumMinRevision
|
|
|
|
'
|
|
' add one more element into component table
|
|
'
|
|
|
|
'
|
|
' ReDim is expensive, to avoid excessive redim we double the array size
|
|
' when the table is not large enough
|
|
'
|
|
If (UBound(g_componentTuples) < g_nComponents) Then
|
|
ReDim Preserve g_componentTuples(2*UBound(g_componentTuples))
|
|
End If
|
|
|
|
Set g_componentTuples(g_nComponents) = oneComponent
|
|
|
|
g_nComponents = g_nComponents + 1
|
|
|
|
addComponent = oneComponent.nComponentID
|
|
|
|
End Function
|
|
|
|
'////////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Function name:
|
|
'
|
|
' InitializeTables
|
|
'
|
|
' Function description:
|
|
'
|
|
' This function initializes the tables of mapping tuples and the table of
|
|
' components which are stored in g_printerFilesMappingTuples and
|
|
' g_componentTuples respectively. It is safe to call this sub more than
|
|
' once.
|
|
'
|
|
' Arguments:
|
|
'
|
|
' None
|
|
'
|
|
'//////////////////////////////////////////////////////////////////////////////////
|
|
Sub InitializeTables()
|
|
|
|
' make sure this routine is executed only once
|
|
If g_bAreTablesInitialized Then Exit Sub
|
|
|
|
g_bAreTablesInitialized = True
|
|
|
|
Dim strComponentVIGUID, enumMinRevision
|
|
|
|
'////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Printer Components
|
|
'
|
|
' Remark: This part needs to be manually updated
|
|
'
|
|
'////////////////////////////////////////////////////////////////////////////
|
|
|
|
' Core PostScript Component
|
|
Dim corePS_ID
|
|
|
|
strComponentVIGUID = "{C32DA828-9D90-4311-8FC5-AEFC65FAE2D3}"
|
|
enumMinRevision = 1
|
|
|
|
corePS_ID = addComponent(cmiInclude, cmiExactlyOne, strComponentVIGUID, enumMinRevision)
|
|
|
|
' Core Unidrv Component
|
|
Dim coreUnidrv_ID
|
|
|
|
strComponentVIGUID = "{7EC3F69D-1DA9-4C8C-8F76-FA28E5531454}"
|
|
enumMinRevision = 1
|
|
|
|
coreUnidrv_ID = addComponent(cmiInclude, cmiExactlyOne, strComponentVIGUID, enumMinRevision)
|
|
|
|
' Core Plotter Component
|
|
Dim corePlotter_ID
|
|
|
|
strComponentVIGUID = "{6DC05E80-59AF-4557-9904-79112273CE27}"
|
|
enumMinRevision = 1
|
|
|
|
corePlotter_ID = addComponent(cmiInclude, cmiExactlyOne, strComponentVIGUID, enumMinRevision)
|
|
|
|
'////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Add the mapping table
|
|
'
|
|
'////////////////////////////////////////////////////////////////////////////
|
|
|
|
' mapping for PostScript
|
|
addTuple "pscript5.dll", corePS_ID
|
|
addTuple "ps5ui.dll", corePS_ID
|
|
|
|
' mapping for UniDrv
|
|
addTuple "unidrvui.dll", coreUnidrv_ID
|
|
addTuple "unidrv.dll", coreUnidrv_ID
|
|
|
|
' mapping for plotter
|
|
addTuple "plotter.dll", corePlotter_ID
|
|
addTuple "plotui.dll", corePlotter_ID
|
|
|
|
End Sub
|
|
|
|
'////////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Function name:
|
|
'
|
|
' isValid
|
|
'
|
|
' Function description:
|
|
'
|
|
' This function checks whether the componentFlagArray has exactly one elment for each
|
|
' compenent.
|
|
'
|
|
' Arguments:
|
|
'
|
|
' componentFlagArray -- an array of flags that indicate which component
|
|
' is mapped
|
|
'
|
|
' Return value
|
|
'
|
|
' True if componentFlagArray has exactly one element for each component
|
|
'
|
|
'///////////////////////////////////////////////////////////////////////////////////
|
|
Function isValid(componentFlagArray)
|
|
If (Not UBound(componentFlagArray) = (g_nComponents - 1)) Or (Not g_bAreTablesInitialized) Then
|
|
isValid = False
|
|
Exit Function
|
|
End If
|
|
isValid = True
|
|
End Function
|
|
|
|
'////////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Function name:
|
|
'
|
|
' mapIt
|
|
'
|
|
' Function description:
|
|
'
|
|
' This function fills the componentFlagArry, which must be an array of
|
|
' booleans in componentFlagArry with number of elements equal to the number of components
|
|
' in componentTuples
|
|
'
|
|
' Example usage:
|
|
'
|
|
' Dim componentFlagArray()
|
|
' Dim componentFlagArray(g_nComponentIndex)
|
|
'
|
|
' ' initialize this array to have all vlaues False if you prefer to
|
|
'
|
|
' If Not isValid(componentFlagArray) Then
|
|
' < your function name > = False
|
|
' Exit Function
|
|
' End If
|
|
'
|
|
' call mapIt(strFileName, componentFlagArray)
|
|
'
|
|
' Arguments:
|
|
'
|
|
' strFileName -- the name of dependent file
|
|
' componentFlagArray -- an array of flags that indicate which component
|
|
' is mapped
|
|
'
|
|
' Return value
|
|
'
|
|
' True if strFileName is mapped to a component, False otherwise
|
|
'
|
|
'///////////////////////////////////////////////////////////////////////////////////
|
|
Function mapIt(strFileName, componentFlagArray())
|
|
|
|
mapIt = False
|
|
Dim i
|
|
|
|
For i = 0 To (g_nTableEntries - 1)
|
|
If 0 = StrComp(strFileName, g_printerFilesMappingTuples(i).strFileName, 1) Then
|
|
componentFlagArray(g_printerFilesMappingTuples(i).nComponentID) = True
|
|
mapIt = True
|
|
Exit Function
|
|
End If
|
|
Next
|
|
|
|
End Function
|
|
|
|
'////////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Function name:
|
|
'
|
|
' initComponentFlagArray
|
|
'
|
|
' Function description:
|
|
'
|
|
' This function initializes componentFlagArray
|
|
'
|
|
' Arguments:
|
|
'
|
|
' componentFlagArray -- an array of flags that indicate which component
|
|
' is mapped
|
|
'
|
|
'///////////////////////////////////////////////////////////////////////////////////
|
|
Sub initComponentFlagArray(componentFlagArray)
|
|
Dim i
|
|
|
|
For i = 0 To UBound(componentFlagArray)
|
|
componentFlagArray(i) = False
|
|
Next
|
|
End Sub
|
|
|
|
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
|
|
'////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Copyright (c) 1999-2000 Microsoft Corp. All Rights Reserved.
|
|
'
|
|
' File name:
|
|
'
|
|
' cmi.vbs
|
|
'
|
|
' Abstract:
|
|
'
|
|
' Windows Embedded Prototype Script for Printers
|
|
'
|
|
' Remarks:
|
|
'
|
|
' CMI helper functions and event handlers.
|
|
'
|
|
' Author:
|
|
'
|
|
' Larry Zhu (lzhu) 12-25-2000
|
|
'
|
|
'////////////////////////////////////////////////////////////////////////////
|
|
|
|
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
'
|
|
' Cmi helper functions
|
|
'
|
|
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
|
|
'////////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Function name:
|
|
'
|
|
' fillComponentFlagArray
|
|
'
|
|
' Function description:
|
|
'
|
|
' This function fills componentFlagArray
|
|
'
|
|
' Arguments:
|
|
'
|
|
' oResouces -- Resouces collection
|
|
' componentFlagArray -- an array of flags that indicate which component
|
|
' is mapped
|
|
'
|
|
'///////////////////////////////////////////////////////////////////////////////////
|
|
Sub fillComponentFlagArray(oResources, componentFlagArray)
|
|
Dim oRes
|
|
Dim bMapped
|
|
Dim strFileName
|
|
|
|
' get all the mapped components
|
|
For Each oRes In oResources ' For each resource..
|
|
If 0 = StrComp(oRes.Type.Name, "File", 1) Then
|
|
strFileName = oRes.Properties("DstName")
|
|
bMapped = mapIt(strFileName, componentFlagArray)
|
|
If (bMapped) Then
|
|
TraceState strFileName, " is mapped"
|
|
Else
|
|
TraceState strFileName, " is not mapped"
|
|
End If
|
|
End If
|
|
Next
|
|
End Sub
|
|
|
|
'////////////////////////////////////////////////////////////////////////////////////
|
|
'
|
|
' Function name:
|
|
'
|
|
' mapComponents
|
|
'
|
|
' Function description:
|
|
'
|
|
' This function maps components using componentFlagArray
|
|
'
|
|
' Arguments:
|
|
'
|
|
' oDependencies -- Dependency collection
|
|
' componentFlagArray -- an array of flags that indicate which component
|
|
' is mapped
|
|
'
|
|
'///////////////////////////////////////////////////////////////////////////////////
|
|
Sub mapComponents(oDependencies, componentFlagArray)
|
|
Dim strComponentVIGUID
|
|
Dim iclass
|
|
Dim iMinRevision
|
|
Dim iType
|
|
Dim i
|
|
|
|
' add the mapped components to the dependencies collection
|
|
For i = 0 To (g_nComponents - 1)
|
|
If componentFlagArray(i) Then
|
|
strComponentVIGUID = g_componentTuples(i).strComponentVIGUID
|
|
iclass = g_componentTuples(i).enumClass
|
|
iType = g_componentTuples(i).enumType
|
|
iMinRevision = g_componentTuples(i).enumMinRevision
|
|
|
|
TraceState " Add dependency of ", strComponentVIGUID
|
|
|
|
oDependencies.Add iclass, iType, strComponentVIGUID, iMinRevision
|
|
End If
|
|
Next
|
|
End Sub
|
|
|
|
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
'
|
|
' These are cmi event handlers
|
|
'
|
|
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
Function cmiOnAddInstance()
|
|
|
|
TraceEnter "PrinterProto::cmiOnAddInstance"
|
|
TraceState "PrinterProto::cmiThis.Comment", cmiThis.Comment
|
|
|
|
' must call this method to populate the instance
|
|
cmiOnAddInstance = cmiSuper.cmiOnAddInstance
|
|
|
|
initializeTables ' safe to call it more than once
|
|
|
|
Dim componentFlagArray()
|
|
ReDim componentFlagArray(g_nComponents - 1)
|
|
|
|
' initialize componentFlagArray
|
|
initComponentFlagArray componentFlagArray
|
|
|
|
If Not isValid(componentFlagArray) Then
|
|
cmiOnAddInstance = False
|
|
Exit Function
|
|
End If
|
|
|
|
' fill componentFlagArray
|
|
fillComponentFlagArray cmiThis.Resources, componentFlagArray
|
|
|
|
' map all the components
|
|
mapComponents cmiThis.Dependencies, componentFlagArray
|
|
|
|
cmiOnAddInstance = True
|
|
|
|
TraceLeave "PrinterProto::cmiOnAddInstance"
|
|
|
|
End Function
|
|
|
|
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
|
|
|
]]>
|
|
|
|
</SCRIPTTEXT>
|
|
|
|
<!-- Standard Properties -->
|
|
<DISPLAYNAME>Printer device class prototype component</DISPLAYNAME>
|
|
<VERSION>&Win2000eVer;</VERSION>
|
|
<DESCRIPTION>Printer device class prototype component</DESCRIPTION>
|
|
<COPYRIGHT>Copyright (c) 2000 Microsoft Corp. All Rights Reserved.</COPYRIGHT>
|
|
<VENDOR>Microsoft</VENDOR>
|
|
<OWNERS>sjang</OWNERS>
|
|
<AUTHORS>sjang</AUTHORS>
|
|
<DATECREATED>10/17/2000</DATECREATED>
|
|
<DATEREVISED>10/17/2000</DATEREVISED>
|
|
<GROUPMEMBER GroupVSGUID="{D7523171-4196-45c3-BA4A-46ECD881D49B}"/>
|
|
<GROUPMEMBER GroupVSGUID="{E01B4103-3883-4fe8-992F-10566E7B796C}"/>
|
|
|
|
</COMPONENT>
|
|
|
|
</DCARRIER>
|