HttpQueryServiceConfiguration 错误 INVALID_HANDLE

HttpQueryServiceConfiguration error INVALID_HANDLE

我正在尝试通过调用 HttpQueryServiceConfiguration 为我的 Http 服务器获取一些配置信息(使用 HTTP SERVER API 2.0 从 Smalltalk 实现),我得到一个 INVALID_HANDLE (6) 错误。 我已经查看了所有文档,并且我认为我传递了正确的参数。不知道出了什么问题。

我是这样调用 api:

| length return |

info := HTTP_SERVICE_CONFIG_URLACL_SET external.
query := HTTP_SERVICE_CONFIG_URLACL_QUERY external.
key := HTTP_SERVICE_CONFIG_URLACL_KEY new.
key urlPrefix: 'http://localhost:50000/tp/'.
query KeyDesc: key.
length := ExternalLong external.
return := self dll
    HttpQueryServiceConfiguration: 0
    ConfigId: HttpServiceConfigUrlAclInfo
    pInputConfigInfo: query asParameter
    InputConfigInfoLength: query sizeInBytes
    pOutputConfigInfo: info asParameter
    OutputConfigInfoLength: info sizeInBytes
    pReturnLength: length asParameter
    pOverlapped: nil.
return = 0 ifFalse: [self osError: return]

任何想法都会有所帮助,

谢谢!

我在 MSDN documentationHttpSetServiceConfiguration 函数定义中找到了注释。有了这个初始化,函数就成功了!!.

Must call HttpInitialize/HttpTerminate If you get error code 6 (ERROR_INVALID_HANDLE) then be aware that you must >call HttpInitialize() with HTTP_INITIALIZE_CONFIG first.