rpc_client/cli_reg.c

ソースコードを見る。

関数

static WERROR rpccli_reg_open_hive_int (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16 op_code, const char *op_name, uint32 access_mask, POLICY_HND *hnd)
WERROR rpccli_reg_connect (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32 reg_type, uint32 access_mask, POLICY_HND *reg_hnd)
WERROR rpccli_reg_shutdown (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *msg, uint32 timeout, BOOL do_reboot, BOOL force)
WERROR rpccli_reg_abort_shutdown (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
WERROR rpccli_reg_flush_key (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd)
WERROR rpccli_reg_query_key (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, char *key_class, uint32 *class_len, uint32 *num_subkeys, uint32 *max_subkeylen, uint32 *max_classlen, uint32 *num_values, uint32 *max_valnamelen, uint32 *max_valbufsize, uint32 *sec_desc, NTTIME *mod_time)
WERROR rpccli_reg_getversion (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, uint32 *version)
WERROR rpccli_reg_query_value (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, const char *val_name, uint32 *type, REGVAL_BUFFER *buffer)
WERROR rpccli_reg_set_key_sec (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, uint32 sec_info, size_t secdesc_size, SEC_DESC *sec_desc)
WERROR rpccli_reg_get_key_sec (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, uint32 sec_info, uint32 *sec_buf_size, SEC_DESC_BUF *sec_buf)
WERROR rpccli_reg_delete_val (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, char *val_name)
WERROR rpccli_reg_delete_key (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, char *key_name)
WERROR rpccli_reg_create_key_ex (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, char *key_name, char *key_class, uint32 access_desired, POLICY_HND *key)
WERROR rpccli_reg_enum_key (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, int key_index, fstring key_name, fstring class_name, time_t *mod_time)
WERROR rpccli_reg_set_val (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, char *val_name, uint32 type, RPC_DATA_BLOB *data)
WERROR rpccli_reg_enum_val (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, int idx, fstring val_name, uint32 *type, REGVAL_BUFFER *value)
WERROR rpccli_reg_open_entry (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, char *key_name, uint32 access_desired, POLICY_HND *key_hnd)
WERROR rpccli_reg_close (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd)
WERROR rpccli_reg_save_key (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, const char *filename)
BOOL reg_split_hive (const char *full_keyname, uint32 *reg_type, pstring key_name)


関数

static WERROR rpccli_reg_open_hive_int ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
uint16  op_code,
const char *  op_name,
uint32  access_mask,
POLICY_HND hnd 
) [static]

cli_reg.c35 行で定義されています。

参照先 cliinit_reg_q_open_hive()REG_R_OPEN_HIVE::polreg_io_q_open_hive()reg_io_r_open_hive()REG_R_OPEN_HIVE::status.

参照元 rpccli_reg_connect().

00039 {
00040         REG_Q_OPEN_HIVE in;
00041         REG_R_OPEN_HIVE out;
00042         prs_struct qbuf, rbuf;
00043 
00044         ZERO_STRUCT(in);
00045         ZERO_STRUCT(out);
00046 
00047         init_reg_q_open_hive(&in, access_mask);
00048 
00049         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, op_code, 
00050                     in, out, 
00051                     qbuf, rbuf,
00052                     reg_io_q_open_hive,
00053                     reg_io_r_open_hive, 
00054                     WERR_GENERAL_FAILURE );
00055 
00056         if ( !W_ERROR_IS_OK( out.status ) )
00057                 return out.status;
00058 
00059         memcpy( hnd, &out.pol, sizeof(POLICY_HND) );
00060 
00061         return out.status;
00062 }

WERROR rpccli_reg_connect ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
uint32  reg_type,
uint32  access_mask,
POLICY_HND reg_hnd 
)

cli_reg.c68 行で定義されています。

参照先 clirpccli_reg_open_hive_int().

参照元 cac_RegConnect()rpc_registry_enumerate_internal()rpc_registry_save_internal().

00071 {       uint16 op_code;
00072         const char *op_name;
00073 
00074         ZERO_STRUCTP(reg_hnd);
00075 
00076         switch (reg_type)
00077         {
00078         case HKEY_CLASSES_ROOT:
00079                 op_code = REG_OPEN_HKCR;
00080                 op_name = "REG_OPEN_HKCR";
00081                 break;
00082         case HKEY_LOCAL_MACHINE:
00083                 op_code = REG_OPEN_HKLM;
00084                 op_name = "REG_OPEN_HKLM";
00085                 break;
00086         case HKEY_USERS:
00087                 op_code = REG_OPEN_HKU;
00088                 op_name = "REG_OPEN_HKU";
00089                 break;
00090         case HKEY_PERFORMANCE_DATA:
00091                 op_code = REG_OPEN_HKPD;
00092                 op_name = "REG_OPEN_HKPD";
00093                 break;
00094         default:
00095                 return WERR_INVALID_PARAM;
00096         }
00097 
00098         return rpccli_reg_open_hive_int(cli, mem_ctx, op_code, op_name,
00099                                      access_mask, reg_hnd);
00100 }

WERROR rpccli_reg_shutdown ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
const char *  msg,
uint32  timeout,
BOOL  do_reboot,
BOOL  force 
)

cli_reg.c106 行で定義されています。

参照先 cliinit_reg_q_shutdown()reg_io_q_shutdown()reg_io_r_shutdown()REG_R_SHUTDOWN::status.

参照元 rpc_reg_shutdown_internals().

00109 {
00110         REG_Q_SHUTDOWN in;
00111         REG_R_SHUTDOWN out;
00112         prs_struct qbuf, rbuf;
00113 
00114         if (msg == NULL) 
00115                 return WERR_INVALID_PARAM;
00116 
00117         ZERO_STRUCT (in);
00118         ZERO_STRUCT (out);
00119 
00120         /* Marshall data and send request */
00121 
00122         init_reg_q_shutdown(&in, msg, timeout, do_reboot, force);
00123 
00124         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_SHUTDOWN, 
00125                     in, out, 
00126                     qbuf, rbuf,
00127                     reg_io_q_shutdown,
00128                     reg_io_r_shutdown, 
00129                     WERR_GENERAL_FAILURE );
00130 
00131         return out.status;
00132 }

WERROR rpccli_reg_abort_shutdown ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx 
)

cli_reg.c137 行で定義されています。

参照先 clireg_io_q_abort_shutdown()reg_io_r_abort_shutdown()REG_R_ABORT_SHUTDOWN::status.

参照元 rpc_reg_shutdown_abort_internals().

00138 {
00139         REG_Q_ABORT_SHUTDOWN in;
00140         REG_R_ABORT_SHUTDOWN out;
00141         prs_struct qbuf, rbuf;
00142 
00143         ZERO_STRUCT (in);
00144         ZERO_STRUCT (out);
00145 
00146         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_ABORT_SHUTDOWN, 
00147                     in, out, 
00148                     qbuf, rbuf,
00149                     reg_io_q_abort_shutdown,
00150                     reg_io_r_abort_shutdown, 
00151                     WERR_GENERAL_FAILURE );
00152 
00153         return out.status;      
00154 }

WERROR rpccli_reg_flush_key ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd 
)

cli_reg.c163 行で定義されています。

参照先 cliinit_reg_q_flush_key()reg_io_q_flush_key()reg_io_r_flush_key()REG_R_FLUSH_KEY::status.

参照元 cac_delete_subkeys_recursive()cac_RegSetValue().

00165 {
00166         REG_Q_FLUSH_KEY in;
00167         REG_R_FLUSH_KEY out;
00168         prs_struct qbuf, rbuf;
00169 
00170         ZERO_STRUCT (in);
00171         ZERO_STRUCT (out);
00172         
00173         init_reg_q_flush_key(&in, hnd);
00174 
00175         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_FLUSH_KEY, 
00176                     in, out, 
00177                     qbuf, rbuf,
00178                     reg_io_q_flush_key,
00179                     reg_io_r_flush_key, 
00180                     WERR_GENERAL_FAILURE );
00181                     
00182         return out.status;
00183 }

WERROR rpccli_reg_query_key ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
char *  key_class,
uint32 *  class_len,
uint32 *  num_subkeys,
uint32 *  max_subkeylen,
uint32 *  max_classlen,
uint32 *  num_values,
uint32 *  max_valnamelen,
uint32 *  max_valbufsize,
uint32 *  sec_desc,
NTTIME mod_time 
)

cli_reg.c189 行で定義されています。

参照先 cliinit_reg_q_query_key()REG_R_QUERY_KEY::key_classREG_R_QUERY_KEY::max_subkeylenREG_R_QUERY_KEY::max_valbufsizeREG_R_QUERY_KEY::max_valnamelenREG_R_QUERY_KEY::mod_timeREG_R_QUERY_KEY::num_subkeysREG_R_QUERY_KEY::num_valuesreg_io_q_query_key()reg_io_r_query_key()REG_R_QUERY_KEY::sec_descREG_R_QUERY_KEY::statusUNISTR4::stringUNISTR2::uni_max_lenunistr2_to_ascii().

参照元 cac_RegQueryKeyInfo().

00196 {
00197         REG_Q_QUERY_KEY in;
00198         REG_R_QUERY_KEY out;
00199         prs_struct qbuf, rbuf;
00200         uint32 saved_class_len = *class_len;
00201 
00202         ZERO_STRUCT (in);
00203         ZERO_STRUCT (out);
00204 
00205         init_reg_q_query_key( &in, hnd, key_class );
00206 
00207         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_QUERY_KEY, 
00208                     in, out, 
00209                     qbuf, rbuf,
00210                     reg_io_q_query_key,
00211                     reg_io_r_query_key, 
00212                     WERR_GENERAL_FAILURE );
00213 
00214         if ( W_ERROR_EQUAL( out.status, WERR_MORE_DATA ) ) {
00215                 ZERO_STRUCT (in);
00216 
00217                 *class_len = out.key_class.string->uni_max_len;
00218                 if ( *class_len > saved_class_len )
00219                         return out.status;
00220                         
00221                 /* set a string of spaces and NULL terminate */
00222 
00223                 memset( key_class, (int)' ', *class_len );
00224                 key_class[*class_len] = '\0';
00225                 
00226                 init_reg_q_query_key( &in, hnd, key_class );
00227 
00228                 ZERO_STRUCT (out);
00229 
00230                 CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_QUERY_KEY, 
00231                             in, out, 
00232                             qbuf, rbuf,
00233                             reg_io_q_query_key,
00234                             reg_io_r_query_key, 
00235                             WERR_GENERAL_FAILURE );
00236         }
00237         
00238         if ( !W_ERROR_IS_OK( out.status ) )
00239                 return out.status;
00240 
00241         *class_len      = out.key_class.string->uni_max_len;
00242         unistr2_to_ascii(key_class, out.key_class.string, saved_class_len-1);
00243         *num_subkeys    = out.num_subkeys   ;
00244         *max_subkeylen  = out.max_subkeylen ;
00245         *num_values     = out.num_values    ;
00246         *max_valnamelen = out.max_valnamelen;
00247         *max_valbufsize = out.max_valbufsize;
00248         *sec_desc       = out.sec_desc      ;
00249         *mod_time       = out.mod_time      ;
00250         /* Maybe: *max_classlen = out.reserved; */
00251 
00252         return out.status;
00253 }

WERROR rpccli_reg_getversion ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
uint32 *  version 
)

cli_reg.c258 行で定義されています。

参照先 cliinit_reg_q_getversion()reg_io_q_getversion()reg_io_r_getversion()REG_R_GETVERSION::statusREG_R_GETVERSION::win_version.

参照元 cac_RegGetVersion().

00260 {
00261         REG_Q_GETVERSION in;
00262         REG_R_GETVERSION out;
00263         prs_struct qbuf, rbuf;
00264 
00265         ZERO_STRUCT (in);
00266         ZERO_STRUCT (out);
00267         
00268         init_reg_q_getversion(&in, hnd);
00269 
00270         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_GETVERSION, 
00271                     in, out, 
00272                     qbuf, rbuf,
00273                     reg_io_q_getversion,
00274                     reg_io_r_getversion, 
00275                     WERR_GENERAL_FAILURE );
00276                     
00277 
00278         if ( !W_ERROR_IS_OK( out.status ) )
00279                 return out.status;
00280                 
00281         *version = out.win_version;
00282 
00283         return out.status;
00284 }

WERROR rpccli_reg_query_value ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
const char *  val_name,
uint32 *  type,
REGVAL_BUFFER buffer 
)

cli_reg.c290 行で定義されています。

参照先 cliinit_reg_q_query_value()reg_io_q_query_value()reg_io_r_query_value()REG_R_QUERY_VALUE::statusREG_R_QUERY_VALUE::typeREG_R_QUERY_VALUE::value.

参照元 cac_RegQueryValue().

00293 {
00294         REG_Q_QUERY_VALUE in;
00295         REG_R_QUERY_VALUE out;
00296         prs_struct qbuf, rbuf;
00297 
00298         ZERO_STRUCT (in);
00299         ZERO_STRUCT (out);
00300         
00301         init_reg_q_query_value(&in, hnd, val_name, buffer);
00302 
00303         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_QUERY_VALUE, 
00304                     in, out, 
00305                     qbuf, rbuf,
00306                     reg_io_q_query_value,
00307                     reg_io_r_query_value, 
00308                     WERR_GENERAL_FAILURE );
00309                     
00310 
00311         if ( !W_ERROR_IS_OK( out.status ) )
00312                 return out.status;
00313                 
00314         *type   = *out.type;
00315         *buffer = *out.value;
00316 
00317         return out.status;
00318 }

WERROR rpccli_reg_set_key_sec ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
uint32  sec_info,
size_t  secdesc_size,
SEC_DESC sec_desc 
)

cli_reg.c324 行で定義されています。

参照先 cliinit_reg_q_set_key_sec()make_sec_desc_buf()reg_io_q_set_key_sec()reg_io_r_set_key_sec()REG_R_SET_KEY_SEC::status.

参照元 cac_RegSetKeySecurity().

00327 {
00328         REG_Q_SET_KEY_SEC in;
00329         REG_R_SET_KEY_SEC out;
00330         prs_struct qbuf, rbuf;
00331         SEC_DESC_BUF *sec_desc_buf;
00332 
00333         ZERO_STRUCT (in);
00334         ZERO_STRUCT (out);
00335         
00336         /* Flatten the security descriptor */
00337         
00338         if ( !(sec_desc_buf = make_sec_desc_buf(mem_ctx, secdesc_size, sec_desc)) )
00339                 return WERR_GENERAL_FAILURE;
00340                 
00341         init_reg_q_set_key_sec(&in, hnd, sec_info, sec_desc_buf);
00342 
00343         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_SET_KEY_SEC, 
00344                     in, out, 
00345                     qbuf, rbuf,
00346                     reg_io_q_set_key_sec,
00347                     reg_io_r_set_key_sec, 
00348                     WERR_GENERAL_FAILURE );
00349                     
00350 
00351         return out.status;
00352 }

WERROR rpccli_reg_get_key_sec ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
uint32  sec_info,
uint32 *  sec_buf_size,
SEC_DESC_BUF sec_buf 
)

cli_reg.c359 行で定義されています。

参照先 cliREG_R_GET_KEY_SEC::datainit_reg_q_get_key_sec()sec_desc_buf_info::lenreg_io_q_get_key_sec()reg_io_r_get_key_sec()REG_R_GET_KEY_SEC::status.

参照元 cac_RegGetKeySecurity().

00362 {
00363         REG_Q_GET_KEY_SEC in;
00364         REG_R_GET_KEY_SEC out;
00365         prs_struct qbuf, rbuf;
00366 
00367         ZERO_STRUCT (in);
00368         ZERO_STRUCT (out);
00369         
00370         init_reg_q_get_key_sec(&in, hnd, sec_info, *sec_buf_size, sec_buf);
00371 
00372         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_GET_KEY_SEC, 
00373                     in, out, 
00374                     qbuf, rbuf,
00375                     reg_io_q_get_key_sec,
00376                     reg_io_r_get_key_sec, 
00377                     WERR_GENERAL_FAILURE );
00378                     
00379 
00380         /* this might be able to return WERR_MORE_DATA, I'm not sure */
00381         
00382         if ( !W_ERROR_IS_OK( out.status ) )
00383                 return out.status;
00384         
00385         sec_buf       = out.data;
00386         *sec_buf_size = out.data->len;
00387                 
00388         return out.status;      
00389 }

WERROR rpccli_reg_delete_val ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
char *  val_name 
)

cli_reg.c395 行で定義されています。

参照先 cliinit_reg_q_delete_val()reg_io_q_delete_value()reg_io_r_delete_value()REG_R_DELETE_VALUE::status.

参照元 cac_RegDeleteValue().

00397 {
00398         REG_Q_DELETE_VALUE in;
00399         REG_R_DELETE_VALUE out;
00400         prs_struct qbuf, rbuf;
00401 
00402         ZERO_STRUCT (in);
00403         ZERO_STRUCT (out);
00404         
00405         init_reg_q_delete_val(&in, hnd, val_name);
00406 
00407         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_DELETE_VALUE, 
00408                     in, out, 
00409                     qbuf, rbuf,
00410                     reg_io_q_delete_value,
00411                     reg_io_r_delete_value, 
00412                     WERR_GENERAL_FAILURE );
00413         
00414         return out.status;
00415 }

WERROR rpccli_reg_delete_key ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
char *  key_name 
)

cli_reg.c421 行で定義されています。

参照先 cliinit_reg_q_delete_key()reg_io_q_delete_key()reg_io_r_delete_key()REG_R_DELETE_KEY::status.

参照元 cac_delete_subkeys_recursive()cac_RegDeleteKey().

00423 {
00424         REG_Q_DELETE_KEY in;
00425         REG_R_DELETE_KEY out;
00426         prs_struct qbuf, rbuf;
00427 
00428         ZERO_STRUCT (in);
00429         ZERO_STRUCT (out);
00430         
00431         init_reg_q_delete_key(&in, hnd, key_name);
00432 
00433         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_DELETE_KEY, 
00434                     in, out, 
00435                     qbuf, rbuf,
00436                     reg_io_q_delete_key,
00437                     reg_io_r_delete_key, 
00438                     WERR_GENERAL_FAILURE );
00439         
00440         return out.status;
00441 }

WERROR rpccli_reg_create_key_ex ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
char *  key_name,
char *  key_class,
uint32  access_desired,
POLICY_HND key 
)

cli_reg.c447 行で定義されています。

参照先 cliREG_R_CREATE_KEY_EX::handleinit_reg_q_create_key_ex()make_sec_desc()make_sec_desc_buf()reg_io_q_create_key_ex()reg_io_r_create_key_ex()REG_R_CREATE_KEY_EX::status.

参照元 cac_RegCreateKey().

00450 {
00451         REG_Q_CREATE_KEY_EX in;
00452         REG_R_CREATE_KEY_EX out;
00453         prs_struct qbuf, rbuf;
00454         SEC_DESC *sec;
00455         SEC_DESC_BUF *sec_buf;
00456         size_t sec_len;
00457 
00458         ZERO_STRUCT (in);
00459         ZERO_STRUCT (out);
00460         
00461         if ( !(sec = make_sec_desc(mem_ctx, 1, SEC_DESC_SELF_RELATIVE,
00462                 NULL, NULL, NULL, NULL, &sec_len)) ) {
00463                 return WERR_GENERAL_FAILURE;
00464         }
00465                                  
00466         if ( !(sec_buf = make_sec_desc_buf(mem_ctx, sec_len, sec)) )
00467                 return WERR_GENERAL_FAILURE;
00468 
00469         init_reg_q_create_key_ex(&in, hnd, key_name, key_class, access_desired, sec_buf);
00470 
00471         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_CREATE_KEY_EX, 
00472                     in, out, 
00473                     qbuf, rbuf,
00474                     reg_io_q_create_key_ex,
00475                     reg_io_r_create_key_ex, 
00476                     WERR_GENERAL_FAILURE );
00477                     
00478 
00479         if ( !W_ERROR_IS_OK( out.status ) )
00480                 return out.status;
00481         
00482         memcpy( key, &out.handle, sizeof(POLICY_HND) );
00483         
00484         return out.status;
00485 }

WERROR rpccli_reg_enum_key ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
int  key_index,
fstring  key_name,
fstring  class_name,
time_t *  mod_time 
)

cli_reg.c491 行で定義されています。

参照先 UNISTR2::bufferREG_R_ENUM_KEY::classnamecliinit_reg_q_enum_key()REG_R_ENUM_KEY::keynament_time_to_unix()reg_io_q_enum_key()reg_io_r_enum_key()rpcstr_pull()REG_R_ENUM_KEY::statusUNISTR4::stringREG_R_ENUM_KEY::time.

参照元 cac_delete_subkeys_recursive()cac_RegEnumKeys()rpc_registry_enumerate_internal().

00494 {
00495         REG_Q_ENUM_KEY in;
00496         REG_R_ENUM_KEY out;
00497         prs_struct qbuf, rbuf;
00498 
00499         ZERO_STRUCT (in);
00500         ZERO_STRUCT (out);
00501         
00502         init_reg_q_enum_key(&in, hnd, key_index);
00503 
00504         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_ENUM_KEY, 
00505                     in, out, 
00506                     qbuf, rbuf,
00507                     reg_io_q_enum_key,
00508                     reg_io_r_enum_key, 
00509                     WERR_GENERAL_FAILURE );
00510 
00511         if ( !W_ERROR_IS_OK(out.status) )
00512                 return out.status;
00513 
00514         if ( out.keyname.string )
00515                 rpcstr_pull( key_name, out.keyname.string->buffer, sizeof(fstring), -1, STR_TERMINATE );
00516         else
00517                 fstrcpy( key_name, "(Default)" );
00518 
00519         if ( out.classname && out.classname->string )
00520                 rpcstr_pull( class_name, out.classname->string->buffer, sizeof(fstring), -1, STR_TERMINATE );
00521         else
00522                 fstrcpy( class_name, "" );
00523 
00524         *mod_time   = nt_time_to_unix(*out.time);
00525 
00526         return out.status;
00527 }

WERROR rpccli_reg_set_val ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
char *  val_name,
uint32  type,
RPC_DATA_BLOB data 
)

cli_reg.c533 行で定義されています。

参照先 cliinit_reg_q_set_val()reg_io_q_set_value()reg_io_r_set_value()REG_R_SET_VALUE::status.

参照元 cac_RegSetValue().

00536 {
00537         REG_Q_SET_VALUE in;
00538         REG_R_SET_VALUE out;
00539         prs_struct qbuf, rbuf;
00540 
00541         ZERO_STRUCT (in);
00542         ZERO_STRUCT (out);
00543         
00544         init_reg_q_set_val(&in, hnd, val_name, type, data);
00545 
00546         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_SET_VALUE, 
00547                     in, out, 
00548                     qbuf, rbuf,
00549                     reg_io_q_set_value,
00550                     reg_io_r_set_value, 
00551                     WERR_GENERAL_FAILURE );
00552 
00553         return out.status;
00554 }

WERROR rpccli_reg_enum_val ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
int  idx,
fstring  val_name,
uint32 *  type,
REGVAL_BUFFER value 
)

cli_reg.c560 行で定義されています。

参照先 REG_R_ENUM_VALUE::buffer_len1cliinit_reg_q_enum_val()REG_R_ENUM_VALUE::namereg_io_q_enum_val()reg_io_r_enum_val()REG_R_ENUM_VALUE::statusUNISTR4::stringREG_R_ENUM_VALUE::typeunistr2_to_ascii()REG_R_ENUM_VALUE::value.

参照元 cac_RegEnumValues()rpc_registry_enumerate_internal().

00563 {
00564         REG_Q_ENUM_VALUE in;
00565         REG_R_ENUM_VALUE out;
00566         prs_struct qbuf, rbuf;
00567 
00568         ZERO_STRUCT (in);
00569         ZERO_STRUCT (out);
00570         
00571         init_reg_q_enum_val(&in, hnd, idx, 0x0100, 0x1000);
00572 
00573         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_ENUM_VALUE, 
00574                     in, out, 
00575                     qbuf, rbuf,
00576                     reg_io_q_enum_val,
00577                     reg_io_r_enum_val, 
00578                     WERR_GENERAL_FAILURE );
00579 
00580         if ( W_ERROR_EQUAL(out.status, WERR_MORE_DATA) ) {
00581 
00582                 ZERO_STRUCT (in);
00583 
00584                 init_reg_q_enum_val(&in, hnd, idx, 0x0100, *out.buffer_len1);
00585 
00586                 ZERO_STRUCT (out);
00587 
00588                 CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_ENUM_VALUE, 
00589                             in, out, 
00590                             qbuf, rbuf,
00591                             reg_io_q_enum_val,
00592                             reg_io_r_enum_val, 
00593                             WERR_GENERAL_FAILURE );
00594         }
00595 
00596         if ( !W_ERROR_IS_OK(out.status) )
00597                 return out.status;
00598 
00599         unistr2_to_ascii(val_name, out.name.string, sizeof(fstring)-1);
00600         *type      = *out.type;
00601         *value     = *out.value;
00602         
00603         return out.status;
00604 }

WERROR rpccli_reg_open_entry ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
char *  key_name,
uint32  access_desired,
POLICY_HND key_hnd 
)

cli_reg.c609 行で定義されています。

参照先 cliREG_R_OPEN_ENTRY::handleinit_reg_q_open_entry()reg_io_q_open_entry()reg_io_r_open_entry()REG_R_OPEN_ENTRY::status.

参照元 cac_delete_subkeys_recursive()cac_RegOpenKey()rpc_registry_enumerate_internal()rpc_registry_save_internal().

00612 {
00613         REG_Q_OPEN_ENTRY in;
00614         REG_R_OPEN_ENTRY out;
00615         prs_struct qbuf, rbuf;
00616 
00617         ZERO_STRUCT (in);
00618         ZERO_STRUCT (out);
00619         
00620         init_reg_q_open_entry(&in, hnd, key_name, access_desired);
00621 
00622         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_OPEN_ENTRY, 
00623                     in, out, 
00624                     qbuf, rbuf,
00625                     reg_io_q_open_entry,
00626                     reg_io_r_open_entry, 
00627                     WERR_GENERAL_FAILURE );
00628 
00629         if ( !W_ERROR_IS_OK( out.status ) )
00630                 return out.status;
00631 
00632         memcpy( key_hnd, &out.handle, sizeof(POLICY_HND) );
00633         
00634         return out.status;
00635 }

WERROR rpccli_reg_close ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd 
)

cli_reg.c640 行で定義されています。

参照先 cliinit_reg_q_close()reg_io_q_close()reg_io_r_close()REG_R_CLOSE::status.

参照元 cac_delete_subkeys_recursive()cac_RegClose()cac_RegOpenKey()rpc_registry_enumerate_internal()rpc_registry_save_internal().

00642 {
00643         REG_Q_CLOSE in;
00644         REG_R_CLOSE out;
00645         prs_struct qbuf, rbuf;
00646 
00647         ZERO_STRUCT (in);
00648         ZERO_STRUCT (out);
00649         
00650         init_reg_q_close(&in, hnd);
00651 
00652         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_CLOSE, 
00653                     in, out, 
00654                     qbuf, rbuf,
00655                     reg_io_q_close,
00656                     reg_io_r_close, 
00657                     WERR_GENERAL_FAILURE );
00658         
00659         return out.status;
00660 }

WERROR rpccli_reg_save_key ( struct rpc_pipe_client cli,
TALLOC_CTX mem_ctx,
POLICY_HND hnd,
const char *  filename 
)

cli_reg.c666 行で定義されています。

参照先 cliinit_q_reg_save_key()reg_io_q_save_key()reg_io_r_save_key()REG_R_SAVE_KEY::status.

参照元 cac_RegSaveKey()rpc_registry_save_internal().

00668 {
00669         REG_Q_SAVE_KEY in;
00670         REG_R_SAVE_KEY out;
00671         prs_struct qbuf, rbuf;
00672 
00673         ZERO_STRUCT (in);
00674         ZERO_STRUCT (out);
00675         
00676         init_q_reg_save_key( &in, hnd, filename );
00677 
00678         CLI_DO_RPC_WERR( cli, mem_ctx, PI_WINREG, REG_SAVE_KEY, 
00679                     in, out, 
00680                     qbuf, rbuf,
00681                     reg_io_q_save_key,
00682                     reg_io_r_save_key,
00683                     WERR_GENERAL_FAILURE );
00684 
00685         return out.status;
00686 }

BOOL reg_split_hive ( const char *  full_keyname,
uint32 *  reg_type,
pstring  key_name 
)

cli_reg.c699 行で定義されています。

参照先 next_token()strequal().

参照元 rpc_registry_enumerate_internal()rpc_registry_save_internal().

00700 {
00701         pstring tmp;
00702 
00703         if (!next_token(&full_keyname, tmp, "\\", sizeof(tmp)))
00704                 return False;
00705 
00706         (*reg_type) = 0;
00707 
00708         DEBUG(10, ("reg_split_key: hive %s\n", tmp));
00709 
00710         if (strequal(tmp, "HKLM") || strequal(tmp, "HKEY_LOCAL_MACHINE"))
00711                 (*reg_type) = HKEY_LOCAL_MACHINE;
00712         else if (strequal(tmp, "HKCR") || strequal(tmp, "HKEY_CLASSES_ROOT"))
00713                 (*reg_type) = HKEY_CLASSES_ROOT;
00714         else if (strequal(tmp, "HKU") || strequal(tmp, "HKEY_USERS"))
00715                 (*reg_type) = HKEY_USERS;
00716         else if (strequal(tmp, "HKPD")||strequal(tmp, "HKEY_PERFORMANCE_DATA"))
00717                 (*reg_type) = HKEY_PERFORMANCE_DATA;
00718         else {
00719                 DEBUG(10,("reg_split_key: unrecognised hive key %s\n", tmp));
00720                 return False;
00721         }
00722         
00723         if (next_token(&full_keyname, tmp, "\n\r", sizeof(tmp)))
00724                 pstrcpy(key_name, tmp);
00725         else
00726                 key_name[0] = 0;
00727 
00728         DEBUG(10, ("reg_split_key: name %s\n", key_name));
00729 
00730         return True;
00731 }


Sambaに対してSat Aug 29 21:24:07 2009に生成されました。  doxygen 1.4.7