4.1 Creating a New E-Mail Address for a Supported Address Type

To create a new e-mail address for one of the supported address types, the client has to first request the list of supported address types from the server by calling the NspiGetSpecialTable function, as described in [MS-NSPI] and [MS-OXNSPI] section 3.1.4.1.3. The first step is to bind to the server by using the NspiBind function, as described in [MS-NSPI] and [MS-OXNSPI] section 3.1.4.1.1, call to retrieve an RPC context handle for the server.

The NspiGetSpecialTable function, as described in [MS-NSPI] and [MS-OXNSPI] section 3.1.4.1.3, is then called, passing the NspiAddressCreationTemplates flag (0x00000002) in the dwFlags parameter.

The following are the input parameters for the NspiGetSpecialTable function call.

Note Not all parameters are shown, only relevant information. For more information about the parameters, see [MS-NSPI] and [MS-OXNSPI] section 3.1.4.1.3.

 dwFlags: 0x00000002
 pStat: hIndex=0x00000000,
      ContainerID=0xcccccccc,
      CurrentRec=0x00000000,
      Delta=0x00000000,
      NumPos=0x00000000,
      TotalRecs=0xcccccccc,
     CodePage =0x000004e4,
     TemplateLocale=0x00000409,
      SortLocale=0x00000409
 lpVersion: Not used - 0xcccccccc

The call returns a PropertyRowSet_r structure in the ppRows parameter. The following is an example of the ppRows parameter that can be returned.

 ppRows:     cRows - 0x00000005
      Row0
           cValues - 0x00000007
           ulAdrEntryPad - not used - 0x00000000
                Prop0
                     ulPropTag - PidTagDisplayName (0x3001001e)
                     ulReserved - not used - 0x00000000
                     Value - cc:Mail Address
                Prop1
                     ulPropTag - PidTagAddressType (0x3002001e)
                     ulReserved - not used - 0x00000000
                     Value - CCMAIL
                Prop2
                     ulPropTag - PidTagDisplayType (0x39000003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop3
                     ulPropTag - PidTagDepth (0x30050003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop4
                     ulPropTag - PidTagSelectable (0x3609000b)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000001
                Prop5
                     ulPropTag - PidTagInstanceKey (0x0ff60102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02957c9c
 0000 d6 23 00 00                                     .#..
                Prop6
                     ulPropTag - PidTagEntryId (0x0fff0102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02957ca0
 0000 00 00 00 00 dc a7 40 c8-c0 42 10 1a b4 b9 08 00 ......@..B......
 0010 2b 2f e1 82 01 00 00 00-02 01 00 00 2f 6f 3d 4e +/........../o=N
 0020 54 35 2f 6f 75 3d 30 30-30 30 30 30 30 30 30 30 T5/ou=0000000000
 0030 30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30 0000000000000000
 0040 30 30 30 30 30 30 2f 63-6e 3d 34 33 33 34 34 43 000000/cn=43344C
 0050 30 37 44 34 43 45 41 36-34 46 42 45 39 34 32 37 07D4CEA64FBE9427
 0060 43 44 31 36 41 31 33 43-44 34 00                CD16A13CD4.
      Row1
           cValues - 0x00000007
           ulAdrEntryPad - not used - 0x00000000
                Prop0
                     ulPropTag - PidTagDisplayName (0x3001001e)
                     ulReserved - not used - 0x00000000
                     Value - Microsoft Mail Address
                Prop1
                     ulPropTag - PidTagAddressType (0x3002001e)
                     ulReserved - not used - 0x00000000
                     Value - MS
                Prop2
                     ulPropTag - PidTagDisplayType (0x39000003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop3
                     ulPropTag - PidTagDepth (0x30050003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop4
                     ulPropTag - PidTagSelectable (0x3609000b)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000001
                Prop5
                     ulPropTag - PidTagInstanceKey (0x0ff60102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02957df0
 0000 d3 23 00 00                                     .#..
                Prop6
                     ulPropTag - PidTagEntryId (0x0fff0102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02957df4
 0000 00 00 00 00 dc a7 40 c8-c0 42 10 1a b4 b9 08 00 ......@..B......
 0010 2b 2f e1 82 01 00 00 00-02 01 00 00 2f 6f 3d 4e +/........../o=N
 0020 54 35 2f 6f 75 3d 30 30-30 30 30 30 30 30 30 30 T5/ou=0000000000
 0030 30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30 0000000000000000
 0040 30 30 30 30 30 30 2f 63-6e 3d 37 46 32 36 33 44 000000/cn=7F263D
 0050 42 37 42 39 35 31 41 32-34 33 38 38 45 43 42 39 B7B951A24388ECB9
 0060 37 39 34 36 38 42 43 42-45 45 00                79468BCBEE.
      Row2
           cValues - 0x00000007
           ulAdrEntryPad - not used - 0x00000000
                Prop0
                     ulPropTag - PidTagDisplayName (0x3001001e)
                     ulReserved - not used - 0x00000000
                     Value - MacMail Address
                Prop1
                     ulPropTag - PidTagAddressType (0x3002001e)
                     ulReserved - not used - 0x00000000
                     Value - MSA
                Prop2
                     ulPropTag - PidTagDisplayType (0x39000003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop3
                     ulPropTag - PidTagDepth (0x30050003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop4
                     ulPropTag - PidTagSelectable (0x3609000b)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000001
                Prop5
                     ulPropTag - PidTagInstanceKey (0x0ff60102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02957f40
 0000 d5 23 00 00                                     .#..
                Prop6
                     ulPropTag - PidTagEntryId (0x0fff0102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02957f44
 0000 00 00 00 00 dc a7 40 c8-c0 42 10 1a b4 b9 08 00 ......@..B......
 0010 2b 2f e1 82 01 00 00 00-02 01 00 00 2f 6f 3d 4e +/........../o=N
 0020 54 35 2f 6f 75 3d 30 30-30 30 30 30 30 30 30 30 T5/ou=0000000000
 0030 30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30 0000000000000000
 0040 30 30 30 30 30 30 2f 63-6e 3d 37 42 35 30 35 30 000000/cn=7B5050
 0050 37 33 41 44 44 41 44 33-34 39 38 33 30 42 32 43 73ADDAD349830B2C
 0060 35 46 41 39 38 32 36 33-44 46 00                5FA98263DF.
      Row3
           cValues - 0x00000007
           ulAdrEntryPad - not used - 0x00000000
                Prop0
                     ulPropTag - PidTagDisplayName (0x3001001e)
                     ulReserved - not used - 0x00000000
                     Value - Internet Address
                Prop1
                     ulPropTag - PidTagAddressType (0x3002001e)
                     ulReserved - not used - 0x00000000
                     Value - SMTP
                Prop2
                     ulPropTag - PidTagDisplayType (0x39000003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop3
                     ulPropTag - PidTagDepth (0x30050003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop4
                     ulPropTag - PidTagSelectable (0x3609000b)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000001
                Prop5
                     ulPropTag - PidTagInstanceKey (0x0ff60102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02956320
 0000 d4 23 00 00                                     .#..
                Prop6
                     ulPropTag - PidTagEntryId (0x0fff0102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02956324
 0000 00 00 00 00 dc a7 40 c8-c0 42 10 1a b4 b9 08 00 ......@..B......
 0010 2b 2f e1 82 01 00 00 00-02 01 00 00 2f 6f 3d 4e +/........../o=N
 0020 54 35 2f 6f 75 3d 30 30-30 30 30 30 30 30 30 30 T5/ou=0000000000
 0030 30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30 0000000000000000
 0040 30 30 30 30 30 30 2f 63-6e 3d 41 39 36 30 39 33 000000/cn=A96093
 0050 42 30 45 33 34 45 43 46-34 37 38 42 38 38 42 36 B0E34ECF478B88B6
 0060 41 43 36 36 41 36 32 35-42 43 00                AC66A625BC.
      Row4
           cValues - 0x00000007
           ulAdrEntryPad - not used - 0x00000000
                Prop0
                     ulPropTag - PidTagDisplayName (0x3001001e)
                     ulReserved - not used - 0x00000000
                     Value - X.400 Address
                Prop1
                     ulPropTag - PidTagAddressType (0x3002001e)
                     ulReserved - not used - 0x00000000
                     Value - X400
                Prop2
                     ulPropTag - PidTagDisplayType (0x39000003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop3
                     ulPropTag - PidTagDepth (0x30050003)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000000
                Prop4
                     ulPropTag - PidTagSelectable (0x3609000b)
                     ulReserved - not used - 0x00000000
                     Value - 0x00000001
                Prop5
                     ulPropTag - PidTagInstanceKey (0x0ff60102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02956474
 0000 d2 23 00 00                                     .#..
                Prop6
                     ulPropTag - PidTagEntryId (0x0fff0102)
                     ulReserved - not used - 0x00000000
                     Value - 0x02956478
 0000 00 00 00 00 dc a7 40 c8-c0 42 10 1a b4 b9 08 00 ......@..B......
 0010 2b 2f e1 82 01 00 00 00-02 01 00 00 2f 6f 3d 4e +/........../o=N
 0020 54 35 2f 6f 75 3d 30 30-30 30 30 30 30 30 30 30 T5/ou=0000000000
 0030 30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30 0000000000000000
 0040 30 30 30 30 30 30 2f 63-6e 3d 34 45 38 30 41 46 000000/cn=4E80AF
 0050 33 41 34 37 34 44 38 46-34 45 38 46 45 39 31 41 3A474D8F4E8FE91A
 0060 32 43 41 43 42 46 39 38-44 43 00                2CACBF98DC.
  
  

These rows are then used to create a list of address types, and this list is displayed so that the user can choose which type to create. The "cc:Mail Address" row is selected and examined, and the PidTagAddressType ([MS-OXPROPS] section 2.567) and PidTagEntryId ([MS-OXPROPS] section 2.674) property values are extracted. The PidTagEntryId property is parsed and the DN is determined to be the following.

  
 /o=NT5/ou=00000000000000000000000000000000/cn=43344C07D4CEA64FBE9427CD16A13CD4

This value is passed to NSPIGetTemplateInfo function, as described in [MS-NSPI] and [MS-OXNSPI] section 3.1.4.1.18, as the pDN parameter to retrieve the creation template. The following are the input parameters that are passed to NspiGetTemplateInfo function.

 dwFlags:                 0x00000065
 ulType:                  0x00000000
 pDN:                     /o=NT5/ou=00000000000000000000000000000000/cn=43344C07D4CEA64FBE9427CD16A13CD4
 dwCodePage:      0x000004e4
 ulLocaleID:  0x00000409
  
  

The NspiGetTemplateInfo function will return a PropertyRow_r structure in the ppData output parameter, and this PropertyRow_r structure will contain the template and script data. The NspiGetTemplateInfo function returns the following.

 ppData
      cValues - 0x00000002
      ulAdrEntryPad - not used - 0x00000000
           Prop0
                ulPropTag - PidTagTemplateData (0x00010102)
                ulReserved - not used - 0x00000000
                      TRowSet - Type - 0x00000001
                           cRows - 0x00000007
                           Row0
                               XPos - 0x00000000
                               XDelta - 0x00000000
                               YPos - 0x00000000
                               YDelta- 0x00000000
                               ControlType  - 0x00000008
                               ControlFlags - 0x00000d70
                               ControlStructure
                                    dwType - 0x00000000
                                    ulSize - 0x00000000
                                    ulString - 0x00000104
                                    General
                           Row1
                               XPos - 0x00000006
                               XDelta - 0x00000064
                               YPos - 0x0000000c
                               YDelta- 0x00000014
                               ControlType  - 0x00000000
                               ControlFlags - 0x00000000
                               ControlStructure
                                    dwType - 0x00000000
                                    ulSize - 0x00000000
                                    ulString - 0x0000010c
                                    &Display name:
                           Row2
                               XPos - 0x0000006b
                               XDelta - 0x000000fa
                               YPos - 0x0000000c
                               YDelta- 0x0000000c
                               ControlType  - 0x00000001
                               ControlFlags - 0x00000026
                               ControlStructure
                                    dwType - 0x3001001e
                                    ulSize - 0x00000100
                                    ulString - 0x0000011b
                                    *
                           Row3
                               XPos - 0x00000006
                               XDelta - 0x00000064
                               YPos - 0x00000023
                               YDelta- 0x00000014
                               ControlType  - 0x00000000
                               ControlFlags - 0x00000000
                               ControlStructure
                                    dwType - 0x00000000
                                    ulSize - 0x00000000
                                    ulString - 0x0000011d
                                    &Mailbox:
                           Row4
                               XPos - 0x0000006b
                               XDelta - 0x000000fa
                               YPos - 0x00000023
                               YDelta- 0x0000000c
                               ControlType  - 0x00000001
                               ControlFlags - 0x00000006
                               ControlStructure
                                    dwType - 0x6701001e
                                    ulSize - 0x00000100
                                    ulString - 0x00000127
                                    *
                           Row5
                               XPos - 0x00000006
                               XDelta - 0x00000064
                               YPos - 0x0000003a
                               YDelta- 0x00000014
                               ControlType  - 0x00000000
                               ControlFlags - 0x00000000
                               ControlStructure
                                    dwType - 0x00000000
                                    ulSize - 0x00000000
                                    ulString - 0x00000129
                                    &Post Office:
                           Row6
                               XPos - 0x0000006b
                               XDelta - 0x000000fa
                               YPos - 0x0000003a
                               YDelta- 0x0000000c
                               ControlType  - 0x00000001
                               ControlFlags - 0x00000006
                               ControlStructure
                                    dwType - 0x6702001e
                                    ulSize - 0x00000100
                                    ulString - 0x00000137
                                    *
 0000 01 00 00 00 07 00 00 00-00 00 00 00 00 00 00 00 ................
 0010 00 00 00 00 00 00 00 00-08 00 00 00 70 0d 00 00 ............p...
 0020 00 00 00 00 00 00 00 00-04 01 00 00 06 00 00 00 ................
 0030 64 00 00 00 0c 00 00 00-14 00 00 00 00 00 00 00 d...............
 0040 00 00 00 00 00 00 00 00-00 00 00 00 0c 01 00 00 ................
 0050 6b 00 00 00 fa 00 00 00-0c 00 00 00 0c 00 00 00 k...............
 0060 01 00 00 00 26 00 00 00-1e 00 01 30 00 01 00 00 ....&......0....
 0070 1b 01 00 00 06 00 00 00-64 00 00 00 23 00 00 00 ........d...#...
 0080 14 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
 0090 00 00 00 00 1d 01 00 00-6b 00 00 00 fa 00 00 00 ........k.......
 00a0 23 00 00 00 0c 00 00 00-01 00 00 00 06 00 00 00 #...............
 00b0 1e 00 01 67 00 01 00 00-27 01 00 00 06 00 00 00 ...g....'.......
 00c0 64 00 00 00 3a 00 00 00-14 00 00 00 00 00 00 00 d...:...........
 00d0 00 00 00 00 00 00 00 00-00 00 00 00 29 01 00 00 ............)...
 00e0 6b 00 00 00 fa 00 00 00-3a 00 00 00 0c 00 00 00 k.......:.......
 00f0 01 00 00 00 06 00 00 00-1e 00 02 67 00 01 00 00 ...........g....
 0100 37 01 00 00 47 65 6e 65-72 61 6c 00 26 44 69 73 7...General.&Dis
 0110 70 6c 61 79 20 6e 61 6d-65 3a 00 2a 00 26 4d 61 play name:.*.&Ma
 0120 69 6c 62 6f 78 3a 00 2a-00 26 50 6f 73 74 20 4f ilbox:.*.&Post O
 0130 66 66 69 63 65 3a 00 2a-00                      ffice:.*.
           Prop1
                ulPropTag - PidTagScriptData (0x00040102)
                ulReserved - not used - 0x00000000
                     Size – 0x0000000F
                      Operation Jump Not Exists - 0x00000004 
  
                           PropTag - 0x6701001e 
  
                           Offset - 0x00000014 
  
                      Operation Emit - 0x00000002 
  
                           PropTag - 0x6701001e 
  
                      Operation Emit String - 0x80000002 
  
                           Offset - 0x00000034 
  
  
                      Operation Jump Not Exists - 0x00000004 
  
                           PropTag - 0x6702001e 
  
                           Offset - 0x00000030 
  
                      Operation Emit - 0x00000002 
  
                           PropTag - 0x6702001e 
  
                      Operation Halt - 0x00000000 
  
 0000 0f 00 00 00 04 00 00 00-1e 00 01 67 14 00 00 00 ...........g.... 
  
 0010 02 00 00 00 1e 00 01 67-02 00 00 80 34 00 00 00 .......g....4... 
  
 0020 04 00 00 00 1e 00 02 67-30 00 00 00 02 00 00 00 .......g0....... 
  
 0030 1e 00 02 67 00 00 00 00-20 61 74 20 00 00 00 00 ...g.... at .... 
  
  

This template can be processed to create a dialog box similar to the one shown in the following figure.

Address creation dialog box

Figure 1: Address creation dialog box

The following data is then entered into the dialog box:

Display name: Bob

Mailbox: BobsMailbox

Post office: GeneralPostOffice

The script processes the data, and produces the following e-mail address:

BobsMailbox at GeneralPostOffice

Therefore, the PidTagEmailAddress property ([MS-OXPROPS] section 2.672) that represents this user is "BobsMailbox at GeneralPostOffice" and the PidTagAddressType property value is "CCMAIL."

Show: