Photoshop C++ API (Returning a custom ActionDescriptor)

Hope someone knows the answer here.

I am trying to return a Action descriptor that I create on a PS application in my PS plugin but I can’t seem to return it:

PIActionDescriptor desc = NULL;
PIActionDescriptor desc2 = NULL;
sPSActionDescriptor->Make(&desc);
sPSActionDescriptor->Make(&desc2);

sPSActionDescriptor->PutString(desc2, 'Glob', "MyString");

//This is not getting the reference to desc2
sPSRegistry->Get("Glob" , &desc);

sPSActionDescriptor->GetString(desc, 'Glob', myOutput, 512);

//myOutput: null.

Either I’m using the sPSRegistry wrong or I need some other library to return the Action descriptor, Javascript contains a ‘getCustomOptions()’ that is used to return a ActionDesc, but I am told there is no such thing is the API.

Any help here would be appreciated!