librpc:idl: Fix pszDestInfPath winspool parameter type
authorJustin Stephenson <jstephen@redhat.com>
Mon, 17 Sep 2018 15:19:02 +0000 (11:19 -0400)
committerBjoern Jacke <bjacke@samba.org>
Mon, 28 Jan 2019 14:44:18 +0000 (15:44 +0100)
The in/out type of pszDestInfPath needs to be a string type for
RPC call UploadPrinterDriverPackage.

Per the Spec:

[in, out, unique, size_is(*pcchDestInfPath)] wchar_t* pszDestInfPath,

 pszDestInfPath: A pointer to a buffer that receives a string that
 specifies the full path of the directory to which the driver
 installation control file was copied.

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
librpc/idl/winspool.idl
source4/torture/rpc/iremotewinspool.c

index dfb45a128d4e702b8dd09acebc0aecf7ed0e6b42..5497a67d34c11849245b3301de82cfb3ea4b1758 100644 (file)
@@ -761,7 +761,7 @@ import "misc.idl", "security.idl", "winreg.idl", "spoolss.idl";
                [in] [string,charset(UTF16)] uint16 *pszInfPath,
                [in] [string,charset(UTF16)] uint16 *pszEnvironment,
                [in] winspool_UploadPrinterDriverPackageFlags dwFlags,
-               [in, out, unique, size_is(*pcchDestInfPath)] uint16 *pszDestInfPath,
+               [in, out, unique, size_is(*pcchDestInfPath)] [charset(UTF16)] uint16 *pszDestInfPath,
                [in, out]                  uint32 *pcchDestInfPath
        );
 
index 03613b443e3f0760771bd4c081eaf5d0fa8a302b..662e132593a28bd2b9f3008bcf8328b94bda02a7 100644 (file)
@@ -399,8 +399,8 @@ static bool test_AsyncUploadPrinterDriverPackage(struct torture_context *tctx,
                "AsyncUploadPrinterDriverPackage failed");
 
        pcchDestInfPath = 260;
-       r.in.pszDestInfPath = talloc_zero_array(tctx, uint16_t, pcchDestInfPath);
-       r.out.pszDestInfPath = talloc_zero_array(tctx, uint16_t, pcchDestInfPath);
+       r.in.pszDestInfPath = talloc_zero(tctx, const char);
+       r.out.pszDestInfPath = talloc_zero(tctx, const char);
 
        torture_assert_ntstatus_ok(tctx,
                dcerpc_winspool_AsyncUploadPrinterDriverPackage_r(b, tctx, &r),