亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? net_rpc_printer.c

?? samba-3.0.22.tar.gz 編譯smb服務器的源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
			/* adddriver dst */			if (!net_spoolss_addprinterdriver(pipe_hnd_dst, mem_ctx, level, &drv_ctr_src)) { 				nt_status = NT_STATUS_UNSUCCESSFUL;				goto done;			}							DEBUGADD(1,("Sucessfully added driver [%s] for printer [%s]\n", 				drivername, printername));		}		if (strlen(drivername) == 0) {			DEBUGADD(1,("Did not get driver for printer %s\n",				    printername));			goto done;		}		/* setdriver dst */		init_unistr(&info_ctr_dst.printers_2->drivername, drivername);				if (!net_spoolss_setprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, 2, &info_ctr_dst)) { 			nt_status = NT_STATUS_UNSUCCESSFUL;			goto done;		}		DEBUGADD(1,("Sucessfully set driver %s for printer %s\n", 			drivername, printername));		/* close dst */		if (got_hnd_dst) {			rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);			got_hnd_dst = False;		}		/* close src */		if (got_hnd_src) {			rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);			got_hnd_src = False;		}	}	nt_status = NT_STATUS_OK;done:	if (got_hnd_src)		rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);	if (got_hnd_dst)		rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);	if (cli_dst) {		cli_shutdown(cli_dst);	}	if (got_src_driver_share)		cli_shutdown(cli_share_src);	if (got_dst_driver_share)		cli_shutdown(cli_share_dst);	return nt_status;}/**  * Migrate printer-queues from a src to the dst server * (requires a working "addprinter command" to be installed for the local smbd) * * All parameters are provided by the run_rpc_command function, except for * argc, argv which are passed through.  * * @param domain_sid The domain sid aquired from the remote server * @param cli A cli_state connected to the server. * @param mem_ctx Talloc context, destoyed on compleation of the function. * @param argc  Standard main() style argc * @param argv  Standard main() style argv.  Initial components are already *              stripped * * @return Normal NTSTATUS return. **/NTSTATUS rpc_printer_migrate_printers_internals(const DOM_SID *domain_sid,						const char *domain_name, 						struct cli_state *cli,						struct rpc_pipe_client *pipe_hnd,						TALLOC_CTX *mem_ctx, 						int argc,						const char **argv){	WERROR result;	NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;	uint32 i = 0, num_printers;	uint32 level = 2;	PRINTER_INFO_CTR ctr_src, ctr_dst, ctr_enum;	struct cli_state *cli_dst = NULL;	POLICY_HND hnd_dst, hnd_src;	pstring printername, sharename;	BOOL got_hnd_src = False;	BOOL got_hnd_dst = False;	struct rpc_pipe_client *pipe_hnd_dst = NULL;	DEBUG(3,("copying printers\n"));	/* connect destination PI_SPOOLSS */	nt_status = connect_dst_pipe(&cli_dst, &pipe_hnd_dst, PI_SPOOLSS);	if (!NT_STATUS_IS_OK(nt_status))		return nt_status;	/* enum printers */	if (!get_printer_info(pipe_hnd, mem_ctx, level, argc, argv, &num_printers, &ctr_enum)) {		nt_status = NT_STATUS_UNSUCCESSFUL;		goto done;	}	if (!num_printers) {		printf ("no printers found on server.\n");		nt_status = NT_STATUS_OK;		goto done;	} 		/* do something for all printers */	for (i = 0; i < num_printers; i++) {		/* do some initialization */		rpcstr_pull(printername, ctr_enum.printers_2[i].printername.buffer, 			sizeof(printername), -1, STR_TERMINATE);		rpcstr_pull(sharename, ctr_enum.printers_2[i].sharename.buffer, 			sizeof(sharename), -1, STR_TERMINATE);		/* we can reset NT_STATUS here because we do not 		   get any real NT_STATUS-codes anymore from now on */		nt_status = NT_STATUS_UNSUCCESSFUL;				d_printf("migrating printer queue for:    [%s] / [%s]\n", 			printername, sharename);		/* open dst printer handle */		if (!net_spoolss_open_printer_ex(pipe_hnd_dst, mem_ctx, sharename, 			PRINTER_ALL_ACCESS, cli->user_name, &hnd_dst)) {						DEBUG(1,("could not open printer: %s\n", sharename));		} else {			got_hnd_dst = True;		}		/* check for existing dst printer */		if (!net_spoolss_getprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, level, &ctr_dst)) {			printf ("could not get printer, creating printer.\n");		} else {			DEBUG(1,("printer already exists: %s\n", sharename));			/* close printer handles here */			if (got_hnd_src) {				rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);				got_hnd_src = False;			}			if (got_hnd_dst) {				rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);				got_hnd_dst = False;			}			continue;		}		/* now get again src printer ctr via getprinter, 		   we first need a handle for that */		/* open src printer handle */		if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,			MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src)) 			goto done;		got_hnd_src = True;		/* getprinter on the src server */		if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd_src, level, &ctr_src)) 			goto done;		/* copy each src printer to a dst printer 1:1, 		   maybe some values have to be changed though */		d_printf("creating printer: %s\n", printername);		result = rpccli_spoolss_addprinterex (pipe_hnd_dst, mem_ctx, level, &ctr_src);		if (W_ERROR_IS_OK(result))			d_printf ("printer [%s] successfully added.\n", printername);		else if (W_ERROR_V(result) == W_ERROR_V(WERR_PRINTER_ALREADY_EXISTS)) 			d_fprintf (stderr, "printer [%s] already exists.\n", printername);		else {			d_fprintf (stderr, "could not create printer [%s]\n", printername);			goto done;		}		/* close printer handles here */		if (got_hnd_src) {			rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);			got_hnd_src = False;		}		if (got_hnd_dst) {			rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);			got_hnd_dst = False;		}	}	nt_status = NT_STATUS_OK;done:	if (got_hnd_src)		rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);	if (got_hnd_dst)		rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);	if (cli_dst) {		cli_shutdown(cli_dst);	}	return nt_status;}/**  * Migrate Printer-Settings from a src server to the dst server * (for this to work, printers and drivers already have to be migrated earlier) * * All parameters are provided by the run_rpc_command function, except for * argc, argv which are passed through.  * * @param domain_sid The domain sid aquired from the remote server * @param cli A cli_state connected to the server. * @param mem_ctx Talloc context, destoyed on compleation of the function. * @param argc  Standard main() style argc * @param argv  Standard main() style argv.  Initial components are already *              stripped * * @return Normal NTSTATUS return. **/NTSTATUS rpc_printer_migrate_settings_internals(const DOM_SID *domain_sid,						const char *domain_name, 						struct cli_state *cli,						struct rpc_pipe_client *pipe_hnd,						TALLOC_CTX *mem_ctx, 						int argc,						const char **argv){	/* FIXME: Here the nightmare begins */	WERROR result;	NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;	uint32 i = 0, p = 0, j = 0;	uint32 num_printers, val_needed, data_needed;	uint32 level = 2;	pstring printername = "", sharename = "";	BOOL got_hnd_src = False;	BOOL got_hnd_dst = False;	struct rpc_pipe_client *pipe_hnd_dst = NULL;	POLICY_HND hnd_src, hnd_dst;	PRINTER_INFO_CTR ctr_enum, ctr_dst, ctr_dst_publish;	REGVAL_CTR *reg_ctr;	struct cli_state *cli_dst = NULL;	char *devicename = NULL, *unc_name = NULL, *url = NULL;	fstring longname;	uint16 *keylist = NULL, *curkey;	ZERO_STRUCT(ctr_enum);	DEBUG(3,("copying printer settings\n"));	/* connect destination PI_SPOOLSS */	nt_status = connect_dst_pipe(&cli_dst, &pipe_hnd_dst, PI_SPOOLSS);	if (!NT_STATUS_IS_OK(nt_status))		return nt_status;	/* enum src printers */	if (!get_printer_info(pipe_hnd, mem_ctx, level, argc, argv, &num_printers, &ctr_enum)) {		nt_status = NT_STATUS_UNSUCCESSFUL;		goto done;	}	if (!num_printers) {		printf ("no printers found on server.\n");		nt_status = NT_STATUS_OK;		goto done;	} 		/* needed for dns-strings in regkeys */	get_mydnsfullname(longname);		/* do something for all printers */	for (i = 0; i < num_printers; i++) {		/* do some initialization */		rpcstr_pull(printername, ctr_enum.printers_2[i].printername.buffer, 			sizeof(printername), -1, STR_TERMINATE);		rpcstr_pull(sharename, ctr_enum.printers_2[i].sharename.buffer, 			sizeof(sharename), -1, STR_TERMINATE);				/* we can reset NT_STATUS here because we do not 		   get any real NT_STATUS-codes anymore from now on */		nt_status = NT_STATUS_UNSUCCESSFUL;				d_printf("migrating printer settings for: [%s] / [%s]\n", 			printername, sharename);		/* open src printer handle */		if (!net_spoolss_open_printer_ex(pipe_hnd, mem_ctx, sharename,			MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src)) 			goto done;		got_hnd_src = True;		/* open dst printer handle */		if (!net_spoolss_open_printer_ex(pipe_hnd_dst, mem_ctx, sharename,			PRINTER_ALL_ACCESS, cli_dst->user_name, &hnd_dst)) 			goto done;		got_hnd_dst = True;		/* check for existing dst printer */		if (!net_spoolss_getprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, 				level, &ctr_dst)) 			goto done;		/* STEP 1: COPY DEVICE-MODE and other 			   PRINTER_INFO_2-attributes		*/		ctr_dst.printers_2 = &ctr_enum.printers_2[i];		/* why is the port always disconnected when the printer 		   is correctly installed (incl. driver ???) */		init_unistr( &ctr_dst.printers_2->portname, SAMBA_PRINTER_PORT_NAME);		/* check if printer is published */ 		if (ctr_enum.printers_2[i].attributes & PRINTER_ATTRIBUTE_PUBLISHED) {			/* check for existing dst printer */			if (!net_spoolss_getprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, 7, &ctr_dst_publish))				goto done;			ctr_dst_publish.printers_7->action = SPOOL_DS_PUBLISH;			/* ignore False from setprinter due to WERR_IO_PENDING */	 		net_spoolss_setprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, 7, &ctr_dst_publish);			DEBUG(3,("republished printer\n"));		}		if (ctr_enum.printers_2[i].devmode != NULL) {			/* copy devmode (info level 2) */			ctr_dst.printers_2->devmode =				TALLOC_MEMDUP(mem_ctx,					      ctr_enum.printers_2[i].devmode,					      sizeof(DEVICEMODE));			/* do not copy security descriptor (we have another			 * command for that) */			ctr_dst.printers_2->secdesc = NULL;#if 0			if (asprintf(&devicename, "\\\\%s\\%s", longname,				     printername) < 0) {				nt_status = NT_STATUS_NO_MEMORY;				goto done;			}			init_unistr(&ctr_dst.printers_2->devmode->devicename,				    devicename); #endif			if (!net_spoolss_setprinter(pipe_hnd_dst, mem_ctx, &hnd_dst,						    level, &ctr_dst)) 				goto done;					DEBUGADD(1,("\tSetPrinter of DEVICEMODE succeeded\n"));		}		/* STEP 2: COPY REGISTRY VALUES */			/* please keep in mind that samba parse_spools gives horribly 		   crippled results when used to rpccli_spoolss_enumprinterdataex 		   a win2k3-server.  (Bugzilla #1851)		   FIXME: IIRC I've seen it too on a win2k-server 		*/		/* enumerate data on src handle */		result = rpccli_spoolss_enumprinterdata(pipe_hnd, mem_ctx, &hnd_src, p, 0, 0,			&val_needed, &data_needed, NULL);		/* loop for all printerdata of "PrinterDriverData" */		while (W_ERROR_IS_OK(result)) {						REGISTRY_VALUE value;						result = rpccli_spoolss_enumprinterdata(				pipe_hnd, mem_ctx, &hnd_src, p++, val_needed,				data_needed, 0, 0, &value);			/* loop for all reg_keys */			if (W_ERROR_IS_OK(result)) {				/* display_value */				if (opt_verbose) 					display_reg_value(SPOOL_PRINTERDATA_KEY, value);				/* set_value */				if (!net_spoolss_setprinterdata(pipe_hnd_dst, mem_ctx, 								&hnd_dst, &value)) 					goto done;				DEBUGADD(1,("\tSetPrinterData of [%s] succeeded\n", 					value.valuename));			}		}				/* STEP 3: COPY SUBKEY VALUES */		/* here we need to enum all printer_keys and then work 		   on the result with enum_printer_key_ex. nt4 does not		   respond to enumprinterkey, win2k does, so continue 		   in case of an error */		if (!net_spoolss_enumprinterkey(pipe_hnd, mem_ctx, &hnd_src, "", &keylist)) {			printf("got no key-data\n");			continue;		}		/* work on a list of printer keys 		   each key has to be enumerated to get all required		   information.  information is then set via setprinterdataex-calls */ 		if (keylist == NULL)			continue;		curkey = keylist;		while (*curkey != 0) {			pstring subkey;			rpcstr_pull(subkey, curkey, sizeof(subkey), -1, STR_TERMINATE);			curkey += strlen(subkey) + 1;			if ( !(reg_ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) )				return NT_STATUS_NO_MEMORY;			/* enumerate all src subkeys */			if (!net_spoolss_enumprinterdataex(pipe_hnd, mem_ctx, 0, 							   &hnd_src, subkey, 							   reg_ctr)) 				goto done;			for (j=0; j < reg_ctr->num_values; j++) {							REGISTRY_VALUE value;				UNISTR2 data;							/* although samba replies with sane data in most cases we 				   should try to avoid writing wrong registry data */					if (strequal(reg_ctr->values[j]->valuename, SPOOL_REG_PORTNAME) || 				    strequal(reg_ctr->values[j]->valuename, SPOOL_REG_UNCNAME) ||				    strequal(reg_ctr->values[j]->valuename, SPOOL_REG_URL) ||				    strequal(reg_ctr->values[j]->valuename, SPOOL_REG_SHORTSERVERNAME) ||				    strequal(reg_ctr->values[j]->valuename, SPOOL_REG_SERVERNAME)) {					if (strequal(reg_ctr->values[j]->valuename, SPOOL_REG_PORTNAME)) {									

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av一区二区| 精品女同一区二区| 依依成人综合视频| 欧洲国内综合视频| 亚洲r级在线视频| 7777精品伊人久久久大香线蕉最新版 | 自拍偷拍欧美精品| 91麻豆国产精品久久| 极品少妇xxxx精品少妇| www激情久久| 99久久99久久久精品齐齐| 亚洲午夜免费福利视频| 日韩亚洲欧美中文三级| 国产91清纯白嫩初高中在线观看| 国产精品久久久久影院亚瑟 | 国产精品视频在线看| 99re8在线精品视频免费播放| 一区二区三区欧美激情| 欧美成人高清电影在线| 99久久久久久| 奇米精品一区二区三区四区| 国产欧美一区视频| 欧美三级日韩三级国产三级| 激情综合一区二区三区| 亚洲欧美一区二区三区国产精品| 欧美日韩不卡一区二区| 丰满放荡岳乱妇91ww| 午夜精品视频在线观看| 中文字幕免费不卡| 欧美一区二区在线播放| 成人国产电影网| 蜜桃av噜噜一区| 亚洲人成网站色在线观看| 日韩欧美国产一区二区在线播放| 91免费视频网址| 精品一区二区三区蜜桃| 一区二区三区日韩精品视频| 亚洲精品一区二区精华| 欧美三级日韩三级| 成人app在线| 久久99精品国产.久久久久| 亚洲乱码一区二区三区在线观看| 欧美成人一区二区三区| 欧美日韩国产免费| caoporen国产精品视频| 国产一区在线看| 奇米影视7777精品一区二区| 尤物视频一区二区| 日本一区二区久久| 欧美精品一区二区三区四区| 欧美日韩一区二区三区四区五区| 成人精品免费视频| 国产一区中文字幕| 麻豆精品视频在线观看免费| 亚洲成人自拍偷拍| 一区二区三区中文字幕在线观看| 中文在线一区二区| 国产欧美日韩精品在线| 精品国产1区二区| 日韩欧美卡一卡二| 91精品在线观看入口| 欧美理论片在线| 在线观看国产日韩| 在线视频观看一区| 色av综合在线| 日韩午夜激情av| 欧美日韩激情在线| 欧美三级在线视频| 欧美美女黄视频| 欧美日韩一区二区三区四区五区| 日本国产一区二区| 91猫先生在线| 91精彩视频在线| 91日韩精品一区| 91天堂素人约啪| 色综合久久久久综合体桃花网| 99久久夜色精品国产网站| 成人一区二区三区| 成人av网址在线| 一本色道久久综合狠狠躁的推荐| 国产91精品精华液一区二区三区| 成人午夜私人影院| 99久久精品免费观看| 色哟哟国产精品免费观看| 日本二三区不卡| 欧美日韩精品一区二区天天拍小说 | 国产女同性恋一区二区| 中文幕一区二区三区久久蜜桃| 国产午夜久久久久| 中文字幕在线观看一区| 亚洲婷婷综合色高清在线| 亚洲人精品午夜| 亚洲bt欧美bt精品777| 日本在线不卡一区| 国产成人午夜精品影院观看视频 | 亚洲精品在线免费观看视频| 国产日韩精品一区二区三区| 1000精品久久久久久久久| 亚洲成人福利片| 激情文学综合插| 91在线国产福利| 欧美日韩国产综合一区二区三区| 欧美一区二区人人喊爽| 久久精品男人天堂av| 曰韩精品一区二区| 玖玖九九国产精品| 波波电影院一区二区三区| 一本大道久久精品懂色aⅴ| 欧美一区二区三区免费观看视频| 亚洲精品一区二区三区香蕉| 日韩毛片一二三区| 男女激情视频一区| 99精品国产99久久久久久白柏| 欧美三级中文字幕在线观看| 久久亚洲精华国产精华液 | 日韩不卡一二三区| 成人黄色电影在线| 欧美一区二区三区免费观看视频 | 一区二区三区四区精品在线视频 | 欧美国产精品中文字幕| 亚洲mv大片欧洲mv大片精品| 国产成人自拍网| 欧美日韩五月天| 国产精品久久久久久久久快鸭| 日韩经典一区二区| 波多野洁衣一区| 亚洲精品一区二区精华| 午夜欧美电影在线观看| 成人性生交大片免费看视频在线| 欧美老肥妇做.爰bbww| 国产精品欧美一区二区三区| 男人操女人的视频在线观看欧美| 色综合久久久久| 国产午夜精品福利| 蜜臀a∨国产成人精品| 色偷偷久久人人79超碰人人澡 | 欧美国产综合一区二区| 裸体健美xxxx欧美裸体表演| 色综合久久99| 国产精品国模大尺度视频| 紧缚捆绑精品一区二区| 欧美在线你懂得| 成人欧美一区二区三区黑人麻豆| 激情五月婷婷综合| 日韩你懂的电影在线观看| 亚洲成人一区在线| 在线观看亚洲精品| 国产精品对白交换视频 | 国产精品高潮呻吟| 成人一区二区三区视频| 国产午夜精品美女毛片视频| 韩国三级在线一区| 欧美成人a视频| 日本视频一区二区三区| 在线成人小视频| 亚洲第一搞黄网站| 欧美日韩一级二级| 亚洲综合在线免费观看| 在线一区二区三区| 一个色综合网站| 日本韩国精品在线| 亚洲一区二区三区四区五区黄 | 亚洲r级在线视频| 欧美在线不卡一区| 亚洲午夜激情网站| 欧美视频一区二区三区四区| 亚洲成人午夜影院| 欧美精品免费视频| 免费成人在线播放| 欧美电影免费观看完整版| 久久国产综合精品| 久久综合久久久久88| 国产一区二区三区免费| 国产精品天干天干在观线| 春色校园综合激情亚洲| 中日韩免费视频中文字幕| 91亚洲大成网污www| 亚洲一区二区三区视频在线| 777奇米四色成人影色区| 久久不见久久见免费视频7| 国产视频一区二区三区在线观看 | 色婷婷一区二区| 一区二区三区日本| 欧美丰满高潮xxxx喷水动漫| 久色婷婷小香蕉久久| 欧美国产日本韩| 91成人网在线| 日产国产欧美视频一区精品| 久久众筹精品私拍模特| 91在线播放网址| 天天综合色天天综合色h| 精品美女一区二区三区| 不卡的av网站| 亚洲成人av资源| 久久九九久久九九| 欧美中文字幕一区| 国产一区在线观看视频| 亚洲免费资源在线播放| 欧美一区二区三区视频在线| 成人国产视频在线观看|