_winspool_AsyncInstallPrinterDriverFromPackage
****************************************************************/
+static WERROR get_package_id_from_inf_path(TALLOC_CTX *mem_ctx,
+ const char *pszInfPath,
+ const char **package_id)
+{
+ char *s, *p;
+
+ p = talloc_strdup(mem_ctx, pszInfPath);
+ if (p == NULL) {
+ return WERR_NOT_ENOUGH_MEMORY;
+ }
+
+ s = strrchr(p, '/');
+ if (s == NULL) {
+ return WERR_BAD_PATHNAME;
+ }
+
+ *s = '\0';
+ s++;
+
+ *package_id = s;
+
+ return WERR_OK;
+}
+
static WERROR create_driver_package_path(TALLOC_CTX *mem_ctx,
const char *pszInfPath,
const char *pszEnvironment,
struct dcesrv_call_state *dce_call = p->dce_call;
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
+ const char *package_id;
ok = winspool_is_privileged_user(session_info);
if (!ok) {
return HRESULT_FROM_WERROR(result);
}
+
+ result = get_package_id_from_inf_path(p->mem_ctx,
+ r->in.pszInfPath,
+ &package_id);
+ if (!W_ERROR_IS_OK(result)) {
+ return HRESULT_FROM_WERROR(result);
+ }
+
+ result = winreg_add_driver_package_internal(p->mem_ctx,
+ get_session_info_system(),
+ p->msg_ctx,
+ package_id,
+ r->in.pszEnvironment,
+ r->in.pszInfPath,
+ cabinet);
+ if (!W_ERROR_IS_OK(result)) {
+ return HRESULT_FROM_WERROR(result);
+ }
+
result = winreg_add_driver_internal(p->mem_ctx,
get_session_info_system(),
p->msg_ctx,