ReactOS 0.4.15-dev-7897-g78dc504
rpcdname.c File Reference
#include <wintirpc.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for rpcdname.c:

Go to the source code of this file.

Functions

static charget_default_domain ()
 
int __rpc_get_default_domain (char **domain)
 

Variables

static chardefault_domain = NULL
 

Function Documentation

◆ __rpc_get_default_domain()

int __rpc_get_default_domain ( char **  domain)

Definition at line 72 of file rpcdname.c.

74{
75 if ((*domain = get_default_domain()) != 0)
76 return (0);
77 return (-1);
78}
static char * get_default_domain()
Definition: rpcdname.c:43
Definition: cookie.c:42

Referenced by host2netname(), netname2host(), netname2user(), and user2netname().

◆ get_default_domain()

static char * get_default_domain ( )
static

Definition at line 43 of file rpcdname.c.

44{
45#ifndef _WIN32
46 char temp[256];
47#endif
48
50 return (default_domain);
51#ifndef _WIN32 // Need a WIN32 version?
52 if (getdomainname(temp, sizeof(temp)) < 0)
53 return (0);
54 if ((int) strlen(temp) > 0) {
55 default_domain = (char *)malloc((strlen(temp)+(unsigned)1));
56 if (default_domain == 0)
57 return (NULL);
59 return (default_domain);
60 }
61#endif
62 return (NULL);
63}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
static int getdomainname()
Definition: nfs41_daemon.c:290
static char * default_domain
Definition: rpcdname.c:40
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by __rpc_get_default_domain().

Variable Documentation

◆ default_domain

char* default_domain = NULL
static

Definition at line 40 of file rpcdname.c.

Referenced by get_default_domain().