Packaging Errors
A complete list of Packaging API errors.
Return code/value | Description |
---|---|
|
The selected package creation settings are inconsistent; an example would be creating a package that uses both Force 32-bit mode and Force 64-bit mode. |
|
Errors that occurred during previous operations prevent the requested operation from completing. Future attempts to perform the operation that triggered this error, or attempts to perform related operations, will fail. |
|
The default digest method has not been set; to set it, call IOpcSigningOptions::SetDefaultDigestMethod. |
|
Cannot get the digest value of a package component or an element in the signature markup that was referenced for signing. |
|
The signature markup contains more than one Reference element that refers to the package Object element, but only one such Reference is allowed. |
|
More than one relationship of the digital signature origin relationship type exists, but only one such relationship is allowed. For more information about this relationship type, see the OPC. |
|
The signature markup contains more than one SignatureProperty element that has the same Id attribute. |
|
A relationship whose target is a Signature part has the external target mode; Signature parts must be inside of the package. |
|
A Reference element in the signature markup refers to an object that is external to the package. Reference elements must point to parts or Object elements that are internal. |
|
An unsupported canonicalization method was requested or used in a signature. |
|
A relationship of type digital signature certificate has the external target mode. For more information about this relationship type, see the OPC. |
|
The signature's time format is not a valid OPC_SIGNATURE_TIME_FORMAT enumeration value. |
|
A Transform element that indicates the use of the relationships transform and the selection criteria for the transform does not conform to the schema specified in the OPC. |
|
An indicated relationship signing option is not a valid OPC_RELATIONSHIPS_SIGNING_OPTION enumeration value. |
|
A Signature part does not contain the signature markup for exactly one signature. |
|
A package relationship of type digital signature origin is targeting a location that is external to the package. Digital Signature Origin parts must be located internally. For more information about this relationship type, see the OPC. |
|
The signature markup in a Signature part does not conform to the schema specified in the OPC or XML-Signature Syntax and Processing (https://go.microsoft.com/fwlink/p/?linkid=132847). |
|
A relationships transform is not followed by a canonicalization method; the relationships transform must be followed by a canonicalization method. |
|
The part that contains the certificate and is the target of a relationship of type digital signature certificate does not exist. For more information about this relationship type, see the OPC. |
|
The signature markup is missing a Reference to the package-specific Object element. |
|
The signature markup does not specify a signature method algorithm. |
|
A relationship of type digital signature origin was found, but the Digital Signature Origin part itself was not. For more information about this relationship type, see the OPC. |
|
The specified Signature part does not exist in the package. |
|
The SignatureProperties element was not found in the signature markup. |
|
The SignatureProperty child element of the SignatureProperties element was not found. |
|
The SignatureProperty element with the Id attribute value of "idSignatureTime" does not exist or is not correctly constructed. |
|
More than one relationships transform is specified for a Reference element, but only one relationships transform is allowed. |
|
The reserved URI attribute value of the signature's Reference element to the package Object is being used as the URI attribute value of a Reference to a custom Object element. |
|
The URI attribute value of a Reference element in the signature markup does not include the content type of the referenced part. |
|
A signature in the package is not properly formed. Cannot get the signature value. |
|
The signature method has not been set. Call IOpcSigningOptions::SetSignatureMethod to set the signature method. |
|
A Digital Signature Origin part already exists in the package and cannot be renamed. |
|
The SignatureProperty element is missing the required Target attribute. |
|
The URI attribute is required for a Reference element but is missing. |
|
The package is not signed; therefore, the signature markup cannot be replaced. |
|
More than one Default element specifies the same extension in the content type XML markup. For more information about Default elements and content type XML markup, see the OPC. |
|
More than one Override element in the Content Types stream specifies the same part name as the value of its PartName attribute. If this error is encountered while a package is being read, the package is not valid, because the PartName attribute value for each Override element must be unique. For more information about Override elements, see the OPC. |
|
A part with the specified part name already exists in the current package. |
|
A piece with the same piece number already exists in the current package. Pieces are a result of interleaved parts. If the Packaging API is used to consume a package that supports interleaving, this error may result. The Packaging API does not support the production of packages that have interleaved parts. For more information about interleaving, see the OPC. |
|
A relationship with the same identifier already exists in the current package. |
|
The current position is already past the last item of the enumerator. |
|
The current position already precedes the first item of the enumerator. |
|
The enumerator is invalid because the underlying set has changed. |
|
The enumerator cannot perform this operation from its current position. |
|
A content type does not conform to the rules for a valid media type, specified in RFC 2616: HTTP/1.1 (https://go.microsoft.com/fwlink/p/?linkid=143979) and the OPC. |
|
The XML markup that defines package content types in the Content Types stream is not well-formed. |
|
An extension that is provided for a default content type is not valid, because it does not conform to the rules for a part name, specified in the OPC. |
|
The part name that is used as the value of the PartName attribute of an Override element in the Content Types stream does not conform to the rules for a valid part name, specified in RFC 3986: URI Generic Syntax (https://go.microsoft.com/fwlink/p/?linkid=143950) and the OPC. For more information about Override elements, see the OPC. |
|
An unexpected piece was found. Pieces are a result of interleaved parts. If the Packaging API is used to consume a package that has interleaved parts, this error may result. The Packaging API does not support the production of packages that have interleaved parts. For more information about interleaving, see the OPC. |
|
The Id attribute of a relationship does not conform to the rules specified in the OPC. |
|
The Target attribute of a relationship does not conform to the rules specified in the OPC. |
|
The TargetMode attribute of a relationship does not conform to the rules specified in the OPC. |
|
The Type attribute of a relationship does not conform to the rules specified in the OPC. |
|
The relationship markup for a Relationships part is not well-formed XML. |
|
The XML Encoding attribute must be UTF-8 or UTF-16. |
|
The PreserveAttributes attribute does not have a matching Ignorable attribute on the same element. |
|
The PreserveElements attribute does not have a matching Ignorable attribute on the same element. |
|
The ProcessContent attribute does not have a matching Ignorable attribute on the same element. |
|
An element (or its parent) that is ignorable by markup compatibility has an attribute that is prohibited in Part 5: Markup Compatibility and Extensibility of ECMA-376 OpenXML (https://go.microsoft.com/fwlink/p/?linkid=123375). |
|
Encountered an enumeration type that is not valid. |
|
The prefix list cannot be parsed, because it contains a character that is not valid, such as ':'. |
|
A markup compatibility attribute contains an invalid list of element names. |
|
The declaration of an xmlns attribute is malformed. |
|
An AlternateContent element must have at least one Choice element as a child. |
|
A markup compatibility element that requires the Requires attribute is missing the attribute, or that attribute's value is empty. |
|
There is more than one Fallback element within the child elements of an AlternateContent, but only one is allowed. |
|
An AlternateContent element cannot have another AlternateContent element as a child. |
|
A markup compatibility element has an attribute that is not recognized or supported in the markup compatibility namespace. |
|
A Choice element was encountered after the Fallback element, or more than one Fallback element was encountered. |
|
An element that is used in the markup compatibility namespace is not recognized as a valid markup compatibility element. |
|
The Requires attribute was found on a markup compatibility element that does not support this attribute. |
|
The MustUnderstand attribute of an element contains a namespace that is not recognized. |
|
The package contains an XML prefix that is not defined. |
|
Could not find the part that contains Content Types stream. |
|
One or more pieces of an interleaved part were not found. A piece is a file that contains data for an interleaved part. This error may result if the Packaging APIs are used to consume a package that has interleaved parts. Production of packages that have interleaved parts is not supported by the Packaging APIs. For more information about interleaving, see the OPC. |
|
The specified part does not exist. |
|
The specified relationship does not exist. |
|
The Content Types stream XML markup does not conform to the syntax specified in RFC 2616: HTTP/1.1 and the OPC. |
|
The relationship markup does not conform to the rules specified in the OPC. |
|
The part name does not conform to the rules specified in the OPC. |
|
The part name of one part is a segment in the path of the part name of another part. An example would be a part named "path/dirorfile/file.txt" and a part named "path/dirorfile". |
|
The part name of a Relationships part is required, but the part name is not that of a Relationships part. For more information about the part names of Relationships parts, see the OPC. |
|
A part name cannot be an absolute URI. An absolute URI begins with a schema component followed by a ":", as described in RFC 3986: URI Generic Syntax. |
|
Either the content type of a part differed from the expected content type (specified in the OPC, ECMA-376 Part 2), or the part content did not match the part's content type. |
|
The OPC allows certain aspects of a package, such as the number of pieces used to compose a part, to grow without bounds. For practical purposes, however, the Packaging API limits the possible number of pieces to an unsigned DWORD. |
|
The central directory exceeds 65,535 bytes. |
|
The file comment length exceeds 65,535 bytes. |
|
Compression of the data failed. |
|
The archive has an incorrect checksum or signature, or file headers in the central directory are in an unexpected order. |
|
Data decompression failed. |
|
Two file items in the archive have the same name. |
|
The extra field length exceeds 65,535 bytes. |
|
The length of a local file header exceeds 65,535 bytes. |
|
The number of file items found in the archive does not match the number of file items recorded in the central directory. |
|
The file attributes recorded in a file header in the central directory are inconsistent with the attributes of the zipped file item. |
|
A field or header in the archive contains a different number of bytes than expected. |
|
A data descriptor was expected for the file item, but none was found. |
|
The archive is missing the end of the central directory record. |
|
The length of a file item name exceeds 65,535 characters. |
|
The 64-bit ZIP format is required because the data exceeds the capacity of the 32-bit ZIP format. Recreate the package using the 64-bit ZIP format. |
|
The package cannot be read because the archive is either unsupported (for example, a multidisk) or encrypted. |
Remarks
For more information about error handling in COM, see Error Handling (COM).
The following table describes error prefixes used in the Packaging API.
Prefix | Description | Additional Information |
---|---|---|
OPC_E_ | Generic Packaging error | See the OPC. |
OPC_E_DS_ | Packaging digital signature error | See section 12. Digital Signatures of the OPC and [XML Signature Syntax and Processing](https://go.microsoft.com/fwlink/p/?linkid=132847) (https://go.microsoft.com/fwlink/p/?linkid=132847) W3C recommendation. |
OPC_E_ENUM_ | Packaging enumerator error | See the Packaging API enumerator interfaces in the following list.
[IOpcRelationshipEnumerator](/previous-versions/windows/desktop/api/msopc/nn-msopc-iopcrelationshipenumerator) [IOpcCertificateEnumerator](/previous-versions/windows/desktop/api/msopc/nn-msopc-iopccertificateenumerator) [IOpcDigitalSignatureEnumerator](/previous-versions/windows/desktop/api/msopc/nn-msopc-iopcdigitalsignatureenumerator) [IOpcRelationshipSelectorEnumerator](/previous-versions/windows/desktop/api/msopc/nn-msopc-iopcrelationshipselectorenumerator) [IOpcSignatureCustomObjectEnumerator](/previous-versions/windows/desktop/api/msopc/nn-msopc-iopcsignaturecustomobjectenumerator) [IOpcSignaturePartReferenceEnumerator](/previous-versions/windows/desktop/api/msopc/nn-msopc-iopcsignaturepartreferenceenumerator) [IOpcSignatureReferenceEnumerator](/previous-versions/windows/desktop/api/msopc/nn-msopc-iopcsignaturereferenceenumerator) [IOpcSignatureRelationshipReferenceEnumerator](/previous-versions/windows/desktop/api/msopc/nn-msopc-iopcsignaturerelationshipreferenceenumerator) |
OPC_E_MC_ | Packaging markup compatibility error | See Part 5: Markup Compatibility and Extensibility of [ECMA-376 OpenXML](https://go.microsoft.com/fwlink/p/?linkid=123375) (https://go.microsoft.com/fwlink/p/?linkid=123375). |
OPC_E_ZIP_ | Packaging ZIP error | See the [ZIP File Format Specification from PKWARE, Inc.]( https://go.microsoft.com/fwlink/p/?linkid=144545) (https://go.microsoft.com/fwlink/p/?linkid=144545). |
Requirements
Header |
|
See also
-
Overviews
-
Reference
-
External Resources
-
ZIP File Format Specification from PKWARE, Inc., version 6.2.0 (2004)