{"record":{"id":"263a86320c1598c0","repo":"HandyOrg/HandyControl","slug":"notimplemented","errorCode":null,"errorMessage":"NotImplemented","messagePattern":"NotImplemented","errorType":"exception","errorClass":"ExternalException","httpStatus":null,"severity":"error","filePath":"src/Shared/HandyControl_Shared/Data/Gif/GPStream.cs","lineNumber":125,"sourceCode":"    }\n\n    public virtual Stream GetDataStream()\n    {\n        return DataStream;\n    }\n\n    public virtual void LockRegion(long libOffset, long cb, int dwLockType)\n    {\n    }\n\n    protected static ExternalException EFail(string msg)\n    {\n        throw new ExternalException(msg, InteropMethods.E_FAIL);\n    }\n\n    protected static void NotImplemented()\n    {\n        throw new ExternalException(\"NotImplemented\");\n    }\n\n    public virtual int Read(IntPtr buf, int length)\n    {\n        var buffer = new byte[length];\n        var count = Read(buffer, length);\n        Marshal.Copy(buffer, 0, buf, length);\n        return count;\n    }\n\n    public virtual int Read(byte[] buffer, int length)\n    {\n        ActualizeVirtualPosition();\n        return DataStream.Read(buffer, 0, length);\n    }\n\n    public virtual void Revert()\n    {","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/HandyOrg/HandyControl/blob/2c0875ebd67326e0c67282967e3e809c69282fee/src/Shared/HandyControl_Shared/Data/Gif/GPStream.cs#L107-L143","documentation":"GPStream (a native-memory GIF stream wrapper in HandyControl) contains methods that are stubbed out via the protected NotImplemented() helper, which throws an ExternalException with E_FAIL. Calling Clone() or Revert() on this stream always fails because the functionality was never implemented in the managed GIF decoder. It signals a deliberately unsupported code path, not a data problem.","triggerScenarios":"Calling GPStream.Clone() or GPStream.Revert(); also reached if any internal GIF decoding path invokes these unimplemented members.","commonSituations":"Using the HandyControl GifImage pipeline in code that clones streams (e.g. caching, rewind/replay logic) or upgrading from a framework stream type that supported cloning to this wrapper.","solutions":["Remove or avoid code paths that call Clone() or Revert() on GPStream; re-create the stream from the source GIF bytes instead of cloning it.","Implement Clone()/Revert() yourself by subclassing GPStream or wrapping it with your own stream class that supports the required operations.","If the GIF is not animated or does not need seeking, use the stream unidirectionally (Read only)."],"exampleFix":"// before\nvar cloned = (GPStream)gifStream.Clone();\n// after\nvar cloned = new GPStream(File.ReadAllBytes(gifPath)); // re-create instead of cloning","handlingStrategy":"try-catch","validationCode":"if (stream is GPStream) { /* do not call Clone()/Revert() on GPStream */ }","typeGuard":null,"tryCatchPattern":"try { var clone = stream.Clone(); } catch (ExternalException ex) when (ex.Message == \"NotImplemented\") { // fall back to re-creating the stream from source bytes\n    stream = new GPStream(File.ReadAllBytes(gifPath)); }","preventionTips":["Never call Clone() or Revert() on GPStream; re-create streams from source bytes instead.","Wrap GPStream usage behind an abstraction so stream-cloning code stays out of the GIF path."],"tags":["gif","stream","not-implemented"],"backgroundTag":"method-not-implemented","analyzedSha":"2c0875ebd67326e0c67282967e3e809c69282fee","analyzedAt":"2026-09-14T14:45:29.754Z","contentChangedAt":"2026-09-14T14:45:29.754Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}