本文整理匯總了C++中ACE_REGISTRY_CALL_RETURN函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACE_REGISTRY_CALL_RETURN函數的具體用法?C++ ACE_REGISTRY_CALL_RETURN怎麽用?C++ ACE_REGISTRY_CALL_RETURN使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ACE_REGISTRY_CALL_RETURN函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ACE_TEXT_RegCreateKeyEx
// Insert or update <naming_context> with <name> relative to <this> context
// (String version)
int
ACE_Registry::Naming_Context::bind_context (const ACE_TString &name,
/* const */ Naming_Context &naming_context,
u_long persistence,
u_long security_access,
LPSECURITY_ATTRIBUTES security_attributes)
{
u_long reason;
long result = ACE_TEXT_RegCreateKeyEx (this->key_,
name.c_str (),
0,
0,
persistence,
security_access,
security_attributes,
&naming_context.key_,
&reason);
if (result == ERROR_SUCCESS)
{
// Set the correct parent
naming_context.parent (this->key_);
// Set the correct name
naming_context.name (name);
}
ACE_REGISTRY_CALL_RETURN (result);
}
示例2: ACE_TEXT_RegQueryValueEx
// Find <object> with <name> in <this> context
// (String version)
int
ACE_Registry::Naming_Context::resolve (const ACE_TString &name,
Object &object)
{
// Get object state
u_long type;
void *data = object.data ();
u_long size = object.size ();
long result = ACE_TEXT_RegQueryValueEx (this->key_,
name.c_str (),
0,
&type,
(BYTE *)data,
&size);
if (result == ERROR_SUCCESS)
{
// Reset object state
// No need to set object.data()
object.type (type);
object.size (size);
}
ACE_REGISTRY_CALL_RETURN (result);
}
示例3: defined
/* static */
int
ACE_Predefined_Naming_Contexts::connect (ACE_Registry::Naming_Context &naming_context,
HKEY predefined,
const ACE_TCHAR *machine_name)
{
#if defined (ACE_HAS_WINCE)
return -1;
#else
long result = -1;
if (machine_name != 0 && ACE_OS::strcmp (ACE_TEXT ("localhost"), machine_name) == 0)
machine_name = 0;
if (predefined == HKEY_LOCAL_MACHINE || predefined == HKEY_USERS)
result =
ACE_TEXT_RegConnectRegistry (const_cast<ACE_TCHAR *> (machine_name),
predefined,
&naming_context.key_);
if (predefined == HKEY_CURRENT_USER || predefined == HKEY_CLASSES_ROOT)
// Make sure that for these types, the machine is local
if (machine_name == 0 ||
ACE_Predefined_Naming_Contexts::is_local_host (machine_name))
{
naming_context.key_ = predefined;
result = 0;
}
else
result = -1;
ACE_REGISTRY_CALL_RETURN (result);
#endif // ACE_HAS_WINCE
}
示例4: ACE_TEXT_RegDeleteKey
// Remove naming_context with <name> from <this> context
// (String version)
int
ACE_Registry::Naming_Context::unbind_context (const ACE_TString &name)
{
long result = ACE_TEXT_RegDeleteKey (this->key_,
name.c_str ());
ACE_REGISTRY_CALL_RETURN (result);
}
示例5: ACE_TEXT_RegSetValueEx
// Insert or update <object> with <name> into <this> context
// (String version)
int
ACE_Registry::Naming_Context::bind (const ACE_TString &name,
const Object &object)
{
long result = ACE_TEXT_RegSetValueEx (this->key_,
name.c_str (),
0,
object.type (),
(const BYTE *) object.data (),
object.size ());
ACE_REGISTRY_CALL_RETURN (result);
}
示例6: ACE_TEXT_RegOpenKeyEx
// Find <naming_context> with <name> in <this> context
// (String version)
int
ACE_Registry::Naming_Context::resolve_context (const ACE_TString &name,
Naming_Context &naming_context,
u_long security_access)
{
long result = ACE_TEXT_RegOpenKeyEx (this->key_,
name.c_str (),
0,
security_access,
&naming_context.key_);
if (result == ERROR_SUCCESS)
{
// set the correct parent
naming_context.parent (this->key_);
// set the correct name
naming_context.name (name);
}
ACE_REGISTRY_CALL_RETURN (result);
}
示例7: ACE_REGISTRY_CALL_RETURN
// Close the handle of the context
int
ACE_Registry::Naming_Context::close (void)
{
long result = this->key_ ? ::RegCloseKey (this->key_) : ERROR_SUCCESS;
ACE_REGISTRY_CALL_RETURN (result);
}