---
name: "SHSetThreadRef"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/SHSetThreadRef"
---

# SHSetThreadRef(3w)

## NAME

**SHSetThreadRef** (SHLWAPI.@)

## SYNOPSIS

HRESULT SHSetThreadRef\
  (\
   IUnknown\* *lpUnknown*\
  )

## DESCRIPTION

Store a per-thread object reference.

## PARAMS

*lpUnknown* **\[In\]**  Object reference to store.

## RETURNS

**Success:** **S\_OK**. *lpUnknown* is stored and can be retrieved by **[SHGetThreadRef(3w)](/SHGetThreadRef/3w.md)**

**Failure:** **E\_NOINTERFACE**, if an error occurs

## IMPLEMENTATION

Declared in **"shlwapi.h"**.

Implemented in **"dlls/shlwapi/thread.c"**.

Debug channel **"shell"**.
